Files
ThothII/frontend/prototypes/application-context

Full application context review V3

Throwaway prototype, 2026-09-12. No V3 variant selected. Specification and ticket publication have not started; production implementation remains paused.

Question: where should the single workspace selector and independent global AI model selector live when analytical work and all five administrative pages share one application context inside Omics Portal?

Update: the owner selected direction C and requested three refinements in Context shelf review V4, restoring right-rail session tabs and resolving last choices before installation defaults. V3 is preserved.

Run and compare

From frontend/, run npm run prototype:application-context.

Choose a workspace and a model to unlock the application. No model is selected automatically. The bottom review bar switches variants without a reload. Left and right arrow keys also switch variants outside interactive controls. Its expandable review controls expose host widths, availability scenarios, a cross-workspace session link, and the current relevant state. This bar is not production UI.

Variant Global selectors Content strategy Trade-off
A: Context bar Visible horizontal band above core and navigation Workbench, resource list beside detail when space permits Clearest scope; consumes vertical space
B: Context rail Vertical controls above the right navigation Full-width list followed by focused record detail More vertical room for work; a wider right rail
C: Context shelf Compact context summary expands an inline selection panel Operational sections and a collapsible record chooser Compact during work; changing context takes one extra action

The selection controls occur at one location only, never duplicated between core and administration. Read-only context labels and operation provenance are not additional selectors. On narrow containers the right rail moves above content; application navigation becomes an inline disclosure, not an overlay. The portal navigation is an illustrative host, not a deployed Django template.

User-directed changes to the previous review

The user explicitly replaced V2's independent administrative workspace with one global workspace for the entire ThothII interface. The global model selection is independent of workspace and applies to both core and administrative LLM work. Neither core nor administration can be activated without both selections.

V1 and V2 are retained without deleting their source or variants. Their executable files remain in administration-pages/ and administration-review/, with the previous run commands and ports 5174/5175. V3 reuses V2's synthetic inventory and base visual styles, but has its own shell and adapted administrative content. The old independent-workspace rule is historical, not the current design mandate.

The previously started implementation and suspended specification remain untouched. Do not mistake their earlier A selection or ticket breakdown for approval of V3.

Proposed context rules

  1. The current user's application has one selected workspace, shared by analytical work, sessions, Database, Evidence, Memory and Workspace management. Changing it updates the whole interface, clears the active session view and keeps the chosen model. Unsaved drafts require explicit discard confirmation.
  2. “Global” means within this user's ThothII experience, not overwriting every operator's preference or authoring installation defaults. Cross-tab/device synchronization and durable preference storage are decisions for the spec.
  3. The model is the preference for the next LLM operation or session resume. Each operation uses the selected workspace and model. User correction on 2026-09-12: allow only one running core or administrative operation. Disable both global selectors and prevent starting any other operation until the current one completes, fails or is stopped. Navigation does not release this lock. There is no concurrent-workspace workflow or background-job collection.
  4. Resuming a paused session retains its original workspace identity and revision, switches the global workspace to that identity, and uses the current global LLM. A cross-workspace session link shows a review before switching. The prior model is historical provenance, not an override of the current preference.
  5. Selecting context is necessary but not sufficient for core readiness. If preprocessing is required, core remains blocked, while administration is available to prepare the selected workspace.
  6. The global selector can expose installation models with different capabilities. A core-only model blocks metadata AI actions with a direct explanation and a link back to the same selector. There is no silent fallback or separate metadata model preference. Model/provider identities in this prototype are synthetic examples, not verified current installation availability.
  7. Embedding is not the selected interaction LLM. Embedding identity stays tied to the installation catalog and index compatibility. System operations such as schema synchronization may require no LLM at all, although the requested application-wide entry gate still applies.
  8. Pi diagnostics and shared workspace-repository updates retain installation scope. Choosing a workspace does not falsely make them workspace-local. They are still behind the global entry gate, as requested.
  9. There is no implicit bypass when the catalog, credentials or workspace registry is unavailable. The gate explains that the installation operator must repair configuration. No usable models/no workspaces are demonstrable scenarios.

Concrete production constraints found in the audit

  • backend/src/models/runtime-model-catalog.ts filters session and metadata models independently. Eligibility and adapters must be checked for each operation; visual unification alone does not make every model valid for every use.
  • backend/src/routes/sessions.ts currently reads the saved provider/model during resume, validates that saved model and launches with it. Using the current global model requires an explicit API/runtime/provenance change and tests. The prototype shows the proposed behavior; it does not implement that change.
  • The same resume route rejects archived or finalized sessions with 409 before resolving their historical workspace. Retention can prune their old snapshots. Open question asked of the user: does “archived” mean a paused session in history, or should genuinely archived sessions become restorable? Until that answer, the prototype resumes paused sessions only and shows true archives as read-only. Do not silently enable archived/finalized resume in production.
  • Context changes during a live operation are out of scope and intentionally forbidden. Release the lock only after the operation has actually terminated, not when a stop request is sent or a page is closed. Existing server-owned operation state must restore the lock on reconnect; a visual disabled control alone is not the production concurrency guarantee. The prototype is in-memory.
  • Metadata generation currently has installation-wide sequential execution. The proposed interaction rule is simpler and broader: only one core or administrative operation at a time in this user's application, even within the same workspace.
  • Backend authorization remains authoritative. The preview depicts an administrator, not a proposal to give administration access to all users.
  • Final assembly/integration must happen on the server, per the user's explicit request. This change does not touch /Users/mp/Chirone/omics_portal or deploy.

Suggested walkthrough

  1. Open any variant without selections. Confirm core and administration are locked.
  2. Choose only the workspace. They remain locked. Choose GLM 5.3 as well to enter.
  3. Compare A/B/C using the bottom bar, then visit every administrative page using the right navigation. Workspace management has no second workspace picker.
  4. In Database, open Descriptions & sensitivity. Change the global model and observe the read-only selected model. Choose Local Qwen to see the capability block, then choose a common model to continue.
  5. Start description generation. Both global selectors become disabled and an operation banner explains why. Navigate to core or another administrative page: no second operation can start. Use Demo: finish, Demo: stop or Demo: fail to simulate a terminal state; both selectors become available again.
  6. Edit a Memory card, try to change workspace and reject the discard dialog. The workspace and unsaved draft remain unchanged. Save explicitly.
  7. Open Sessions and review a paused session before resuming. Its original model can differ from the current global model. Open an archived session read-only.
  8. Use “Demo: Genetics session link” in review controls while PSD is selected. Confirm the workspace switch on resume and unchanged global model. During the simulated run both selectors are locked. Complete the operation before trying a different workspace or model.
  9. Choose Needs preprocessing: administrative repair remains possible, while new analytical work and resume are blocked. Try unavailable/no-model/no-workspace.
  10. Test 960 px and 390 px host widths inside a wide browser, not only a resized viewport. In B the selectors move above navigation, in C the shelf expands inline. Tables and management tabs can scroll locally.

Verification and limitations

  • Isolated strict TypeScript check passed for the prototype entry.
  • Chromium: 84 combinations of 3 variants, 7 pages and viewport widths 1600/1280/960/390, without root or main-container horizontal overflow or runtime errors. Additional 390 px host inside a 1600 px viewport checked.
  • The initial 17 interaction checks covered the entry gate, independent selections, metadata eligibility, drafts, archive and resume. Their former concurrent-job scenarios were superseded by the user's explicit single-operation rule. After restarting the preview, A/B/C all passed checks for core, administrative and resume selector locks, prevention of a second operation across pages, unlocking after completion/stop/failure, and independent selection once idle. The 84 layout combinations were rerun and passed after this simplification.
  • Desktop A/B/C and mobile renders visually inspected. Display headings retain Fraunces; Manrope controls and warm neutral surfaces continue the V2 direction.
  • Synthetic data and in-memory actions only. Reload resets model, drafts, record edits and the simulated operation; URL retains page/workspace/variant. No real backend/provider calls, persistence, credentials, clinical data, authorization or server jobs.
  • Core is a representative question/session/artifact/review flow, not a complete reimplementation of all eight phases, SSE chat, widgets or runtime behavior.
  • No physical-device, Safari/WebKit, actual Omics/Bootstrap or server integration acceptance is claimed. The development-only Vite configuration refuses builds.

Next: collect V3 layout preference and the archive clarification, then resume the agreed to-spec / to-tickets workflow on Gitea, with ticket breakdown approval before publishing. Do not start implementation agents while this review is open.