forked from pingdotgg/t3code
-
Notifications
You must be signed in to change notification settings - Fork 4
sync: port upstream desktop changelog tooltip, macOS launcher, icons (#3832, #4102, #4080) #169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| import { describe, expect, it } from "vite-plus/test"; | ||
|
|
||
| import { normalizeDesktopUpdateReleaseNotes } from "./releaseNotes.ts"; | ||
|
|
||
| describe("normalizeDesktopUpdateReleaseNotes", () => { | ||
| it("splits a plain string note into items under the fallback version", () => { | ||
| const notes = normalizeDesktopUpdateReleaseNotes( | ||
| "## What's changed\n- First fix\n- Second fix", | ||
| "1.2.3", | ||
| ); | ||
| expect(notes).toEqual([{ version: "1.2.3", items: ["First fix", "Second fix"] }]); | ||
| }); | ||
|
|
||
| it("keeps per-version groups and drops empty ones", () => { | ||
| const notes = normalizeDesktopUpdateReleaseNotes( | ||
| [ | ||
| { version: "1.2.3", note: "- Newer change" }, | ||
| { version: "1.2.2", note: "Full changelog: https://example.com/compare/x...y" }, | ||
| { version: "1.2.1", note: "- Older change" }, | ||
| ], | ||
| "1.2.3", | ||
| ); | ||
| expect(notes).toEqual([ | ||
| { version: "1.2.3", items: ["Newer change"] }, | ||
| { version: "1.2.1", items: ["Older change"] }, | ||
| ]); | ||
| }); | ||
|
|
||
| it("decodes valid HTML entities", () => { | ||
| const notes = normalizeDesktopUpdateReleaseNotes("- Fix & polish 😀", "1.0.0"); | ||
| expect(notes).toEqual([{ version: "1.0.0", items: ["Fix & polish 😀"] }]); | ||
| }); | ||
|
|
||
| it("ignores malformed entries instead of throwing", () => { | ||
| const notes = normalizeDesktopUpdateReleaseNotes( | ||
| [ | ||
| { version: "1.2.3", note: "- Valid change" }, | ||
| { version: 42, note: "- Bad version type" }, | ||
| { version: "1.2.1", note: { html: "<p>object note</p>" } }, | ||
| "not an object", | ||
| null, | ||
| ], | ||
| "1.2.3", | ||
| ); | ||
| expect(notes).toEqual([{ version: "1.2.3", items: ["Valid change"] }]); | ||
| }); | ||
|
|
||
| it("returns non-empty groups even when preceded by many boilerplate-only groups", () => { | ||
| const boilerplate = Array.from({ length: 7 }, (_, index) => ({ | ||
| version: `1.3.${9 - index}`, | ||
| note: "Full changelog: https://example.com/compare/x...y", | ||
| })); | ||
| const notes = normalizeDesktopUpdateReleaseNotes( | ||
| [...boilerplate, { version: "1.3.2", note: "- Older but real change" }], | ||
| "1.3.9", | ||
| ); | ||
| expect(notes).toEqual([{ version: "1.3.2", items: ["Older but real change"] }]); | ||
| }); | ||
|
|
||
| it("does not throw on out-of-range numeric entities and keeps the literal", () => { | ||
| expect(() => | ||
| normalizeDesktopUpdateReleaseNotes("- Broken entity �", "1.0.0"), | ||
| ).not.toThrow(); | ||
| const notes = normalizeDesktopUpdateReleaseNotes("- Broken entity �", "1.0.0"); | ||
| expect(notes).toEqual([{ version: "1.0.0", items: ["Broken entity �"] }]); | ||
| }); | ||
| }); |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When nightly updates enable
fullChangelog, GitHub-backedelectron-updatercan return notes for every release newer than the current app, not just the release selected asinfo.version. Because this array is normalized and displayed as-is, a nightly user can be shown stable or future release notes that are not included in the update they are about to install (for example when a newer stable release exists in the shared GitHub Releases feed). Please filter the release-note groups to the selected version/channel before broadcasting them.Useful? React with 👍 / 👎.