Skip to content

feat(web): show Runtime settings and Create local agent as setting rows - #782

Merged
heweijie0306 merged 7 commits into
mainfrom
ethan/runtime-settings-rows
Nov 26, 2026
Merged

heweijie0306 merged 7 commits into
mainfrom
ethan/runtime-settings-rows

Conversation

@heweijie0306

@heweijie0306 heweijie0306 commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Runtime settings and Create local agent were four identical dropdowns each, so they read like forms and hid every choice behind a click. Both now list the settings as rows that open in place, built from one shared module (members/runtime-setting-rows.tsx). An open row's choices line up under the value column, one line each with the status at the end and a tick on the chosen one:

  • Computer: each computer with its connection (online, offline, or upgrade required). Offline computers stay selectable; upgrade-required ones stay disabled, as before.
  • Runtime: each Runtime with its own logo and readiness (Ready, Sign-in required, Model needed, Not installed, and so on).
  • Model: the Runtime's models as a list. A saved model that is no longer offered shows as a disabled "· Unavailable" entry, as before.
  • Reasoning: a segmented control of the model's allowed efforts, including model-advertised ones.

One row is open at a time. Choosing a computer, Runtime or model closes its row; Reasoning stays open so efforts can be compared. Options are native radios in labelled radio groups, named by their label, with the status as the description.

  • Runtime settings opens on the row it was started from. Locking is unchanged: opened from Model or Reasoning, the placement rows are locked, and Reasoning also locks the model. It stays at the md width of the other Agent edit dialogs; long model labels truncate instead of widening it.
  • Create local agent keeps its defaults and state resets. "Connect a new computer" now sits under the open Computer row. Pi's local models load whenever Pi waits on them, so Pi's status reads right while another Runtime is chosen.

The Runtime logos (Claude Code, Codex, Pi, Antigravity) are bundled SVGs under features/local-computer/runtime-logos/.

Every dialog: initial focus without a ring. ModalDialog lets showModal focus the close button and then moves focus to the first control in the body. Because focus moved on from a focused control, Chromium marked the new one as keyboard focus, so the first field, select or row of every dialog showed its focus ring or fill on open. Initial focus now lands with focus({ focusVisible: false }), and the close button lets go first when nothing else can take focus. The indicator appears once the person uses the keyboard. Browsers without focusVisible ignore the option and behave as before.

Not in this change

The model label still comes from the daemon as one string (for Claude, the catalog's display name joined with the resolved model). A follow-up can send the resolved model as its own field so the dialog shows them separately.

Tests

  • edit-agent-runtime-dialog.test.tsx, quick-create-general-agent-page.test.tsx, and the dialog step of direct-agent-model-switch.test.tsx now drive the rows and radios. Saved payloads, Save/Create state, hints, alerts and setup guidance assert the same as before. The dropdown-dismissal test became a test that one row opens at a time.
  • Added: Pi's status reads "Model needed" while Codex is the chosen Runtime (fails without the fix).
  • make check-web passes: typecheck, lint, all tests, and React Doctor (rerun after the shared ModalDialog change).

🤖 Generated with Claude Code

@linger-review linger-review 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.

Approve with nits (2 P2, 1 P3)

Scope: base main at merge base 29ad855e; 1 commit, 10 files reviewed (dialog, tests, messages, zh-CN catalog, runtime-logo.tsx and 4 SVGs). Helper skills loaded: coderbook, ponytail-review, karpathy-guidelines. Ran in a separate session.

Findings

P2

1. Arrow keys commit a choice and collapse the row (apps/web/src/features/rooms/members/edit-agent-runtime-dialog.tsx:864, with the closing calls at :245, :287, :321)
The options are native radios that share a name. In a native radio group, ArrowUp/ArrowDown moves the checked state and fires change, so React's onChange runs on every arrow press. Each Computer, Runtime and Model onChange calls selection.select* and then setOpenRow(undefined).

  • Example: a keyboard user opens the Runtime row, tabs to the checked "Claude Code" radio and presses ArrowDown to look at the next option. That immediately selects "Codex", which also resets the model, and closes the row. The focused radio is unmounted, so focus falls out of the list. To reach the third option they have to reopen the row and press the arrow key again, changing the selection each time.
  • The old Select let them browse options before committing. Mouse users and the fireEvent.click tests don't hit this.
  • Fix: close the row only on a pointer click or Enter/Space, not on every change. Or keep the row open after a change, as Reasoning already does, and return focus to the row button when it closes. Add a test that sends ArrowDown to the radio group.

2. StatusDot duplicates the existing shared component (apps/web/src/features/rooms/members/edit-agent-runtime-dialog.tsx:680-696)
apps/web/src/features/local-computer/computer-row.tsx:11 already exports StatusDot({ tone: "neutral" | "success" | "warning" }), and the Computers pages already use it. The new copy:

  • adds its own StatusTone type (ok/off/warn);
  • adds a statusDotClass map;
  • uses arbitrary bg-[var(--app-status-success-text)] / bg-[var(--app-status-warning-text)] classes instead of the bg-app-success / bg-app-warning token classes that apps/web/AGENTS.md asks for;
  • uses a 7px size where the existing dot is size-1.5.

Fix: import StatusDot from @/features/local-computer/computer-row, map ok→success, warn→warning, off→neutral, and delete the local type, map and component.

P3

3. Conditional class names are built with template strings (apps/web/src/features/rooms/members/edit-agent-runtime-dialog.tsx:767, :773, :785)
SettingRow builds classes like `... ${expanded ? "bg-accent" : ""}`. apps/web/AGENTS.md says to compose conditional class names with cn from src/lib/cn.ts.

Verified as fine

  • Locking is the same as before. Computer and Runtime rows use disabled={placementLocked}, where placementLocked = field === "model" || field === "reasoning" (edit-agent-runtime-dialog.tsx:127). The Model row uses disabled={field === "reasoning"}. The Reasoning row is disabled when no efforts are allowed, which matches the old disabled Select showing the saved unavailable effort.
  • Initial open row: both callers mount the dialog only while it is open (actor-profile.tsx:561, direct-agent-model-switch.tsx:107). So useState(field) gets a fresh field on every open. SettingRow treats open && !disabled as expanded, so a locked row that the dialog was opened from never shows its panel.
  • The unavailable saved model is still a disabled, checked option. Upgrade-required computers are still disabled, and offline computers are still selectable (edit-agent-runtime-dialog.tsx:250).
  • ReasoningRow's savedUnavailableEffort! is guarded by the early return when neither allowed nor savedUnavailableEffort is present.
  • Removed message keys (computerOnline*, runtimeNotReady) have no other users in apps/web/src. zh-CN.json is the only catalog and is updated to match. No CJK outside the locale catalog, and the commit message is English.
  • Logos: these are static same-origin SVGs loaded via <img alt="">, so no script can run. pi.svg's currentColor renders black inside <img>, and that is fine because the app is light-only (src/app/visual-theme.css:4 sets color-scheme: light).
  • No new dependencies. @hugeicons/core-free-icons is already used and is the mandated icon set.

Process notes

  • Single commit. The branch is up to date with main (0 commits behind). The merge state shows BLOCKED only on required review.

CI

All checks that ran pass: web tests (1/2, 2/2), web-static, check (web), repository-gate, CodeQL. The non-web checks were skipped by the path plan. I ran no tests locally. The keyboard finding comes from how native radio groups handle arrow keys, and the existing tests don't exercise it.

Automated review by Claude Code


Automated review of 66ffdfc by Claude Code.

@linger-review linger-review 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.

Approve with nits (0 new findings; 3 previous findings still open: 2 P2, 1 P3)

Scope: follow-up on 66ffdfc, reviewing head d627ee4 against main (merge base 29ad855e). 4 commits and 10 files reviewed; the new changes since the previous review touch only edit-agent-runtime-dialog.tsx. Skills: the linger-pr-review recipe was followed; coderbook, ponytail-review and karpathy-guidelines were not loaded separately. Run in a separate session.

Previous findings

  • P2: arrow keys select a radio and collapse the row (edit-agent-runtime-dialog.tsx). Not resolved. The Computer, Runtime and Model onChange handlers still call setOpenRow(undefined) (lines 239–242, 280–283, 313–316). A native radio fires change on ArrowDown/ArrowUp, so a keyboard user who moves through the list commits the neighbouring option, the row collapses, and the focused radio unmounts.
  • P2: StatusDot duplicates the existing component. Not resolved. edit-agent-runtime-dialog.tsx:682 still defines its own StatusDot with raw bg-[var(--app-status-…)] classes, while apps/web/src/features/local-computer/computer-row.tsx:11 already exports one.
  • P3: conditional className not built with cn. Not resolved. SettingRow still uses template strings at edit-agent-runtime-dialog.tsx:768 and :779, and StatusDot does the same at :686.

Findings

No new findings.

Verified as fine

  • The setting-row icons were removed cleanly. The icon prop and the IconSvgElement import are gone, and the CommandLineIcon, Idea01Icon and SparklesIcon imports went with them. LaptopIcon is still used for the computer options (edit-agent-runtime-dialog.tsx:248).
  • With the icon column gone, the pl-[52px] indent was also dropped from the expanded panel (:785) and from the "manage models" hint (:348). Panel and hint content still line up with the row.
  • min-w-0 on the <fieldset> (:210) stops the fieldset from growing to its content's min-content width. Long model names now truncate inside the rows instead of widening the dialog. The dialog size ended up back at its original value (the net diff since 66ffdfc has no size change).
  • No CJK in added lines outside the locale catalogs. The · separators are U+00B7, and repository-gate passed.

Process notes

  • The branch is 12 commits behind main. main requires up-to-date branches, so it needs a rebase.
  • b88bdc38 (narrow width) and 49bc3bcd (back to the original width) cancel out apart from min-w-0. d627ee4f removes icons that 66ffdfc added in this same PR. Since main takes rebase merges, these three fix-ups should be squashed into 66ffdfc (git rebase -i --autosquash).

CI

All relevant checks pass: check (web), web tests (1/2), web tests (2/2), web-static, repository-gate and CodeQL. Checks for other apps were skipped as not applicable. I ran no tests locally.

Automated review by Claude Code


Automated review of d627ee4 by Claude Code.

@linger-review linger-review 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.

Approve with nits (1 P2, 1 P3)

Scope: follow-up on d627ee4, reviewing head 45a5c88 against main (merge base 29ad855e). Reviewed 5 commits and 13 files, with a focus on the new commit 45a5c88, which touches 4 files. Loaded coderbook. I did not load ponytail-review or karpathy-guidelines and applied their checklists from memory. This ran in a separate session.

Previous findings

The previous review (d627ee4) reported no findings, so there is nothing to track.

Findings

P2

  • apps/web/src/features/rooms/quick-create-local-agent-dialog.tsx:202: In Create local agent, the Runtime option list now shows each Runtime's status. For Pi with authentication_required, it uses piAuthRequiredStatusMessage(piModelsState) (line ~471). But localModels only loads when the selected Runtime is Pi and needs authentication (selectedRuntime?.type === "pi" && selectedRuntime.status === "authentication_required").
    • Failure scenario: a computer has Claude Code ready (selected by default) and Pi needs authentication because it has no local model. localModels.data is undefined, so classifyPiLocalModelsState returns unknown, and the Pi option reads "Sign-in required" instead of "Model needed", "Downloading model" or "Loading model". The user is pointed at the wrong fix. Before this commit the dropdown showed no status, so this is new.
    • Runtime settings already handles this case: edit-agent-runtime-dialog.tsx:105-121 turns the query on when any Pi on the computer is authentication_required (piAuthRequiredOnComputer).
    • Fix: use the same condition here. Only the !setupOpen guard needs to stay specific to this dialog.

P3

  • PR description: commit 45a5c88 also rebuilds Create local agent from the shared setting rows, moves "Connect a new computer" into the open Computer row, and rewrites quick-create-general-agent-page.test.tsx. The PR body and its Tests section still describe only the Runtime settings dialog. Please add the Create local agent change so reviewers and history reflect the user-visible change.

Verified as fine

  • The new shared module runtime-setting-rows.tsx is a move, not a fork. StatusDot, ComputerStatus, Placeholder, SettingRow, OptionList/OptionRow and EffortSegments were deleted from edit-agent-runtime-dialog.tsx (diff d627ee4..45a5c88, the removed block after RuntimeSetupGuidance). That dialog now imports them (edit-agent-runtime-dialog.tsx:48-56), and ModelHeading replaces the inline heading markup, so there is no second copy.
  • Create local agent keeps its state resets. Choosing a computer still goes through selectComputer. Choosing a Runtime clears the model and effort, and choosing a model clears the effort (quick-create-local-agent-dialog.tsx OptionList onChange handlers). Each choice also closes its row.
  • Computers that need an upgrade are still excluded from Create local agent's choices (quick-create-local-agent-dialog.tsx:131-136). The offline hint and the Pi "manage models" hint still render under their rows.
  • Disabled rows (no Runtimes, no models, no efforts) do not expand: SettingRow gates expanded on !disabled (runtime-setting-rows.tsx:120).
  • No Chinese in added code, comments or commit messages. The only matches are in apps/web/src/i18n/locales/zh-CN.json, which is allowed.

Process notes

  • b88bdc38 ("keep Runtime settings at the narrow dialog width") and 49bc3bcd ("keep ... as wide as the other Agent edit dialogs") undo each other. d627ee4f also only patches 66ffdfcb. main takes rebase merges, so consider squashing these into 66ffdfcb (git rebase -i --autosquash).
  • The branch has no merge commits. mergeStateStatus is BLOCKED, which most likely means it is waiting on review approval.

CI

All checks that ran passed: check (web), web tests (1/2), web tests (2/2), web-static, repository-gate, CodeQL. The other app checks were skipped because their paths are unchanged. I ran no tests myself; the finding comes from reading the code.

Automated review by Claude Code


Automated review of 45a5c88 by Claude Code.

Both dialogs lead with the model and list Computer, Runtime, Model and
Reasoning as rows that open in place onto their choices: computers with
their connection, Runtimes with their own logos and readiness, the models,
and Reasoning as a segmented control. The rows live in one shared module.
Runtime settings opens on the row it was started from; Create local agent
keeps Connect a new computer under the open Computer row. Pi's local models
load whenever Pi waits on them, so its status reads right while another
Runtime is chosen.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@heweijie0306
heweijie0306 force-pushed the ethan/runtime-settings-rows branch from 45a5c88 to 66f27f7 Compare November 26, 2026 15:04
@heweijie0306 heweijie0306 changed the title feat(web): show Runtime settings as rows that open in place feat(web): show Runtime settings and Create local agent as setting rows Nov 26, 2026
heweijie0306 and others added 5 commits November 26, 2026 10:22
The model heading repeated the Model row, so it goes. An open row and its
choices share one tinted block, the chosen one on white, and each choice
is one line with its status at the end.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
showModal focuses the close button, and moving focus on from it marked the
first control as keyboard focus, so rows and fields showed a focus ring or
fill on every open. Initial focus now lands without the indicator, which
appears once the person uses the keyboard.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Choices and the Reasoning control start where a row's value does, so a
logo sits under the logo above and the ticks line up with the chevrons.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@linger-review linger-review 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.

Approve with nits (1 P2, 1 P3)

Scope: base main, merge base 1c35212b, 6 commits, 14 files reviewed. Follow-up on 45a5c88. The branch was rebased since then, so I compared the two versions with git range-diff. Helper skills loaded: coderbook, ponytail-review, karpathy-guidelines. This review ran in a separate session.

Previous findings

  • Resolved: Pi status could read wrong in the create dialog. quick-create-local-agent-dialog.tsx:192-201 now loads local models whenever any Pi on the selected computer is authentication_required. The test plan adds the "Model needed while Codex is chosen" case.
  • Resolved: the PR description left out the Create local agent redesign. The body now has a Create local agent section.

Findings

P2

  • apps/web/src/components/ui/modal-dialog.tsx:103-117: the PR description no longer matches the code.
    • The Summary says "Both now lead with the model", but fbd9fd8e removed ModelHeading ("The model heading repeated the Model row, so it goes"). Neither dialog has a model heading now.
    • 61f04167 changes initial focus in the shared ModalDialog, so it affects every dialog in the app, not only these two. It blurs the close button and then calls focus({ focusVisible: false }). The description doesn't mention this.
    • Effect: reviewers and release notes see a narrower change than the one that ships.
    • Fix: update the Summary. Drop the "lead with the model" line and add a line on the dialog-wide focus change.

P3

  • apps/web/src/features/rooms/create-agent.messages.ts:21: createAgentMessages.offlineComputer ("{name} · Offline") has no callers now.
    • Its only caller was the old <SelectItem> in quick-create-local-agent-dialog.tsx, and offline status now comes from ComputerStatus.
    • Fix: delete the key and its translation at apps/web/src/i18n/locales/zh-CN.json:149. This PR already removed the agentRuntime keys it made unused.

Verified as fine

  • Computer choices: upgrade-required computers stay disabled in Runtime settings (edit-agent-runtime-dialog.tsx, disabled: item.upgrade_required passed to OptionList → <input disabled> in runtime-setting-rows.tsx). Offline computers stay selectable.
  • Unavailable saved model: it still shows as a disabled first option, and the row value uses the same unavailableOption text.
  • Reasoning: when the model's efforts can't be read, the row is disabled and still shows the saved effort as unavailable (ReasoningRow, disabled={!available}).
  • Locking: opening from Reasoning locks the Model row (disabled={field === "reasoning"}). placementLocked still locks Computer and Runtime. When a row is disabled, SettingRow keeps it closed (expanded = open && !disabled), even if it was the row the dialog opened on.
  • Create dialog state resets: choosing a Runtime still clears the model and effort; choosing a model still clears the effort. "Connect a new computer" closes the open row before it opens setup.
  • ModalDialog fallback: when the body and footer have nothing focusable, focus goes back to the close button, as before (modal-dialog.tsx:110-113). Browsers that ignore focusVisible still move focus correctly.
  • Assets and text: the runtime logos are static SVG imports with alt="" next to a visible name. The only CJK added is in zh-CN.json, which is allowed. No commit message contains Chinese.

Process notes

  • Several style(web) commits patch earlier commits in this same PR; for example, 4bca761b removes the tinted block that fbd9fd8e added. main takes rebase merges, so consider squashing them into 66f27f73 (git rebase -i --autosquash).

CI

All required checks pass: check (web), web tests (1/2, 2/2), web-static, repository-gate, CodeQL. Checks for the other apps were skipped because this PR doesn't touch them. I didn't run any tests myself.

Automated review by Claude Code


Automated review of 3705f66 by Claude Code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@linger-review linger-review 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.

Approve (0 findings)

Follow-up on 3705f66. Merge base 1c35212b, 7 commits, 15 files reviewed; one commit since the previous review.

Previous findings

  • Resolved: PR description out of date. The body no longer mentions the model heading and now has an "Every dialog: initial focus without a ring" section for apps/web/src/components/ui/modal-dialog.tsx:103.
  • Resolved: unused offlineComputer label. 7c07a6ef removes it from create-agent.messages.ts and zh-CN.json, and git grep finds no references left.

Verified as fine

  • Initial dialog focus: the close button gives up focus (blur()) before the target takes it with focus({ focusVisible: false }). When neither the body nor the footer has a focusable control, focus falls back to the close button itself (modal-dialog.tsx:107-116). Dialogs whose content already holds focus skip this branch.
  • Upgrade-required computers stay out of reach as before. Create leaves them out of the list (quick-create-local-agent-dialog.tsx:120-125). Runtime settings shows them disabled (edit-agent-runtime-dialog.tsx:241).
  • Pi's local models now load whenever any Pi runtime on the selected computer is authentication_required, which is what the Runtime list's Pi status needs (quick-create-local-agent-dialog.tsx:190-201).

Process notes

  • The branch is 7 commits behind main. main requires up-to-date branches, so it needs a rebase.

CI

  • web tests (1/2, 2/2), web-static and repository-gate were still pending at review time. changes passed, and the other jobs were skipped because nothing they cover changed. I ran no tests myself.

Automated review by Claude Code


Automated review of 7c07a6e by Claude Code.

@heweijie0306
heweijie0306 added this pull request to the merge queue Nov 26, 2026
Merged via the queue into main with commit a86a2e0 Nov 26, 2026
16 checks passed
@heweijie0306
heweijie0306 deleted the ethan/runtime-settings-rows branch November 26, 2026 16:13
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