Skip to content

Add model version switcher under Options menu#629

Merged
zaucker merged 5 commits into
oposs:mainfrom
zaucker:model-version-switch
May 19, 2026
Merged

Add model version switcher under Options menu#629
zaucker merged 5 commits into
oposs:mainfrom
zaucker:model-version-switch

Conversation

@zaucker
Copy link
Copy Markdown
Contributor

@zaucker zaucker commented May 18, 2026

Summary

Adds a model version switcher driven by a new optional Versions: block in the deployment YAML. Companion to the cross-version enum-alias support already on main (merged via #628) — together they let users navigate between sibling deployments of different model versions without losing access to their existing datasets.

Configuration

  • New Versions: block in deployment YAML — list of { label, url, version, title } entries pointing at sibling instances. Leave the block out (or empty) to hide the switcher entirely.
  • Agrammon::Config.versions accessor + get_cfg exposes the list to the SPA.

Frontend

  • New "Set model version ..." submenu under Options, sibling to "Set language ...". The entry matching the active version is disabled so you can't switch to yourself. Strictly-older picks trigger a Confirm dialog.
  • Active-version title: from the matching Versions entry overrides GUI.title in the page header so users always see which version they're in.
  • Dataset table now lists datasets across sibling model versions and fades rows whose dataset_version doesn't match the active Model.version (new agrammon.ui.table.rowrenderer.DatasetVersion). The version column is made visible so the mismatch is legible.

Backend

  • DB::Datasets.load no longer filters by dataset_version, so foreign-version datasets show up (and the frontend fades them).

Session sharing

  • Already on main (resume_session route + SPA call): same Postgres-backed session cookie is honored across sibling instances, so switching versions does NOT prompt for re-login.

Test plan

  • prove6 -l t/config.rakutest — new positive test for Versions: parsing (2 new subtests, fixture YAML)
  • prove6 -l t/webservice.rakutestget_cfg includes versions => [] when no block configured
  • make test — full suite against test DB
  • Manual: configure two sibling instances on different ports, log in on one, pick the other in Options → Set model version ... — header title updates, no re-login, dataset table shows datasets from both versions with the non-matching one faded
  • Manual: pick a strictly-older version — Confirm dialog appears before navigation

🤖 Generated with Claude Code

zaucker and others added 5 commits May 19, 2026 08:47
Replaces the standalone SelectBox in the menubar with a "Set model
version ..." submenu under Options, sibling to "Set language ...".
Submenu is hidden when no Versions block is configured; the entry
matching the active version is disabled so it can't be re-selected.
Strictly-older picks still trigger the existing Confirm dialog before
navigation. MainMenu keeps setVersions() as the public entry point —
it delegates the menu population to OptionMenu and applies the
matching per-locale title to the page header.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Read a Versions: block from the deployment YAML (label, url, version,
title per locale), expose it from get_cfg, and on the SPA side hand
it to MainMenu.setVersions() and Info.setVersions() so the new
"Set model version ..." submenu and the dataset table can react to
the sibling-version metadata. The active-version title from the
Versions entry overrides GUI.title in the page header.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Drop the dataset_version filter in DB::Datasets.load so the dataset
table shows datasets from sibling model versions, then expose
activeVersion on the DatasetTable and install a custom row renderer
that lowers the opacity of rows whose dataset_version doesn't match
the active Model.version. The version column is made visible so the
mismatch is legible. Makes the version switcher actually useful:
users can see their existing datasets from a different version and
switch over to the matching deployment.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
`qx compile --update-po-files` after relocating the version switcher
into OptionMenu: the "Set model version ..." label is new, the two
older-version Confirm strings now reference OptionMenu.js, and the
SelectBox-tooltip "Switch model version" is marked as no longer used.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Add a fixture YAML with two Versions: entries and assert that
Agrammon::Config.versions exposes them as the expected list of
hashes with label/url/version/title fields. Also asserts the
existing no-Versions config produces an empty versions list.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@zaucker zaucker force-pushed the model-version-switch branch from caf3447 to 8623b2b Compare May 19, 2026 06:48
@zaucker zaucker changed the title Model version switcher with cross-version enum-alias migration Add model version switcher under Options menu May 19, 2026
@zaucker
Copy link
Copy Markdown
Contributor Author

zaucker commented May 19, 2026

Merged after visual local test

@zaucker zaucker merged commit 5bc6aa6 into oposs:main May 19, 2026
2 checks passed
@zaucker zaucker deleted the model-version-switch branch May 19, 2026 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant