Skip to content

Commit b5fc7be

Browse files
t3dotggclaude
andauthored
feat(release): release notes and the update popover open with a short note (pingdotgg#26893)
Co-authored-by: Claude Opus 5.5 <[email protected]>
1 parent c1876b5 commit b5fc7be

13 files changed

Lines changed: 662 additions & 20 deletions

File tree

‎.github/workflows/release.yml‎

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -762,11 +762,16 @@ jobs:
762762
timeout-minutes: 30
763763
permissions:
764764
contents: write
765+
# Release notes read PR bodies and authors.
766+
pull-requests: read
765767
steps:
766768
- name: Checkout
767769
uses: actions/checkout@v6
768770
with:
769771
ref: ${{ needs.preflight.outputs.ref }}
772+
# Release notes need history back to the previous tag, not file contents.
773+
fetch-depth: 0
774+
filter: blob:none
770775
sparse-checkout: |
771776
/*
772777
!/.repos/
@@ -892,6 +897,27 @@ jobs:
892897
echo 'EOF'
893898
} >> "$GITHUB_OUTPUT"
894899
900+
# A short model summary over GitHub's full list. Without a notes file, the
901+
# release falls back to GitHub's generated notes.
902+
- name: Write release notes
903+
if: needs.preflight.outputs.release_channel != 'preview' && needs.preflight.outputs.previous_tag != ''
904+
continue-on-error: true
905+
timeout-minutes: 5
906+
env:
907+
GH_TOKEN: ${{ github.token }}
908+
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
909+
run: |
910+
node scripts/generate-release-notes.ts \
911+
--repository "${{ github.repository }}" \
912+
--tag "${{ needs.preflight.outputs.tag }}" \
913+
--ref "${{ needs.preflight.outputs.ref }}" \
914+
--previous-tag "${{ needs.preflight.outputs.previous_tag }}" \
915+
--version "${{ needs.preflight.outputs.version }}" \
916+
--output release-notes.md
917+
if [[ -f release-notes.md ]]; then
918+
cat release-notes.md >> "$GITHUB_STEP_SUMMARY"
919+
fi
920+
895921
# A preview release gets a warning instead of generated notes. Generated
896922
# notes would list every commit since the previous preview, which is
897923
# unmerged branch history no one should read as a changelog, and would
@@ -917,8 +943,8 @@ jobs:
917943
tag_name: ${{ needs.preflight.outputs.tag }}
918944
target_commitish: ${{ needs.preflight.outputs.ref }}
919945
name: ${{ needs.preflight.outputs.release_name }}
920-
generate_release_notes: ${{ needs.preflight.outputs.release_channel != 'preview' }}
921-
body_path: ${{ needs.preflight.outputs.release_channel == 'preview' && 'release-notes.md' || '' }}
946+
generate_release_notes: ${{ hashFiles('release-notes.md') == '' }}
947+
body_path: ${{ hashFiles('release-notes.md') != '' && 'release-notes.md' || '' }}
922948
previous_tag: ${{ needs.preflight.outputs.previous_tag }}
923949
prerelease: ${{ needs.preflight.outputs.is_prerelease }}
924950
make_latest: ${{ needs.preflight.outputs.make_latest }}

‎apps/desktop/src/updates/DesktopUpdates.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ const UpdateInfo = Schema.Struct({
7070
version: Schema.String,
7171
// Malformed notes must not block update-state decoding; normalizeDesktopUpdateReleaseNotes validates separately.
7272
releaseNotes: Schema.optional(Schema.Unknown),
73+
releaseDate: Schema.optional(Schema.String),
7374
});
7475

7576
const DownloadProgressInfo = Schema.Struct({
@@ -895,6 +896,7 @@ export const make = Effect.gen(function* () {
895896
info.releaseNotes,
896897
info.version,
897898
state.channel,
899+
info.releaseDate,
898900
);
899901
yield* setState(
900902
reduceDesktopUpdateStateOnUpdateAvailable(

‎apps/desktop/src/updates/releaseNotes.test.ts‎

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ describe("normalizeDesktopUpdateReleaseNotes", () => {
2828
releaseNotes: [
2929
{
3030
version: "0.0.36-nightly.20260828.1213",
31+
releasedAt: "2026-08-28",
3132
items: [
3233
"fix(opencode): handle child approvals, stops, and model catalogs by @human in #8480",
3334
"fix(web): keep long task drawers usable on small screens by @human in #8313",
@@ -60,6 +61,37 @@ describe("normalizeDesktopUpdateReleaseNotes", () => {
6061
});
6162
});
6263

64+
it("reads a generated summary as a note and skips the folded full list", () => {
65+
const fixes = Array.from({ length: 9 }, (_, index) => `- Fix ${index + 1} (#${index + 1})`);
66+
const result = normalizeDesktopUpdateReleaseNotes(
67+
[
68+
"**v1.2.4** · 12 changes from 3 contributors",
69+
"## Highlights",
70+
"Link machines (beta).",
71+
"## Fixes",
72+
...fixes,
73+
"<details>",
74+
"<summary>Full changelog</summary>",
75+
"* fix: raw entry by @human in https://github.com/pingdotgg/t3code/pull/1",
76+
"</details>",
77+
].join("\n"),
78+
"1.2.4",
79+
"latest",
80+
"2026-10-29T10:00:00.000Z",
81+
);
82+
83+
expect(result.releaseNotes).toEqual([
84+
{
85+
version: "1.2.4",
86+
releasedAt: "2026-10-29T10:00:00.000Z",
87+
stats: "12 changes from 3 contributors",
88+
intro: "Link machines (beta).",
89+
items: fixes.map((_, index) => `Fix ${index + 1}`),
90+
totalItems: 10,
91+
},
92+
]);
93+
});
94+
6395
it("does not count Markdown or HTML section headings as changes", () => {
6496
const changes = Array.from({ length: 8 }, (_, index) => `Change ${index + 1}`);
6597
const result = normalizeDesktopUpdateReleaseNotes(
@@ -80,6 +112,35 @@ describe("normalizeDesktopUpdateReleaseNotes", () => {
80112
]);
81113
});
82114

115+
it("reads handwritten notes with their own <details> as a list", () => {
116+
const result = normalizeDesktopUpdateReleaseNotes(
117+
"- Older fix\n- Newer fix\n<details><summary>Logs</summary>\n- hidden\n</details>",
118+
"1.2.3",
119+
"latest",
120+
);
121+
122+
expect(result.releaseNotes).toEqual([
123+
{ version: "1.2.3", items: ["hidden", "Logs", "Newer fix", "Older fix"], totalItems: 4 },
124+
]);
125+
});
126+
127+
it("dates the offered release from the feed and older nightlies by their build day", () => {
128+
const result = normalizeDesktopUpdateReleaseNotes(
129+
[
130+
{ version: "0.0.41-nightly.20260914.1707", note: "- Nightly change 2" },
131+
{ version: "0.0.41-nightly.20260913.1700", note: "- Nightly change 1" },
132+
],
133+
"0.0.41-nightly.20260914.1707",
134+
"nightly",
135+
"2026-09-14T18:30:00.000Z",
136+
);
137+
138+
expect(result.releaseNotes.map(({ releasedAt }) => releasedAt)).toEqual([
139+
"2026-09-14T18:30:00.000Z",
140+
"2026-09-13",
141+
]);
142+
});
143+
83144
it("drops releases from other trains before grouping on nightly", () => {
84145
const releaseNotes = [
85146
{ version: "0.0.41-preview.20260914.1683", note: "- Maintainer test build" },

‎apps/desktop/src/updates/releaseNotes.ts‎

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,46 @@ function isIgnoredReleaseNoteLine(line: string): boolean {
9393
interface ExtractedReleaseNoteItems {
9494
readonly items: ReadonlyArray<string>;
9595
readonly totalItems: number;
96+
readonly intro?: string;
97+
readonly stats?: string;
98+
}
99+
100+
/**
101+
* Reads a generated summary (`scripts/generate-release-notes.ts`): a `v1.2.3 · N changes…`
102+
* header, a highlights paragraph, and fix bullets. PR numbers are left to the GitHub page.
103+
*/
104+
function extractReleaseNoteSummary(summary: string): ExtractedReleaseNoteItems {
105+
let stats: string | undefined;
106+
const intro: string[] = [];
107+
const items: string[] = [];
108+
for (const rawLine of stripMarkup(summary).split("\n")) {
109+
const line = rawLine.trim().replace(/\s+/g, " ");
110+
if (line === "" || /^#{1,6}\s+/.test(line)) continue;
111+
if (stats === undefined && /^v\S+ · /.test(line)) {
112+
stats = line.slice(line.indexOf(" · ") + 3);
113+
continue;
114+
}
115+
const text = line
116+
.replace(/^[-*]\s+/, "")
117+
.replace(/\s*\((?:#\d+(?:,\s*)?)+\)\.?$/, "")
118+
.trim();
119+
if (/^[-*]\s+/.test(line)) items.push(text);
120+
else intro.push(text);
121+
}
122+
return {
123+
items,
124+
totalItems: items.length + intro.length,
125+
...(intro.length > 0 ? { intro: intro.join(" ") } : {}),
126+
...(stats ? { stats } : {}),
127+
};
96128
}
97129

98130
function extractReleaseNoteItems(note: string | null | undefined): ExtractedReleaseNoteItems {
99131
if (!note) return { items: [], totalItems: 0 };
100132

133+
// Generated summaries fold GitHub's full list under this exact <details> block.
134+
const summaryEnd = note.search(/<details>\s*<summary>\s*Full changelog\s*<\/summary>/i);
135+
if (summaryEnd >= 0) return extractReleaseNoteSummary(note.slice(0, summaryEnd));
101136
const items: string[] = [];
102137
let totalItems = 0;
103138
for (const rawLine of stripMarkup(note).split("\n")) {
@@ -117,6 +152,15 @@ function extractReleaseNoteItems(note: string | null | undefined): ExtractedRele
117152
return { items: items.toReversed(), totalItems };
118153
}
119154

155+
// The update feed dates only the offered version; prerelease versions carry their UTC build day.
156+
const PRERELEASE_BUILD_DAY = /-(?:nightly|preview)\.(\d{4})(\d{2})(\d{2})\.\d+$/;
157+
158+
function resolveReleasedAt(version: string, offeredVersion: string, releaseDate?: string) {
159+
if (version === offeredVersion && releaseDate) return releaseDate;
160+
const day = PRERELEASE_BUILD_DAY.exec(version);
161+
return day ? `${day[1]}-${day[2]}-${day[3]}` : undefined;
162+
}
163+
120164
interface NormalizedDesktopUpdateReleaseNotes {
121165
readonly releaseNotes: ReadonlyArray<DesktopUpdateReleaseNote>;
122166
readonly omittedReleaseCount: number;
@@ -127,6 +171,7 @@ export function normalizeDesktopUpdateReleaseNotes(
127171
releaseNotes: unknown,
128172
fallbackVersion: string,
129173
channel: DesktopUpdateChannel,
174+
releaseDate?: string,
130175
): NormalizedDesktopUpdateReleaseNotes {
131176
const rawNotes = (
132177
typeof releaseNotes === "string"
@@ -137,13 +182,17 @@ export function normalizeDesktopUpdateReleaseNotes(
137182
).filter((entry) => desktopUpdateChannelOf(entry.version) === channel);
138183

139184
const normalizedNotes = rawNotes.flatMap((entry) => {
140-
const { items, totalItems } = extractReleaseNoteItems(entry.note);
185+
const { items, totalItems, intro, stats } = extractReleaseNoteItems(entry.note);
141186
if (totalItems === 0) return [];
187+
const releasedAt = resolveReleasedAt(entry.version, fallbackVersion, releaseDate);
142188
return [
143189
{
144190
version: entry.version,
145191
items,
146192
totalItems,
193+
...(intro ? { intro } : {}),
194+
...(stats ? { stats } : {}),
195+
...(releasedAt ? { releasedAt } : {}),
147196
},
148197
];
149198
});

‎apps/web/src/components/sidebar/SidebarUpdatePill.browser.test.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ function publish(update: DesktopUpdateState | null) {
8181
});
8282
}
8383

84-
const releaseNotes = () => document.querySelector('[aria-label="Nightly update release notes"]');
84+
const releaseNotes = () => document.querySelector('[aria-label="Update release notes"]');
8585

8686
describe("SidebarUpdatePill release notes", () => {
8787
it("closes when the release notes stop applying", async () => {

‎apps/web/src/components/sidebar/SidebarUpdatePill.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ function shouldUseSidebarUpdateReleaseNotesPopover(
5353
showUpdateDetails: boolean,
5454
state: DesktopUpdateState | null,
5555
): boolean {
56-
return showUpdateDetails && state?.channel === "nightly" && state.releaseNotes.length > 0;
56+
return showUpdateDetails && (state?.releaseNotes.length ?? 0) > 0;
5757
}
5858

5959
function handleSidebarUpdateReleaseNotesPopoverOpenChange(
@@ -542,7 +542,7 @@ function SidebarUpdateControl() {
542542
{showReleaseNotesPopover && state ? (
543543
<PopoverPopup
544544
align="center"
545-
aria-label="Nightly update release notes"
545+
aria-label="Update release notes"
546546
initialFocus={false}
547547
onKeyDownCapture={(event) => {
548548
if (

0 commit comments

Comments
 (0)