Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions design/hide-screens.pen
Original file line number Diff line number Diff line change
Expand Up @@ -1264,6 +1264,10 @@
"type": "number",
"value": 18
},
"--size-agent-child-indent": {
"type": "number",
"value": 12
},
"--size-lineage-chevron": {
"type": "number",
"value": 16
Expand Down Expand Up @@ -27951,7 +27955,7 @@
"$--spacing-xs",
"$--spacing-xs",
"$--spacing-xs",
66
60
],
"descendants": {
"hideui:sar-dot": {
Expand Down Expand Up @@ -28033,7 +28037,7 @@
"$--spacing-xs",
"$--spacing-xs",
"$--spacing-xs",
66
60
],
"descendants": {
"hideui:sar-dot": {
Expand Down Expand Up @@ -29794,7 +29798,7 @@
"$--spacing-xs",
"$--spacing-xs",
"$--spacing-xs",
66
60
],
"descendants": {
"hideui:sar-dot": {
Expand Down Expand Up @@ -29876,7 +29880,7 @@
"$--spacing-xs",
"$--spacing-xs",
"$--spacing-xs",
66
60
],
"descendants": {
"hideui:sar-dot": {
Expand Down
4 changes: 4 additions & 0 deletions design/hide-ui.lib.pen
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion design/review-targets.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 4 additions & 0 deletions design/tokens.json
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,10 @@
"type": "number",
"value": 18
},
"--size-agent-child-indent": {
"type": "number",
"value": 12
},
"--size-lineage-chevron": {
"type": "number",
"value": 16
Expand Down
5 changes: 3 additions & 2 deletions scripts/pen-screens.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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.
Expand Down
7 changes: 6 additions & 1 deletion web/e2e/projects-sidebar.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 });

Expand Down Expand Up @@ -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");
Expand Down
2 changes: 1 addition & 1 deletion web/e2e/wire.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,4 +149,4 @@ export async function keyboardFocus(page: Page, control: Locator): Promise<void>

// 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";
2 changes: 1 addition & 1 deletion web/src/components/sidebar-agent-row.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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))` }}
>
<Hint label={hint} reveals>
<button
Expand Down
1 change: 1 addition & 0 deletions web/src/tokens.css
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@
--size-checkout-icon: 14px;
--size-checkout-metadata-inset: 22px;
--size-lineage-indent: 18px;
--size-agent-child-indent: 12px;
--size-lineage-chevron: 16px;
--size-worktree-dialog: 440px;
--size-tab-preferred: 180px;
Expand Down
Loading