[GSoC week 1] Add collapsible details to show the newly added content to the English version of the file#1424
[GSoC week 1] Add collapsible details to show the newly added content to the English version of the file#1424aashishpanthi wants to merge 4 commits into
Conversation
| } | ||
| body += `</details>\n\n`; | ||
| } else { | ||
| body += `_(Could't generate preview of the differences for this change. Use the compare link above to see the full diff.)_\n\n`; |
There was a problem hiding this comment.
Minor typo, should be Couldn't
| body += `<details>\n<summary>Show patch snippet</summary>\n\n`; | ||
| body += `\`\`\`diff\n${englishDiff.patchSnippet}\n\`\`\`\n\n`; | ||
| if (englishDiff.isTruncated) { | ||
| body += `_(Patch snippet truncated. Use the compare link above for the full diff.)_\n\n`; |
There was a problem hiding this comment.
by compare link are we referring to View full compare used above?
There was a problem hiding this comment.
by compare link are we referring to
View full compareused above?
yes we are
There was a problem hiding this comment.
Then what if englishDiff.compareUrl is false but englishDiff.patchSnippet is true? your driving if condition will satisfy but there will be no compare link right?
There was a problem hiding this comment.
Then what if
englishDiff.compareUrlis false butenglishDiff.patchSnippetis true? your driving if condition will satisfy but there will be no compare link right?
I was going to say yes, but I looked at the code, and I don't see a scenario where the compareUrl is false. Inside getRecentDiffForFile() there is no instance where the function will return the null compareUrl.
Please let me know if I missed anything.
There was a problem hiding this comment.
@Divyansh013 remove the unncessary coditional statement as we discussed
Divyansh013
left a comment
There was a problem hiding this comment.
Hi, @aashishpanthi LGTM, we will incorporate this code snippet in our final draft
In-Issue Diffs: Update the tracker (index.js) to parse the englishDiff patch snippet and render it within a collapsible
<details>section inside the GitHub Issue body. This allows volunteer translators to see exactly what changed without navigating away.Details
I'm the content that was added or removedThis is my task from week 1: #1404