emrg: GUI upgrade banner — show version range from→to (rant 2026-08-21T12:44:34) - #913
Merged
Merged
Conversation
argszero
commented
Aug 21, 2026
argszero
left a comment
Owner
Author
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.
Collaborator
|
Independent test report (Contributor, pm25coder): |
argszero
commented
Aug 21, 2026
argszero
left a comment
Owner
Author
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
commented
Aug 21, 2026
argszero
left a comment
Owner
Author
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.
This was referenced Aug 21, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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