emrg: GUI upgrade banner — show version range from→to (rant 2026-08-21T12:44:34) - #913
Conversation
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle
Fresh review of the upgrade-banner range change (rant 2026-08-21T12:44:34):
- daemon:
_previous_installed_version()reads~/.emrg/install/previous-version.txt(raw data, "" when missing — dev/first-install safe); pong carries bothcurrent_versionandprevious_version. - upgrade_prompt.j2: agent instructed to copy current version to
previous-version.txtbefore overwritingversion.txt(and clear stale record on first install) — closes the persistence loop so even a fresh GUI launch shows the range. - GUI:
maybeShowUpgradeBanner(current, previous)shows from→to when previous differs, falls back to the old single-version message otherwise;state.previousVersionthreaded from init + pong. i18n added for both zh/en. - Tests: banner test asserts "0.2.57 → 0.2.61" text; new daemon pong test covers positive + missing-file + payload. Agent.md Python 988→989.
- Verified: Python pytest 988 passed + 1 skipped, GUI npm test 255 (247+8), import + CLI OK. CI test + test-windows PASS.
1/3.
pm25coder
commented
Aug 21, 2026
Independent test report (Contributor, pm25coder): |
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle
2nd review (head cc6e14c, CI test + test-windows PASS on run 32449902478):
- Fresh local verification: Python pytest 988 passed + 1 skipped (989 collected, matches Agent.md), GUI npm test 255 (247 pass / 0 fail / 8 skipped), import + CLI OK.
- daemon:
_previous_installed_version()reads~/.emrg/install/previous-version.txtwith OSError/ValueError fallback to "" (dev/first-install safe); pong now carriesprevious_versionalongsidecurrent_version. - upgrade_prompt.j2: agent copies the pre-overwrite version into
previous-version.txtbefore writingversion.txt, and clears stale record on first install — closes the persistence loop so the banner range survives a fresh GUI launch. - GUI:
maybeShowUpgradeBanner(current, previous)renders from→to when previous differs, falls back to the single-version message otherwise;state.previousVersionthreaded from init + status events. i18n zh/en keys added. - Tests: banner smoke asserts both "0.2.57" and "0.2.61" in the message; new daemon pong test covers previous-version payload. Both positive/negative paths exercised.
2/3. Note: master advanced since this PR's base (#912 merged) — the final merge will need the resolved tree re-verified, but no code conflicts expected (Agent.md Python line vs #912's GUI line merge cleanly).
…grade-banner-from-to # Conflicts: # Agent.md
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle
3rd consecutive review (head ec88809 — conflict-resolved merge of master, CI test + test-windows PASS on the resolved tree):
- Fresh local verification on the merged tree: pytest 988 passed + 1 skipped (989 collected, matches Agent.md), import + CLI OK.
- Conflict resolution: #912's heartbeat merge touched main.js + Agent.md; merged tree has both #912 heartbeat and #913 banner changes; Agent.md now Python 989 / GUI 256 (127 renderer smoke); no conflict markers left.
- Code (from earlier review, unchanged in substance): daemon _previous_installed_version() reads ~/.emrg/install/previous-version.txt (raw data, '' when missing — dev/first-install safe); upgrade_prompt.j2 copies version.txt → previous-version.txt before overwrite; pong carries current + previous version; GUI banner shows from→to when previous version differs, falls back to single-version message; i18n key zh+en.
3/3.
Summary
Fixes rant
2026-08-21T12:44:34(banner item) — the GUI upgrade-complete banner now shows the version range instead of only the target version: "EMRG 已从 0.2.57 升级到 0.2.61,重启后生效".Changes
emrg/server/daemon.py— new_previous_installed_version()reading~/.emrg/install/previous-version.txt; pong payload now carries bothcurrent_versionandprevious_version(raw data only, zero judgment).emrg/server/prompts/upgrade_prompt.j2— instructs the upgrade agent to copy the currentversion.txtcontent toprevious-version.txtbefore overwriting it (and to remove a staleprevious-version.txton first install).emrg/gui/main.js— init + status pushes forwardprevious_versionfrom the pong.emrg/gui/renderer/js/app.js—maybeShowUpgradeBanner(currentVersion, previousVersion)shows the from→to message when a previous version is available (and differs), falling back to the old single-version message otherwise.state.previousVersioninitialized from init and updated on pong.emrg/gui/renderer/js/i18n.js— newapp.upgradeBannerMsgFromTokey (zh + en).emrg/gui/test/renderer.smoke.test.js— banner test extended to assert the from→to text.tests/test_daemon.py— newtest_pong_includes_previous_version(positive + missing-file + pong payload).Agent.md— Python count 988→989.Verification
uv run pytest tests/— 988 passed + 1 skipped (989 collected), incl. the new pong testnpm test— 255 tests, 247 pass, 8 skipped, 0 failnode --check+ import + CLI OK