Skip to content

feat(gui): improve models workspace layout stability#438

Merged
Wibias merged 16 commits into
lidge-jun:devfrom
Wibias:codex/gui-models-workspace
Jul 25, 2026
Merged

feat(gui): improve models workspace layout stability#438
Wibias merged 16 commits into
lidge-jun:devfrom
Wibias:codex/gui-models-workspace

Conversation

@Wibias

@Wibias Wibias commented Jul 25, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add and wire the Models workspace view mode to the app-level route state so Workspace/Classic switching stays consistent
  • update Models provider group rendering to the new grouped object shape, including empty-provider discovery hints and discovery-failure badges
  • polish control layout stability in Models and Dashboard: keep Sub-agent controls aligned with Shadow Call, preserve inline warning text, tighten context-cap spacing, and reserve dropdown space without forcing oversized controls

Test plan

  • bun run build:gui
  • manual check /#models for Shadow Call + Sub-agent row alignment and reduced gap above Context cap
  • manual check /#dashboard sidecar dropdown behavior (no forced always-wide trigger)
  • bun run test
  • bun run typecheck

Summary by CodeRabbit

  • New Features
    • Added a provider-based workspace view for Models with an “all providers” rail selector.
    • Added bulk controls to collapse/expand all provider groups and apply context caps in one step.
    • Introduced a reusable hover/focus tooltip component.
  • Localization
    • Updated Models/Sub-agent and new workspace strings across all supported languages (including provider/workspace labels and picker guidance).
  • Improvements
    • Improved workspace styling and responsiveness for provider selection layout.
    • Preserved the selected Models view mode across navigation and refined route state handling.
  • Tests
    • Added UI and CSS coverage for workspace provider head/actions and container/mobile rules.

Wibias added 13 commits July 22, 2026 13:24
Adds a workspace layout for the Models tab following the Providers workspace DNA. The left rail lists an All-providers entry plus each provider with its active/total count; the main pane renders the controls, the selected provider's model group (or all groups), and the empty state. The per-group render, controls, combos, empty state, and modals are extracted into shared blocks so classic and workspace views behave identically. Classic view stays available behind a toggle persisted in localStorage (ocx-models-view). New i18n keys for the rail header and All-providers entry in all six locales.
Adds a Workspace/Classic toggle to the sidebar footer that switches the whole app's view preference at once. It writes every tab's ocx-*-view localStorage key and bumps a render key so the current page remounts and re-reads its preference immediately. Per-page toggles keep working, and the sidebar label re-reads the preference on navigation so it stays accurate. Future tabs only need to register their key in WORKSPACE_VIEW_KEYS. Also fills in the 10 missing sub.workspace.* keys in ja.ts that the rebase onto dev surfaced. New i18n key app.viewMode in all six locales; reuses existing pws.workspaceToggle/classicToggle labels.
The v2Applied status message leaked the internal config key multi_agent_v2 (with underscore) to users. Use the localized Sub-agent label instead, across all six locales.
Add a reusable Tooltip primitive (glass material, border, radius, fade-in) matching the design system, and use it for the Shadow Call Intercept info icon on the Models tab instead of the unstyleable browser title attribute.
# Conflicts:
#	gui/src/App.tsx
#	gui/src/pages/Models.tsx
# Conflicts:
#	gui/src/App.tsx
#	gui/src/styles.css
Keep models workspace controls on a stable top row and remove empty gaps so Sub-agent mode, shadow-call controls, and context-cap spacing remain consistent across model label lengths. Also loosen dashboard sidecar select sizing to reserve space without forcing oversized dropdowns.
@github-actions github-actions Bot added the enhancement New feature or request label Jul 25, 2026
@coderabbitai

coderabbitai Bot commented Jul 25, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The Models page now supports an optional workspace view with provider filtering, collapse-all controls, shared rendering blocks, responsive styling, tooltips, synchronized view-mode routing, and updated localization across six languages.

Changes

Models workspace UI

Layer / File(s) Summary
Workspace rendering and interaction
gui/src/App.tsx, gui/src/pages/Models.tsx, gui/src/use-app-route-state.ts, gui/tests/models-provider-head.test.ts
viewMode is passed into Models, which now renders workspace and standard layouts through shared controls, provider filtering, collapse persistence, and reusable provider-group blocks; route hash callbacks are memoized and synchronized.
Workspace styling and tooltip presentation
gui/src/ui.tsx, gui/src/styles.css, gui/src/styles-models-workspace.css, gui/src/styles-dashboard-workspace.css, gui/tests/models-provider-head.test.ts
Adds delayed hover/focus tooltips, workspace rail and main-pane styling, responsive layouts, flexible dashboard selector sizing, and CSS coverage for wrapping and mobile behavior.
Workspace localization strings
gui/src/i18n/{de,en,ja,ko,ru,zh}.ts
Adds provider labels, context-cap and collapse/expand hints, updated ordering text, revised Sub-agent mode status messages, and warning labels while removing duplicate ordering entries.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant App
  participant RouteState
  participant Models
  participant Tooltip
  participant localStorage
  App->>RouteState: resolve view mode from route hash
  RouteState->>Models: pass viewMode
  Models->>Tooltip: render delayed control hints
  Models->>localStorage: persist collapsed provider IDs
  Models-->>App: render workspace or standard layout
Loading

Possibly related PRs

Suggested reviewers: ingwannu, lidge-jun

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and accurately reflects the main change: improving Models workspace layout stability in the GUI.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

Wibias added 3 commits July 25, 2026 06:40
Resolve review findings for Models workspace behavior and accessibility: keep empty routed provider groups correctly classified, reconcile stale selected provider state after polling, localize the shadow-call warning label, and replace nested main landmarks with a labeled section. Also align locale terminology updates, document shared control CSS scope, improve control responsiveness at medium widths, and make tooltip content screen-reader associated with Escape-to-dismiss support.
Move provider-selection reconciliation into models reload so we avoid set-state-in-effect while keeping stale selections safe, and memoize route hash handlers so hook dependencies are explicit and lint-clean.
Use a models-workspace container query so the provider rail stacks before actions clip beside the desktop sidebar, and wrap provider header actions with Models-specific classes.
@Wibias

Wibias commented Jul 25, 2026

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 25, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@gui/src/pages/Models.tsx`:
- Around line 585-586: Replace the clickable provider header div in the Models
component with a dedicated focusable toggle button using
aria-expanded={isCollapsed ? false : true}, and keep the existing
provider-collapse behavior through toggleCollapse(provider). Structure
.models-provider-actions as a sibling rather than nesting its action buttons
inside the toggle button, while preserving the current collapsed/open styling.
🪄 Autofix (Beta)

❌ Autofix failed (check again to retry)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 883c77eb-daa1-4210-8cf1-e497dcd8ad60

📥 Commits

Reviewing files that changed from the base of the PR and between 8458caf and e98e75e.

📒 Files selected for processing (3)
  • gui/src/pages/Models.tsx
  • gui/src/styles-models-workspace.css
  • gui/tests/models-provider-head.test.ts

Comment thread gui/src/pages/Models.tsx
Comment on lines +585 to +586
<div onClick={() => toggleCollapse(provider)}
className={`row group-head models-provider-head${isCollapsed ? "" : " open"}`}>

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Make the provider-collapse control keyboard-operable.

Line 585 places collapse behavior on a non-focusable div, so keyboard users cannot expand or collapse provider groups. Use a dedicated toggle <button aria-expanded={...}> for the header summary, with .models-provider-actions as its sibling; nesting the existing action buttons inside a button would be invalid.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@gui/src/pages/Models.tsx` around lines 585 - 586, Replace the clickable
provider header div in the Models component with a dedicated focusable toggle
button using aria-expanded={isCollapsed ? false : true}, and keep the existing
provider-collapse behavior through toggleCollapse(provider). Structure
.models-provider-actions as a sibling rather than nesting its action buttons
inside the toggle button, while preserving the current collapsed/open styling.

@coderabbitai

coderabbitai Bot commented Jul 25, 2026

Copy link
Copy Markdown

Note

Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it.

An unexpected error occurred while generating fixes: Not Found - https://docs.github.com/rest/git/refs#get-a-reference

@Wibias
Wibias merged commit 6e2a3cc into lidge-jun:dev Jul 25, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant