Skip to content

Commit 0a8226c

Browse files
authored
fix(ui): give embedded settings sections the shared section rhythm (#126541)
* fix(ui): give embedded settings sections the shared section rhythm The agents tab panel hosted settings sections in a bare div, so sections stacked with zero separation; the bespoke .agents-main margin rule in agents.css missed the nested tabpanel entirely. Descriptions also pulled up to 4px under control-height header actions (squeezed Verify/Save rows). Add a .settings-stack primitive to settings.css for embedded surfaces, use it on the agent tab panel, delete the page-local margin fork, and let section descriptions clear action-bearing headers. * test(agents): export getRuntimeConfigSourceSnapshot from runtime-snapshot mock Main's checks-node-compact-large shard is red: #126531 routed provider-model-routes through projectConfigOntoRuntimeSourceSnapshot, which reads getRuntimeConfigSourceSnapshot, and this suite's explicit vi.mock factory did not export it (24 failures). Return null so the projection no-ops and resolvers keep reading the provided config.
1 parent 3374458 commit 0a8226c

5 files changed

Lines changed: 20 additions & 6 deletions

File tree

‎src/agents/agent-command.live-model-switch.test.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,9 @@ vi.mock("../skills/discovery/chat-commands.runtime.js", () => ({
397397

398398
vi.mock("../config/runtime-snapshot.js", () => ({
399399
getRuntimeConfigSnapshot: () => state.runtimeConfigMock ?? state.defaultRuntimeConfig,
400+
// No source snapshot: runtime-source projection no-ops and resolvers read the
401+
// provided config directly, matching this suite's pre-projection world.
402+
getRuntimeConfigSourceSnapshot: () => null,
400403
registerRuntimeConfigSnapshotPreparer: vi.fn(),
401404
setRuntimeConfigSnapshot: vi.fn(),
402405
}));

‎ui/docs/design-system/settings-design.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Every settings surface (the `/settings` takeover pages plus the Plugins/Skills h
1414
```
1515

1616
- **Sections are typography, not chrome.** Grouping comes from whitespace + a small uppercase heading — never a card header.
17+
- **Embedded surfaces keep the rhythm.** A container that hosts sections without `.settings-page`'s centered column (tab panels, split layouts) takes `.settings-stack`; never re-space sections with page-local margin rules.
1718
- **Exactly one level of elevation.** A group never contains another card, callout, or bordered box. Nested detail uses `.settings-subrows` (indented rows), a stacked row, or a drill-in nav row.
1819
- **Row anatomy:** left is title (`--control-ui-text-md`, weight 500) over an optional one-line description (muted, sm). Right is exactly one control: toggle, select, segmented, button, plain value, or chevron (nav). Wide editors use the `stacked` variant.
1920
- **Lists are rows too.** An entity list (plugin, device, session) is a group whose rows carry an action cluster in the control slot — same anatomy as a toggle row.

‎ui/src/pages/agents/view.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,7 @@ export function renderAgents(props: AgentsProps) {
330330
)}
331331
<div
332332
id="agent-panel"
333+
class="settings-stack"
333334
role="tabpanel"
334335
aria-labelledby=${`agents-tab-${props.activePanel}`}
335336
>

‎ui/src/styles/agents.css‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,3 @@
1515
.agents-panel-body + .settings-kv {
1616
border-top: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
1717
}
18-
19-
/* .agents-main is a 14px-gap grid (components.css); settings sections need
20-
more whitespace between each other than panel chrome does. */
21-
.agents-main > .settings-section:not(:first-child) {
22-
margin-top: var(--space-4);
23-
}

‎ui/src/styles/settings.css‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,15 @@
8787
max-width: 1120px;
8888
}
8989

90+
/* Section rhythm for embedded surfaces (tab panels, split layouts) that host
91+
settings sections without .settings-page's centered column. Sections crammed
92+
into a plain wrapper collapse to zero separation. */
93+
.settings-stack {
94+
display: flex;
95+
flex-direction: column;
96+
gap: var(--space-8);
97+
}
98+
9099
.settings-page__intro {
91100
margin: 0;
92101
font-size: var(--control-ui-text-sm);
@@ -130,6 +139,12 @@
130139
color: var(--muted);
131140
}
132141

142+
/* Control-height header actions overhang the one-line heading; keep the
143+
description's negative pull from squeezing it against the button row. */
144+
.settings-section__header:has(.settings-section__actions) + .settings-section__desc {
145+
margin-top: 0;
146+
}
147+
133148
.settings-section__actions {
134149
display: flex;
135150
align-items: center;

0 commit comments

Comments
 (0)