diff --git a/design/hide-screens.pen b/design/hide-screens.pen index 1157e9bc61..fdc82db56e 100644 --- a/design/hide-screens.pen +++ b/design/hide-screens.pen @@ -1264,6 +1264,10 @@ "type": "number", "value": 18 }, + "--size-agent-child-indent": { + "type": "number", + "value": 12 + }, "--size-lineage-chevron": { "type": "number", "value": 16 @@ -27951,7 +27955,7 @@ "$--spacing-xs", "$--spacing-xs", "$--spacing-xs", - 66 + 60 ], "descendants": { "hideui:sar-dot": { @@ -28033,7 +28037,7 @@ "$--spacing-xs", "$--spacing-xs", "$--spacing-xs", - 66 + 60 ], "descendants": { "hideui:sar-dot": { @@ -29794,7 +29798,7 @@ "$--spacing-xs", "$--spacing-xs", "$--spacing-xs", - 66 + 60 ], "descendants": { "hideui:sar-dot": { @@ -29876,7 +29880,7 @@ "$--spacing-xs", "$--spacing-xs", "$--spacing-xs", - 66 + 60 ], "descendants": { "hideui:sar-dot": { diff --git a/design/hide-ui.lib.pen b/design/hide-ui.lib.pen index e0d2683da1..9e121ca171 100644 --- a/design/hide-ui.lib.pen +++ b/design/hide-ui.lib.pen @@ -34696,6 +34696,10 @@ "--size-gallery-scene-h": { "type": "number", "value": 880 + }, + "--size-agent-child-indent": { + "type": "number", + "value": 12 } }, "fileToken": "61e6a599-bafe-4c87-80e7-10732d9e7fe4", diff --git a/design/review-targets.json b/design/review-targets.json index 70479a015b..e5510737d1 100644 --- a/design/review-targets.json +++ b/design/review-targets.json @@ -23,7 +23,7 @@ "checkout-closed": "main's agent rows closed with its chevron, so its status badge counts them." }, "rules": { - "childIndentPx": 18, + "childIndentPx": 12, "rootsAligned": true, "stableUnderHover": true, "stableUnderFocus": true, diff --git a/design/tokens.json b/design/tokens.json index 41a55f59bc..0adcaab3c6 100644 --- a/design/tokens.json +++ b/design/tokens.json @@ -656,6 +656,10 @@ "type": "number", "value": 18 }, + "--size-agent-child-indent": { + "type": "number", + "value": 12 + }, "--size-lineage-chevron": { "type": "number", "value": 16 diff --git a/scripts/pen-screens.mjs b/scripts/pen-screens.mjs index bbf808292e..70f9c4575e 100644 --- a/scripts/pen-screens.mjs +++ b/scripts/pen-screens.mjs @@ -1232,6 +1232,7 @@ function buildProjectsSidebar(tokens) { const sm = num(tokens, '--spacing-sm'); const row = width - 2 * xs; const indent = num(tokens, '--size-lineage-indent'); + const childIndent = num(tokens, '--size-agent-child-indent'); const glyphColumn = sm + indent; const nameColumn = glyphColumn + num(tokens, '--size-checkout-icon') + sm; const markSlot = num(tokens, '--size-agent-mark'); @@ -1325,9 +1326,9 @@ function buildProjectsSidebar(tokens) { } // An opened checkout's agent row: its marks under the checkout name, one - // lineage step further per level, the context already said by the rows above. + // child step further per level, the context already said by the rows above. function agentRow(id, {status, depth = 0, ...options}) { - return screenSidebarAgentRow(id, {symbol: SYMBOL[status], color: STATUS[status], inset: nameColumn + depth * indent, width: row, ...options}); + return screenSidebarAgentRow(id, {symbol: SYMBOL[status], color: STATUS[status], inset: nameColumn + depth * childIndent, width: row, ...options}); } // An opened checkout and its agent rows, on one small group fill. diff --git a/web/e2e/projects-sidebar.spec.ts b/web/e2e/projects-sidebar.spec.ts index 82b61af041..95b909332a 100644 --- a/web/e2e/projects-sidebar.spec.ts +++ b/web/e2e/projects-sidebar.spec.ts @@ -14,7 +14,7 @@ import fs from "node:fs"; import path from "node:path"; import { startHerdr, type HerdrFixture } from "./herdr-fixture"; import { startHided, type Daemon } from "./hided-fixture"; -import { countSent, keyboardFocus, rest, rowGeometry, screenshot, sidebarColumns, sidebarOverflow, sidebarRowsFit } from "./wire"; +import { agentColumns, countSent, keyboardFocus, rest, rowGeometry, screenshot, sidebarColumns, sidebarOverflow, sidebarRowsFit } from "./wire"; test.describe.configure({ timeout: 180_000 }); @@ -261,6 +261,11 @@ test("the Projects tab: kind, age, status badges, opened checkouts and folded pr // D-3: project, checkout, folder and agent rows, parents and the rest, end // their times on one column and centre their chevrons on another. expect(await sidebarColumns(page)).toEqual({ times: [expect.any(Number)], chevrons: [expect.any(Number)] }); + // A child's status mark and title start one 12px child step right of its parent's. + // The child is also a root in its own checkout's list, so both are read from the parent's list. + const lineage = (await agentColumns(page)).find((list) => list.rows.some((entry) => entry.pane === mainPane))?.rows ?? []; + const [parentColumns, childColumns] = [mainPane, rowsPane].map((pane) => lineage.find((entry) => entry.pane === pane)); + expect([childColumns!.mark - parentColumns!.mark, childColumns!.title - parentColumns!.title].map(Math.round)).toEqual([12, 12]); // The same fold in Agents: the child is drawn under its parent there too. await page.locator('[data-sidebar-mode="agents"]').click(); await expect(page.locator(`[data-agent-list] [data-pane="${rowsPane}"]`)).toHaveAttribute("data-depth", "1"); diff --git a/web/e2e/wire.ts b/web/e2e/wire.ts index 30ad4f3da1..b08adf1a31 100644 --- a/web/e2e/wire.ts +++ b/web/e2e/wire.ts @@ -149,4 +149,4 @@ export async function keyboardFocus(page: Page, control: Locator): Promise // The sidebar's geometry is measured in one module, shared with the design // review command, so a spec and a review judge the same boxes. -export { sidebarColumns, sidebarOverflow, sidebarRowsFit } from "./sidebar-geometry.mjs"; +export { agentColumns, sidebarColumns, sidebarOverflow, sidebarRowsFit } from "./sidebar-geometry.mjs"; diff --git a/web/src/components/sidebar-agent-row.tsx b/web/src/components/sidebar-agent-row.tsx index 2ff8b9a9dd..666bccb728 100644 --- a/web/src/components/sidebar-agent-row.tsx +++ b/web/src/components/sidebar-agent-row.tsx @@ -93,7 +93,7 @@ export const SidebarAgentRow = memo(function SidebarAgentRow({ data-agent-device={device ?? "local"} data-depth={depth} className={cn("group/row relative flex items-start gap-xs rounded-sm py-xs pr-xs text-body", selected ? "bg-secondary" : "hover:bg-accent")} - style={{ paddingLeft: `calc(${inset} + ${depth} * var(--size-lineage-indent))` }} + style={{ paddingLeft: `calc(${inset} + ${depth} * var(--size-agent-child-indent))` }} >