Repository navigation
feat(app): show the app version in the window, the tray menu and About - #44
Merged
Merged
Conversation
…t, read from the build The version was only in a startup log line. The main window now has it in its header and in an About section, and the tray menu leads with a disabled "Lumen <version>" line. All three read the app's PackageInfo (tauri.conf.json at build time) through getVersion() or package_info(), so no version string of Lumen's own lives in the frontend or in Rust. A Rust test fails when that version differs from tauri.conf.json or any Cargo.toml, the sidecar crates included; the app e2e (Linux, Windows) and the Issue 5 launch check (macOS) read the expected version from those files and assert the window's text. Tray menu entries are built from a plain-data spec, since a menu cannot be created off the main thread in a test, and tauri::generate_context!() is expanded in one place (app_context) so the test and run() share it.
Resolves the CHANGELOG [Unreleased] conflict with #45 by keeping both entries.
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.
What
The app version was only in a startup log line. It now shows in three places, all read from the build at runtime (no version string of Lumen's own in the frontend or in Rust):
Lumen <version>under the taglinegetVersion()(plugin:app|version)Version-><version>Lumen <version>, disabledapp.package_info()Both resolve to Tauri's
PackageInfo, which Tauri fills fromtauri.conf.jsonwhen the app is compiled.Lumen has no settings window. The Setup screen is first-run only and runs
lumen_run_setupas soon as it opens, which an e2e must not trigger (on Windows it runs in the runner's real profile). So About is a labelled section of the main window (aria-labelledby-> "About" heading,dl: term "Version", value). Sidecar versions are not shown (not cheap); the consistency test below covers them instead.Tray item cannot be clicked
It is built with
enabled = false, which is greyed and not activatable on macOS, Windows and Linux. It also has its own id (version), which the menu-event handler inlib.rsdoes not act on, so a click that did arrive would still do nothing. The menu is built from a plain-data spec (tray_menu_entries) because muda creates items on the main thread only, so the real menu cannot be built in a test. The spec is what the tests check;build_tray_menu_itemsturns it into items one-to-one. The real macOS/Windows/Linux menu is not rendered by any test.Tests
health.rs):the_version_the_ui_shows_is_the_one_tauri_conf_and_every_cargo_toml_declaretakes thePackageInfothe build embedded and asserts it equalstauri.conf.json, the Tauri crate'sCargo.tomland everycrates/*/Cargo.toml(the sidecars). Red proofs run locally:tauri.conf.jsonbumped alone -> fails listing the six Cargo.tomls;crates/lumen-mcp/Cargo.tomlbumped alone -> fails naming it; both restored -> green. Two more tests: the tray line is first, disabled, and built from the version it is given (red withenabled: true; red with a hard-coded label); Open/Quit stay enabled.home.spec.ts): rendersHomewith a seeded version no release has (9.8.7,0.0.1-rc.2) and asserts header text, About text, the aria structure, absence before it loads, andunavailableon failure. Red with a literal in the template.ng testthresholds all met.app.e2e.mjs): new test reads the expected version fromtauri.conf.jsonandCargo.tomlat run time (asserting they agree), then waits withs.untilfor.home__versionand.about__versionand assertsLumen <v>/<v>plus the About structure. No sleeps, no retries. Harness startup/wait code is untouched.issue5-launch-check.shreads the expected version fromtauri.conf.json(plutil) andCargo.toml, and asserts the exact linesLumen <v>and<v>in the accessibility text (a previous run's artifact shows the full page, below the fold, one line per text node). Under the OCR fallback a miss is a LIMITATION, not a failure.Who asserts what
The added e2e test is one more app launch, so it has one more exposure to the known Windows startup flake (owned by T5).
Local gate
/tmp/lumen-verify.sh-> GATE GREEN (fmt, clippy, tests, frontend build + coverage, sidecars,cargo test -p Lumen, msrv, verify-install, debug app build).Also
tauri::generate_context!()may be expanded once per binary and the unit-test binary containsrun(), so it now lives in oneapp_context()thatrun()and the test share. CHANGELOG entry added.