You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(desktop): show the changelog in the update dialog (#226)
## Related Issue
No linked issue — reported from the app: the v0.3.8 release-notes
popover read "Pythinker Desktop 0.3.8 (stable channel), built from
PyModel/pythinker-code@`<tt>`0f49851`</tt>`.", with the tags printed
literally.
## Problem
Two separate causes produced that one popover.
1. **The body was a build stamp.** `desktop-release.yml` created the
draft with a fixed `--notes "Pythinker Desktop <v> (<channel> channel),
built from <commit>."`. Nothing else ever wrote the body, so the updater
had nothing to say about a version.
2. **The notes arrive as HTML.** electron-updater's GitHub provider
reads the releases Atom feed, whose `<content type="html">` is the body
GitHub has already rendered. The renderer treats `releaseNotes` as
Markdown, so the tags GitHub emits — `<p>`, `<a>`, `<tt>` — printed as
text.
Fixing only the body would have left the markup visible, since a real
changelog renders to `<ul>`/`<li>`/`<a>` too.
## What changed
- **`apps/desktop/scripts/desktop-release.mjs`** — new exported
`desktopReleaseNotes()` and a `notes` subcommand. It takes the `##
<version>` section of `apps/desktop/CHANGELOG.md`, strips the changesets
prefix (`[#225](…) [`sha`](…) Thanks [@user](…)! - `), and returns the
bullets plus a `Built from <commit>` footer.
- **`.github/workflows/desktop-release.yml`** — the prepare job writes
those notes to a file and passes `--notes-file`. A **stable** release
whose version has no changelog entry now fails here instead of
publishing; preview channels fall back to a one-line description, since
a nightly version never appears in the changelog. The source-commit URL
stays in the body because the draft-resume check on line 120 gates on
`.body | contains($source_url)`.
- **`apps/desktop/src/updater.ts`** — `releaseNotesText` reduces HTML
notes to text (list items to `- `, block ends to newlines, entities
decoded), and leaves notes without markup untouched.
- **`AGENTS.md`** — records that changeset text is shipped text: it
becomes the release body users read, and a body must never be a build
stamp.
## Checklist
- [x] I have read the
[CONTRIBUTING](https://github.com/PyModel/pythinker-code/blob/main/CONTRIBUTING.md)
document.
- [ ] I have linked a related issue (external PRs: the issue must have a
maintainer's `/approve`).
- [x] I have added tests that prove my feature works.
- [x] Ran `gen-changesets` skill, or this PR needs no changeset.
- [x] Ran `gen-docs` skill, or this PR needs no doc update.
### Tests
`scripts/release/desktop-release.test.mjs` covers extraction, the
next-heading boundary, the stable-release gate, the preview fallback,
and the required source URL. `updater.spec.ts` asserts the exact HTML
from the live v0.3.8 feed comes out as text, and that plain notes are
unchanged. `desktop-release-workflow.spec.ts` pins `--notes-file` and
forbids the old literal. Reverting both product changes fails exactly 2
tests; 175 + 25 pass as shipped.
### What users will see
Instead of the build stamp, the v0.3.9 popover will read: `- Show the
changelog for the new version in the update dialog instead of a build
stamp with raw HTML tags.`
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **New Features**
* Update dialogs now display readable changelog content for new
versions.
* Release notes preserve lists and links as clean, formatted text
without raw HTML or script content.
* Desktop releases now publish version-specific changelog entries
instead of build information.
* **Bug Fixes**
* Improved handling of plain-text and HTML-formatted release notes.
* Prevented empty or malformed release notes from appearing in update
prompts.
* **Reliability**
* Stable releases without valid changelog entries are blocked from
publication.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
- Fill in `.github/pull_request_template.md` — link the issue, describe changes. No placeholder text or vague AI-generated PR summaries; the human author must understand the change well enough to explain the code, edge cases, and why the approach fits.
120
120
- Run `gen-changesets` skill before submitting PRs. Changesets must strictly follow its rules: one short user-facing sentence stating only what changed; skip any change users cannot perceive. Never decide `major` on your own — stop, explain, and get explicit user confirmation first; default to `minor`, fall back to `patch`.
121
+
- Changeset text is shipped text: the desktop release body is generated from `apps/desktop/CHANGELOG.md`, and the in-app updater shows it to users verbatim. A release body must state what changed for users — never a build stamp, a commit hash, or placeholder text. `desktop-release.yml` fails a stable release whose version has no changelog entry.
121
122
- Prefer `import ... from '#/...'` (equivalent to `@/...`).
122
123
- Do not commit throwaway scratch or exploratory files. Never stage agent working notes or handoff documents (e.g. `HANDOVER-*.md`, `HANDOFF-*.md`, `handoff.md`), or throwaway UI/UX prototypes or design mockups (e.g. `*-designs.html`, `*-mockup.html`, `*-demo(s).html`). The only tracked `.html` files should be Vite `index.html` entrypoints. Put scratch work under `.tmp/` (gitignored).
0 commit comments