diff --git a/agents/prd/sidebar-typography/prd.md b/agents/prd/sidebar-typography/prd.md new file mode 100644 index 0000000000..8508ebfd97 --- /dev/null +++ b/agents/prd/sidebar-typography/prd.md @@ -0,0 +1,90 @@ +--- +topic: "Projects 사이드바 타이포·밀도 재설계 (E-mid)" +status: "ready" +human_approval: "pending" +review_profile: "standard" +review_rationale: "사용자가 매일 보는 사이드바의 글자·행·너비를 바꾸고 코어 ui_state에 필드 하나를 더하지만, 데이터·인증·외부 효과는 없다." +source_intake: "agents/interview/sidebar-typography/qa-log.md" +created_at: "2026-09-27" +updated_at: "2026-09-27" +--- + +# PRD: Projects 사이드바 타이포·밀도 재설계 (E-mid) + +## Goal + +hide 웹 셸의 Projects 사이드바를 보는 조작자가 프로젝트, 체크아웃, 에이전트를 한눈에 구분해 읽을 수 있게 한다. +지금은 Appearance 글자 크기 배율(1.23)이 사이드바 토큰에 곱해지고, 거의 모든 행이 500~600 굵기이며, purpose 없는 체크아웃 행에도 빈 둘째 줄이 생겨서 목록 전체가 크고 뚱뚱하고 헐렁하게 보인다. +Pen 보드 v1~v7에서 고른 E-mid 사다리(프로젝트 13/600 하나만 굵게, 체크아웃·에이전트 12/400, 메타 11)와 행 높이(36 · 32/48 · 28/44)를 적용하고, 둘째 줄은 내용이 있을 때만 그리며, 사이드바는 배율을 따르지 않고, 너비를 220~440px로 끌어 조절할 수 있게 한다. + +## Non-goals + +- 항상 두 줄 + 둘째 줄 대체 사다리(purpose → PR → issue → git 사실, 또는 접힌 대표 에이전트 이름)는 넣지 않는다. 결과: purpose가 없는 행은 한 줄이라 1줄·2줄이 섞인다. 재검토: 사용자가 섞인 리듬이 거슬린다고 말할 때 (D-15). +- 한글 폰트(Pretendard 등) 번들은 하지 않는다. 결과: 한글은 시스템 폴백 폰트로 그려진다. 재검토: 구현 캡처에서 한글 줄이 라틴보다 여전히 눈에 띄게 굵어 보일 때 (D-14). +- 에이전트 행의 task/progress 규칙(둘째 줄의 request/news/quiet 톤과 표시 조건)은 바꾸지 않는다. 결과: 조용한 진행 문장은 여전히 tooltip에만 있다 (D-08). +- 사이드바 너비를 키보드로 조절하는 경로는 넣지 않는다. 결과: 포인터 드래그와 더블클릭만 있다. 재검토: 접근성 요구가 들어올 때 (D-09). +- 작업 영역 쪽에 새 최소 폭 가드는 두지 않는다. 결과: 사이드바를 넓히면 기존 좁은 창 규칙이 측면 패널을 먼저 접는다 (D-21). +- 사이드바 밖(탭 스트립, 패널 헤더, 문서, Overview)의 배율 적용은 그대로다 (D-06). +- engineering 원칙 12(테스트 가격): 굵기·크기 자체를 단위 테스트로 고정하지 않는다. 캡처 비교와 e2e 기하 규칙이 증명이다 (D-16). + +## Decisions + +| D-n | 결정 | 근거 | +| --- | --- | --- | +| D-01 | Pen 보드 v1~v7 중 E-mid를 채택한다. A(지금)·B(배율만)·D(제안+배율)·F(인라인 purpose)·G(전부 1줄)·H/I(항상 2줄)·E2(조밀)·comfort·airy는 기각. | 사용자: "E mid 좋다 이거로 해서 작업 바로 please 해줘~ opus5.5" (인터뷰 D-02) | +| D-02 | 글자 사다리: 프로젝트명과 All projects 13px/600이 화면의 유일한 semibold. 체크아웃 이름 12px/400, 포커스된 체크아웃 500. 에이전트 작업 이름 12px/400(선택·주의 상태에서도 400, 밝기로 구분). purpose·progress 줄·나이·경과 시간 11px(경과 시간 mono, 10→11). 섹션 헤더 10px/500 문장 부호("Projects · Recent activity · 14"), 대문자 아님. All projects 개수 12px. 기존 텍스트 토큰(subhead/body/caption/micro)만 쓴다. | 사용자: "C 괜찮은데?", "음 우선 그냥 e로 하자", "E mid 좋다" (인터뷰 D-03) | +| D-03 | 행 높이: 프로젝트 행 36; 체크아웃 행 한 줄 32 / 두 줄 48; 에이전트 행 한 줄 28 / 두 줄 44(첫째 줄 20, 둘째 줄 16, 위아래 4); 체크아웃 둘째 줄 16; 열린 체크아웃 그룹 채움 안쪽 위아래 4. | 사용자: "E-airy와 E comoft 중간으로? 해줄래?", "E mid 좋다" (인터뷰 D-04) | +| D-04 | 체크아웃 행은 purpose가 있을 때만 두 줄이다. 에이전트가 있어도 purpose가 없으면 한 줄이고 마지막 커밋 나이는 첫째 줄의 시간 열에 놓인다. | 사용자: "음 우선 그냥 e로 하자" (인터뷰 D-05) | +| D-05 | Projects/Agents 사이드바는 Appearance 글자 크기(`--interface-scale`)를 따르지 않는다. 사이드바 안의 모든 텍스트 토큰은 배율 1로 렌더되고, 배율은 나머지 인터페이스에만 적용된다. | 사용자: "사이드바는 배율 안 따르게 하고" (인터뷰 D-06) | +| D-06 | 가정(위임): 체크아웃 이름의 경로 접두어(첫 슬래시까지, `prd/` `gen-prd/` `docs/` `fix/`)는 muted, 슬래시 뒤는 foreground. 슬래시가 없는 이름은 그대로. 접두어 길이에 따른 예외는 없다. | 보드 C/E/E-mid에 그린 대로 채택 (인터뷰 D-07) | +| D-07 | 에이전트 행의 task/progress 규칙은 UI_BEHAVIOR 그대로: 첫째 줄 task(상태 마크, 제공자 마크, 안정된 이름, 접힌 부모의 배지, 경과 시간, 부모 chevron), 둘째 줄 progress(요청은 경고색/오류는 붉은색으로 해결될 때까지, 새 소식은 밝게 읽을 때까지, 조용하면 그리지 않음). 자식 행은 한 단(18px) 들여쓰고 muted. | 사용자: "agent item의 경우 task, progress가 각각 어떻게 보여야할지도 정리" → 보드 v4 상태표 채택 (인터뷰 D-08) | +| D-08 | 사이드바 너비를 오른쪽 가장자리 드래그로 조절한다(사용자 결정). 가정(위임): 범위 220~440(기존 `--size-sidebar-min/max`), 기본 292(`--size-sidebar-ideal`), 더블클릭이면 292로 복귀. 이 수치는 되돌리기 쉬운 에이전트 가정이며 사용자가 거부할 수 있다. | 사용자: "왼쪽 사이드바도 너비 조절 가능하게? + max width는 잡아두고 ㅇㅇ 어느정도 너 생각선에서"; 수치는 가정(위임) (인터뷰 D-09) | +| D-09 | 가정(위임): 너비는 전역 UI 상태라 `font_size`·`left_sidebar_visible`과 같은 경로를 쓴다. UiStateSnapshot에 `sidebar_width` 필드, `ui_state_update` 페이로드의 선택 필드, persistence.rs 저장. 셸은 드래그가 끝날 때와 더블클릭 때 한 번 보내고 드래그 중에는 로컬 미리보기만 그린다. 코어는 범위 밖 값을 거부하고 진단을 남긴다(engineering 4). 워크스페이스별 `views_over_share` 모델은 쓰지 않는다. 잡는 폭 `--size-resize-grab` 20px, 보이는 선 `--size-resize-handle` 2px로 패널 구분선과 같은 부품(design 5). | 인터뷰 D-10 (repo: actions.ts:119-126, runtime/events.rs:539-577, persistence.rs:86-87) | +| D-10 | 행 높이는 토큰으로만 바꾸고 공용 토큰은 건드리지 않는다: 프로젝트 행은 `--size-control-regular` 대신 사이드바 전용 토큰(36), 체크아웃 `--size-checkout-row` 36→32, `-detailed` 44→48, 에이전트 첫째 줄은 공용 `--size-control-sm`(24) 대신 전용 토큰 20, 둘째 줄 16, 위아래 4. 소비자 없는 `--size-compact-agent-row-vpad`/`-leading-inset`는 삭제(engineering 1). 값은 전부 design/tokens.json → gen-tokens. | 인터뷰 D-18 (repo: sidebar.tsx:318,501,644,731; sidebar-agent-row.tsx:95,109; check-web-tokens.mjs) | +| D-11 | Pen 라이브러리 Component 시트 네 장(Project Row, Checkout row, Sidebar agent row, Section Header)과 Screen / Projects Sidebar 빌더를 같은 수치로 같은 PR에서 갱신한다. Section Header 마스터(O79KF)의 라벨은 body/600 → micro/500 문장 부호("Projects · Recent activity · 14")로 바꾸고, 스크린 빌더는 로컬 section()을 지우고 그 마스터를 ref로 쓴다(engineering 1, 7). gen-pen/gen-screens/check-design-contract를 통과시킨다. 라이브러리 편집은 스크래치 복사본에서 노드를 만들어 HEAD JSON에 스크립트로 이식하고 HEAD와 구조 diff한다. 개수(nZkan)의 Pen/코드 드리프트는 코드 쪽(body 12)에 맞춘다. | 저장소 규칙 docs/DESIGN_WORKFLOW.md(One PR); 인터뷰 D-11, D-19 | +| D-12 | 배율 미적용이 닿는 기존 검증을 고친다: e2e의 글자 크기 17 시나리오는 "사이드바 글자·행이 배율 1과 같다"로, 리뷰 타깃 projects-sidebar의 scale 조건은 제거(사이드바에 무의미), DESIGN_WORKFLOW의 scale 쿼리 설명은 "사이드바 밖에만 영향"으로. | 인터뷰 D-17 (repo: web/e2e/projects-sidebar.spec.ts:403-432, design/review-targets.json:2-40) | +| D-13 | 저장된 너비는 nav의 인라인 width가 아니라 CSS 변수로 적용한다. e2e 오버플로 헬퍼(sidebar-geometry.mjs:181)가 nav.style.width를 직접 세팅하므로 그 헬퍼와 240px·min 오버플로 검사, 행 높이 동일성 검사는 그대로 동작해야 한다. | 인터뷰 D-21 | +| D-14 | 같은 PR에서 docs/UI_BEHAVIOR.md(체크아웃 행 줄 규칙·나이 위치, 에이전트 행 높이, 사이드바 너비 드래그·저장·복귀, 사이드바는 배율 미적용), docs/ARCHITECTURE.md(배율 적용 범위), docs/DESIGN_WORKFLOW.md(리뷰 타깃 scale, 갤러리 scale 쿼리)를 고친다. | 저장소 규칙 AGENTS.md; 인터뷰 D-22 | +| D-15 | 전달은 PR 하나. 스펙 브랜치 `gen-prd/sidebar-typography`에서 sasu가 만드는 런 워크트리 `prd/sidebar-typography`, base `main`, 병합은 사용자 승인 후. 앞서 제안한 3-PR 분할은 `/please` 한 번 호출로 대체됨. | 사용자: "작업 바로 please 해줘"; agents/config.json delivery.mode=pr (인터뷰 D-12) | +| D-16 | 구현 에이전트는 Claude `claude-opus-5-5`, effort high. | 사용자: "opus5.5" (인터뷰 D-13) | +| D-18 | 단위 테스트 범위: (1) 체크아웃 줄 선택 - purpose 없음+에이전트 있음 → 한 줄, purpose 있음 → 두 줄; (2) 셸의 드래그 clamp - 220 아래·440 위 포인터에서 보내는 값이 경계값; (3) 코어의 범위 밖 `sidebar_width` 거부. 굵기·크기 자체는 테스트하지 않는다(engineering 12). | 인터뷰 D-16 | +| D-17 | 원칙 intake: `~/projects/oh-my-principle` 커밋 654485f의 engineering/principles.md와 design/principles.md를 전부 읽음. design 7·8·12·13과 engineering 1·4·5·7·12를 행/비목표로 옮겼고, design 11(구조적 후보 선택)은 보드 v1~v7로 이미 이행되어 행이 없다. | 인터뷰 D-16, D-20 | + +## Behaviors + +| # | 사용자가 관찰하는 행동 | 결정 | +| --- | --- | --- | +| B1 | Projects 사이드바에서 프로젝트명과 All projects만 13px semibold이고, 체크아웃 이름과 에이전트 작업 이름은 12px 400이다. 포커스된 체크아웃 이름만 500이며, 선택된 에이전트 행은 400에 secondary 채움이다. | D-02, D-07 | +| B2 | purpose, 에이전트 둘째 줄, 마지막 커밋 나이, 경과 시간은 11px이고 나이·경과 시간은 mono다. 섹션 헤더는 10px 500 문장 부호("Projects · Recent activity · 14")다. All projects 개수는 12px다. | D-02 | +| B3 | 프로젝트 행은 36px, 체크아웃 행은 한 줄 32px / 두 줄 48px, 에이전트 행은 한 줄 28px / 두 줄 44px이며, 열린 체크아웃 그룹 채움은 위아래 4px 안쪽 여백을 가진다. | D-03, D-10 | +| B4 | purpose가 없는 체크아웃은 에이전트가 있어도 한 줄이고, 마지막 커밋 나이가 첫째 줄의 시간 열에 배지·chevron과 함께 선다. purpose가 있으면 둘째 줄에 purpose와 나이가 놓인다. 빈 둘째 줄은 어디에도 없다. | D-04, D-18 | +| B5 | 체크아웃 이름의 첫 슬래시까지(`prd/`, `gen-prd/`, `docs/`, `fix/`)는 muted, 나머지는 foreground다. `main`처럼 슬래시 없는 이름과 폴더 이름은 전부 foreground다. | D-06 | +| B6 | 긴 이름은 이름 칸 끝에서 말줄임되고, 모든 행의 시간·배지·chevron은 각각 한 열에 서며 hover·focus로 어떤 행도 움직이거나 크기가 바뀌지 않는다(기존 e2e 규칙 childIndentPx 18, rootsAligned, stableUnderHover, stableUnderFocus, noOverlap, sharedColumns, noSidewaysOverflow 유지). | D-03, D-13 | +| B7 | 한글·라틴 혼합 이름과 긴 이름(갤러리 content=long)이 새 크기·행 높이에서 잘리거나 겹치지 않고, 11px 둘째 줄이 16px 칸 안에서 잘리지 않는다. | D-02, D-03 | +| B8 | Appearance 글자 크기를 11~17 어느 값으로 바꿔도 사이드바의 글자 크기와 행 높이는 그대로다. 사이드바 밖(문서, 뷰어, Overview, 설정)은 지금처럼 배율을 따른다. | D-05, D-12 | +| B9 | 에이전트 행 첫째 줄은 상태 마크, 제공자 마크, 작업 이름, (접힌 부모의) 배지, 경과 시간, (부모의) chevron이고, 둘째 줄은 요청이면 경고색(오류는 붉은색)으로 해결될 때까지, 새 소식이면 밝게 읽을 때까지 보이며, 조용하면 없다. 자식 행은 18px 들여쓰고 muted다. 바뀐 것은 크기·굵기·높이뿐이다. | D-07, D-02, D-03 | +| B10 | 사이드바 오른쪽 가장자리 20px 폭에 포인터를 올리면 col-resize 커서와 2px 선 강조가 보이고, 끌면 사이드바가 220~440px 사이에서 따라오며 경계에서 멈춘다. 놓으면 그 너비가 유지된다. | D-08, D-09, D-18 | +| B11 | 조절한 너비는 hide를 재시작하거나 재접속해도 같다. 가장자리를 더블클릭하면 292px로 돌아가고 그 값도 저장된다. | D-08, D-09 | +| B12 | 사이드바를 넓혀 작업 영역이 좁아지면 기존 좁은 창 규칙이 측면 패널을 먼저 접는다. 사이드바 자체는 220 아래로 내려가지 않는다. | D-08, D-13 | +| B13 | 범위 밖 너비가 코어에 도착하면 코어가 거부하고 진단 로그에 남기며, 화면에는 아무것도 뜨지 않고 사이드바는 마지막 유효 너비를 유지한다(design 13). | D-09, D-18 | +| B14 | 갤러리 scene=projects-sidebar의 dark/light, 너비 220/292/440, content reference/long 캡처가 보드 v7 E-mid export와 같은 사다리·행 높이를 보이고, 실제 앱의 Projects 사이드바 캡처도 같다. | D-01, D-11 | +| B15 | design/hide-ui.lib.pen의 Project Row, Checkout row, Sidebar agent row, Section Header 마스터와 Screen / Projects Sidebar 시트가 같은 수치를 그리고, `node scripts/check-design-contract.mjs`, `scripts/verify-web.sh`, `scripts/verify-cargo.sh`가 통과한다. | D-11 | +| B16 | docs/UI_BEHAVIOR.md, docs/ARCHITECTURE.md, docs/DESIGN_WORKFLOW.md가 새 줄 규칙, 행 높이, 너비 드래그, 배율 범위, 리뷰 타깃 조건을 말한다. | D-14 | + +## Technical structure + +- 코어: `UiStateSnapshot`에 `sidebar_width`(px) 필드 하나, 기본 292; `ui_state_update` 페이로드의 선택 필드; persistence.rs의 StoredUiState에 저장·복원; 220~440 밖은 거부 + 진단. 다른 구조 변경 없음. +- 웹 셸: 사이드바 nav가 코어의 너비를 CSS 변수로 받고, 오른쪽 가장자리 리사이즈 핸들(패널 구분선과 같은 부품)이 드래그 종료·더블클릭 때 `ui_state_update`를 보낸다. nav 자신에 `--interface-scale: 1`을 두어 안의 텍스트 토큰이 배율을 받지 않게 한다. 행 높이·줄 규칙·굵기는 sidebar.tsx와 sidebar-agent-row.tsx의 클래스와 토큰 변경. +- 토큰: design/tokens.json에 사이드바 전용 행 높이 토큰 추가·값 변경, 소비자 없는 두 토큰 삭제, gen-tokens로 tokens.css 재생성. +- 디자인: hide-ui.lib.pen의 네 Component 마스터(Project Row, Checkout row, Sidebar agent row, Section Header)와 pen-screens.mjs의 Projects Sidebar 빌더 갱신, gen-pen/gen-screens 재생성, review-targets.json의 scale 조건 제거. +- 검증: 기존 e2e 사이드바 기하 규칙과 스펙 유지·갱신, 너비 드래그·복원 e2e, 단위 테스트(줄 선택, 셸 clamp, 코어 범위 거부; D-18), 갤러리·실제 앱 캡처 등록. + +## Risks + +- 한글 폴백 폰트가 400에서도 라틴보다 굵어 보이면 D-14 재검토. 캡처 비교로 확인한다. +- 11px 둘째 줄의 기본 행간(1.5 → 16.5px)이 16px 칸을 0.5px 넘는다. 칸은 min-height라 잘리지 않지만, 캡처에서 겹침이 보이면 둘째 줄 토큰을 17로 올리는 것이 되돌리기 쉬운 조정이다. +- e2e 헬퍼가 nav.style.width를 직접 쓰므로 너비를 인라인으로 적용하면 오버플로 검사가 깨진다(D-13). 리뷰어는 nav의 너비 적용 방식을 본다. +- 사이드바를 넓히면 측면 패널의 좁은 창 규칙이 더 자주 발동한다. 기존 규칙의 범위이며 새 상태를 그리지 않는다. +- Pen 라이브러리 편집은 pen CLI save가 무관한 노드를 망가뜨린 전례가 있어 HEAD JSON 이식과 구조 diff가 필수다(D-11). +- 실제 앱 캡처는 격리된 hided/Herdr에서만 찍는다. 조작자의 앱·서버·pane은 건드리지 않는다. +- 사용자가 구현 전에 할 일은 없다. diff --git a/design/hide-screens.pen b/design/hide-screens.pen index cdc2a8b6dc..7f1516e3c5 100644 --- a/design/hide-screens.pen +++ b/design/hide-screens.pen @@ -1216,10 +1216,6 @@ "type": "number", "value": 24 }, - "--size-control-regular": { - "type": "number", - "value": 36 - }, "--size-checkbox": { "type": "number", "value": 16 @@ -1242,11 +1238,23 @@ }, "--size-checkout-row": { "type": "number", - "value": 36 + "value": 32 }, "--size-checkout-row-detailed": { "type": "number", - "value": 44 + "value": 48 + }, + "--size-project-row": { + "type": "number", + "value": 36 + }, + "--size-sidebar-line": { + "type": "number", + "value": 20 + }, + "--size-sidebar-line-detail": { + "type": "number", + "value": 16 }, "--size-overview-group-header": { "type": "number", @@ -1356,10 +1364,6 @@ "type": "number", "value": 13 }, - "--size-compact-agent-leading-inset": { - "type": "number", - "value": 13 - }, "--size-compact-agent-row-vpad": { "type": "number", "value": 5 @@ -1579,12 +1583,12 @@ { "type": "text", "id": "main-sidebar-seen-l", - "name": "SEEN · 2", - "content": "SEEN · 2", + "name": "Seen · 2", + "content": "Seen · 2", "fill": "$--muted-foreground", "fontFamily": "$--font-ui", "fontSize": "$--text-micro", - "fontWeight": "600" + "fontWeight": "500" }, { "id": "main-sidebar-agent0-l", @@ -4837,12 +4841,12 @@ { "type": "text", "id": "main-sidebar-seen-d", - "name": "SEEN · 2", - "content": "SEEN · 2", + "name": "Seen · 2", + "content": "Seen · 2", "fill": "$--muted-foreground", "fontFamily": "$--font-ui", "fontSize": "$--text-micro", - "fontWeight": "600" + "fontWeight": "500" }, { "id": "main-sidebar-agent0-d", @@ -16516,12 +16520,12 @@ { "type": "text", "id": "ws-sidebar-seen-lo", - "name": "SEEN · 2", - "content": "SEEN · 2", + "name": "Seen · 2", + "content": "Seen · 2", "fill": "$--muted-foreground", "fontFamily": "$--font-ui", "fontSize": "$--text-micro", - "fontWeight": "600" + "fontWeight": "500" }, { "id": "ws-sidebar-agent0-lo", @@ -18017,12 +18021,12 @@ { "type": "text", "id": "ws-sidebar-seen-lc", - "name": "SEEN · 2", - "content": "SEEN · 2", + "name": "Seen · 2", + "content": "Seen · 2", "fill": "$--muted-foreground", "fontFamily": "$--font-ui", "fontSize": "$--text-micro", - "fontWeight": "600" + "fontWeight": "500" }, { "id": "ws-sidebar-agent0-lc", @@ -19281,12 +19285,12 @@ { "type": "text", "id": "ws-sidebar-seen-do", - "name": "SEEN · 2", - "content": "SEEN · 2", + "name": "Seen · 2", + "content": "Seen · 2", "fill": "$--muted-foreground", "fontFamily": "$--font-ui", "fontSize": "$--text-micro", - "fontWeight": "600" + "fontWeight": "500" }, { "id": "ws-sidebar-agent0-do", @@ -20782,12 +20786,12 @@ { "type": "text", "id": "ws-sidebar-seen-dc", - "name": "SEEN · 2", - "content": "SEEN · 2", + "name": "Seen · 2", + "content": "Seen · 2", "fill": "$--muted-foreground", "fontFamily": "$--font-ui", "fontSize": "$--text-micro", - "fontWeight": "600" + "fontWeight": "500" }, { "id": "ws-sidebar-agent0-dc", @@ -30163,7 +30167,7 @@ "type": "text", "id": "screen-projects-sidebar-spec", "name": "sidebar.tsx, projects.ts: th", - "content": "sidebar.tsx, projects.ts: the Projects tab, the scope picker. All projects heads the list and opens All projects; the row of the scope the center shows carries the selected fill, here the Overview child under herdr-ide, and a checkout only while its Workspace is in front. A project’s primary checkout comes first, then the rest by activity. Every line ends in its time or status badge and then a fold slot, so names never move and the times, badges and chevrons stand in one column each; a folded chevron is drawn and an unfolded one waits for the pointer. A row’s menu opens on a right-click, with nothing drawn for it. A status badge counts agents under the mark each agent’s own row draws, worst first (× ! ? ● ✓ ○). A project row opens the Overview and wears its checkouts’ badges added up, open or folded, and no time. The first row under an expanded Git project is Overview, an instance of the checkout row with a layout-dashboard glyph and empty trailing slots. A checkout row opens the checkout and unfolds its agents; clicking its already selected, unfolded Workspace folds them without leaving it. The chevron changes disclosure alone. While its agent rows are folded its badge ends line one, and its chevron, there only while agents run, opens them on one group fill in place of the badge. Line two is the purpose with the last-commit age on the time column, kept wherever agents run; a checkout with neither is one line with its age there. A parent agent folds its children with the same chevron and speaks for them with its badge. A folded parent keeps its own-checkout descendants in the badge and draws one C-style line per other checkout, with the R1 server-glyph device chip. A checkout raised by an external root prefixes line two with the parent checkout. The kind glyph is the pull request’s lifecycle when GitHub knows one, else folder, primary, detached or branch; a missing folder is danger with no age.", + "content": "sidebar.tsx, projects.ts: the Projects tab, the scope picker. All projects heads the list and opens All projects; the row of the scope the center shows carries the selected fill, here the Overview child under herdr-ide, and a checkout only while its Workspace is in front. A project’s primary checkout comes first, then the rest by activity. Every line ends in its time or status badge and then a fold slot, so names never move and the times, badges and chevrons stand in one column each; a folded chevron is drawn and an unfolded one waits for the pointer. A row’s menu opens on a right-click, with nothing drawn for it. A status badge counts agents under the mark each agent’s own row draws, worst first (× ! ? ● ✓ ○). A project row opens the Overview and wears its checkouts’ badges added up, open or folded, and no time. The first row under an expanded Git project is Overview, an instance of the checkout row with a layout-dashboard glyph and empty trailing slots. A checkout row opens the checkout and unfolds its agents; clicking its already selected, unfolded Workspace folds them without leaving it. The chevron changes disclosure alone. While its agent rows are folded its badge ends line one, and its chevron, there only while agents run, opens them on one group fill in place of the badge. A checkout name is 12/400 with its prefix up to the first slash muted. Line two is the purpose with the last-commit age on the time column, drawn only for a purpose or a raised-from parent; a checkout without either is one line with its age there. A parent agent folds its children with the same chevron and speaks for them with its badge. A folded parent keeps its own-checkout descendants in the badge and draws one C-style line per other checkout, with the R1 server-glyph device chip. A checkout raised by an external root prefixes line two with the parent checkout. The kind glyph is the pull request’s lifecycle when GitHub knows one, else folder, primary, detached or branch; a missing folder is danger with no age.", "fill": "$--muted-foreground", "fontFamily": "$--font-ui", "fontSize": "$--text-caption", @@ -30321,28 +30325,37 @@ } }, { - "type": "frame", "id": "psb-sec-pin-l", - "name": "Section", - "children": [ - { - "type": "text", - "id": "psb-sec-pin-l-t", - "name": "PINNED · 1", - "content": "PINNED · 1", - "fill": "$--muted-foreground", - "fontFamily": "$--font-ui", - "fontSize": "$--text-micro", - "fontWeight": "600" - } - ], + "type": "ref", + "ref": "hideui:O79KF", + "name": "Pinned · 1", "width": 284, "padding": [ "$--spacing-sm", "$--spacing-sm", "$--spacing-xxs", "$--spacing-sm" - ] + ], + "descendants": { + "hideui:nOk00": { + "fill": "$--muted-foreground" + }, + "hideui:VOd6D": { + "fill": "$--muted-foreground", + "content": "Pinned · 1" + }, + "hideui:rVsKB": { + "fill": "$--muted-foreground", + "enabled": false + }, + "hideui:g7fzt": { + "fill": "$--muted-foreground", + "enabled": false + }, + "hideui:eK6gz": { + "enabled": false + } + } }, { "id": "psb-p-notes-l", @@ -30350,7 +30363,7 @@ "ref": "hideui:DLP27", "name": "team-notes", "width": 284, - "height": 44, + "height": 48, "padding": [ 0, 4, @@ -30362,10 +30375,14 @@ "fill": "$--subtle-foreground", "icon": "folder" }, + "hideui:checkout-name-prefix": { + "fill": "$--muted-foreground", + "enabled": false + }, "hideui:q91d7": { "fill": "$--foreground", "content": "team-notes", - "fontSize": "$--text-title", + "fontSize": "$--text-subhead", "fontWeight": "600" }, "hideui:checkout-status": { @@ -30463,28 +30480,37 @@ } }, { - "type": "frame", "id": "psb-sec-recent-l", - "name": "Section", - "children": [ - { - "type": "text", - "id": "psb-sec-recent-l-t", - "name": "PROJECTS · RECENT ACTIVITY ·", - "content": "PROJECTS · RECENT ACTIVITY · 5", - "fill": "$--muted-foreground", - "fontFamily": "$--font-ui", - "fontSize": "$--text-micro", - "fontWeight": "600" - } - ], + "type": "ref", + "ref": "hideui:O79KF", + "name": "Projects · Recent activity · 5", "width": 284, "padding": [ "$--spacing-sm", "$--spacing-sm", "$--spacing-xxs", "$--spacing-sm" - ] + ], + "descendants": { + "hideui:nOk00": { + "fill": "$--muted-foreground" + }, + "hideui:VOd6D": { + "fill": "$--muted-foreground", + "content": "Projects · Recent activity · 5" + }, + "hideui:rVsKB": { + "fill": "$--muted-foreground", + "enabled": false + }, + "hideui:g7fzt": { + "fill": "$--muted-foreground", + "enabled": false + }, + "hideui:eK6gz": { + "enabled": false + } + } }, { "id": "psb-p-herdr-l", @@ -30582,7 +30608,7 @@ "ref": "hideui:DLP27", "name": "Overview", "width": 284, - "height": 36, + "height": 32, "padding": [ 0, 4, @@ -30595,10 +30621,14 @@ "fill": "$--subtle-foreground", "icon": "layout-dashboard" }, + "hideui:checkout-name-prefix": { + "fill": "$--muted-foreground", + "enabled": false + }, "hideui:q91d7": { "fill": "$--foreground", "content": "Overview", - "fontWeight": "600" + "fontWeight": "500" }, "hideui:checkout-status": { "fill": "$--secondary", @@ -30685,7 +30715,7 @@ "ref": "hideui:DLP27", "name": "main", "width": 284, - "height": 44, + "height": 48, "padding": [ 0, 4, @@ -30697,10 +30727,14 @@ "fill": "$--subtle-foreground", "icon": "house" }, + "hideui:checkout-name-prefix": { + "fill": "$--muted-foreground", + "enabled": false + }, "hideui:q91d7": { "fill": "$--foreground", "content": "main", - "fontWeight": "500" + "fontWeight": "normal" }, "hideui:checkout-status": { "fill": "$--secondary", @@ -31287,8 +31321,7 @@ }, "hideui:sar-title": { "fill": "$--foreground", - "content": "배포 전 확인", - "fontWeight": "500" + "content": "배포 전 확인" }, "hideui:sar-branch": { "fill": "$--secondary", @@ -31347,6 +31380,10 @@ ], "width": 284, "layout": "vertical", + "padding": [ + "$--spacing-xs", + 0 + ], "fill": "$--muted", "cornerRadius": "$--radius-sm" }, @@ -31356,7 +31393,7 @@ "ref": "hideui:DLP27", "name": "quick/155-browser-display", "width": 284, - "height": 44, + "height": 48, "padding": [ 0, 4, @@ -31368,10 +31405,15 @@ "fill": "$--subtle-foreground", "icon": "git-branch" }, + "hideui:checkout-name-prefix": { + "fill": "$--muted-foreground", + "content": "quick/", + "enabled": true + }, "hideui:q91d7": { "fill": "$--foreground", - "content": "quick/155-browser-display", - "fontWeight": "500" + "content": "155-browser-display", + "fontWeight": "normal" }, "hideui:checkout-status": { "fill": "$--secondary", @@ -31474,7 +31516,7 @@ "ref": "hideui:DLP27", "name": "quick/154-search-palette", "width": 284, - "height": 44, + "height": 48, "padding": [ 0, 4, @@ -31486,10 +31528,15 @@ "fill": "$--pr-draft", "icon": "git-pull-request-draft" }, + "hideui:checkout-name-prefix": { + "fill": "$--muted-foreground", + "content": "quick/", + "enabled": true + }, "hideui:q91d7": { "fill": "$--foreground", - "content": "quick/154-search-palette", - "fontWeight": "500" + "content": "154-search-palette", + "fontWeight": "normal" }, "hideui:checkout-status": { "fill": "$--secondary", @@ -31592,7 +31639,7 @@ "ref": "hideui:DLP27", "name": "electron-shortcut-bindings", "width": 284, - "height": 44, + "height": 48, "padding": [ 0, 4, @@ -31604,10 +31651,14 @@ "fill": "$--pr-open", "icon": "git-pull-request" }, + "hideui:checkout-name-prefix": { + "fill": "$--muted-foreground", + "enabled": false + }, "hideui:q91d7": { "fill": "$--foreground", "content": "electron-shortcut-bindings", - "fontWeight": "500" + "fontWeight": "normal" }, "hideui:checkout-status": { "fill": "$--secondary", @@ -31710,7 +31761,7 @@ "ref": "hideui:DLP27", "name": "design/workspace-ux-prop…", "width": 284, - "height": 44, + "height": 48, "padding": [ 0, 4, @@ -31722,10 +31773,15 @@ "fill": "$--subtle-foreground", "icon": "git-branch" }, + "hideui:checkout-name-prefix": { + "fill": "$--muted-foreground", + "content": "design/", + "enabled": true + }, "hideui:q91d7": { "fill": "$--foreground", - "content": "design/workspace-ux-prop…", - "fontWeight": "500" + "content": "workspace-ux-prop…", + "fontWeight": "normal" }, "hideui:checkout-status": { "fill": "$--secondary", @@ -31809,7 +31865,7 @@ "ref": "hideui:DLP27", "name": "fix/registered-projects-only", "width": 284, - "height": 36, + "height": 32, "padding": [ 0, 4, @@ -31821,10 +31877,15 @@ "fill": "$--subtle-foreground", "icon": "git-branch" }, + "hideui:checkout-name-prefix": { + "fill": "$--muted-foreground", + "content": "fix/", + "enabled": true + }, "hideui:q91d7": { "fill": "$--foreground", - "content": "fix/registered-projects-only", - "fontWeight": "500" + "content": "registered-projects-only", + "fontWeight": "normal" }, "hideui:checkout-status": { "fill": "$--secondary", @@ -31907,7 +31968,7 @@ "ref": "hideui:DLP27", "name": "legacy-shell", "width": 284, - "height": 36, + "height": 32, "padding": [ 0, 4, @@ -31919,10 +31980,14 @@ "fill": "$--destructive", "icon": "git-branch" }, + "hideui:checkout-name-prefix": { + "fill": "$--muted-foreground", + "enabled": false + }, "hideui:q91d7": { "fill": "$--foreground", "content": "legacy-shell", - "fontWeight": "500" + "fontWeight": "normal" }, "hideui:checkout-status": { "fill": "$--secondary", @@ -32414,28 +32479,37 @@ } }, { - "type": "frame", "id": "psb-sec-pin-d", - "name": "Section", - "children": [ - { - "type": "text", - "id": "psb-sec-pin-d-t", - "name": "PINNED · 1", - "content": "PINNED · 1", - "fill": "$--muted-foreground", - "fontFamily": "$--font-ui", - "fontSize": "$--text-micro", - "fontWeight": "600" - } - ], + "type": "ref", + "ref": "hideui:O79KF", + "name": "Pinned · 1", "width": 284, "padding": [ "$--spacing-sm", "$--spacing-sm", "$--spacing-xxs", "$--spacing-sm" - ] + ], + "descendants": { + "hideui:nOk00": { + "fill": "$--muted-foreground" + }, + "hideui:VOd6D": { + "fill": "$--muted-foreground", + "content": "Pinned · 1" + }, + "hideui:rVsKB": { + "fill": "$--muted-foreground", + "enabled": false + }, + "hideui:g7fzt": { + "fill": "$--muted-foreground", + "enabled": false + }, + "hideui:eK6gz": { + "enabled": false + } + } }, { "id": "psb-p-notes-d", @@ -32443,7 +32517,7 @@ "ref": "hideui:DLP27", "name": "team-notes", "width": 284, - "height": 44, + "height": 48, "padding": [ 0, 4, @@ -32455,10 +32529,14 @@ "fill": "$--subtle-foreground", "icon": "folder" }, + "hideui:checkout-name-prefix": { + "fill": "$--muted-foreground", + "enabled": false + }, "hideui:q91d7": { "fill": "$--foreground", "content": "team-notes", - "fontSize": "$--text-title", + "fontSize": "$--text-subhead", "fontWeight": "600" }, "hideui:checkout-status": { @@ -32556,28 +32634,37 @@ } }, { - "type": "frame", "id": "psb-sec-recent-d", - "name": "Section", - "children": [ - { - "type": "text", - "id": "psb-sec-recent-d-t", - "name": "PROJECTS · RECENT ACTIVITY ·", - "content": "PROJECTS · RECENT ACTIVITY · 5", - "fill": "$--muted-foreground", - "fontFamily": "$--font-ui", - "fontSize": "$--text-micro", - "fontWeight": "600" - } - ], + "type": "ref", + "ref": "hideui:O79KF", + "name": "Projects · Recent activity · 5", "width": 284, "padding": [ "$--spacing-sm", "$--spacing-sm", "$--spacing-xxs", "$--spacing-sm" - ] + ], + "descendants": { + "hideui:nOk00": { + "fill": "$--muted-foreground" + }, + "hideui:VOd6D": { + "fill": "$--muted-foreground", + "content": "Projects · Recent activity · 5" + }, + "hideui:rVsKB": { + "fill": "$--muted-foreground", + "enabled": false + }, + "hideui:g7fzt": { + "fill": "$--muted-foreground", + "enabled": false + }, + "hideui:eK6gz": { + "enabled": false + } + } }, { "id": "psb-p-herdr-d", @@ -32675,7 +32762,7 @@ "ref": "hideui:DLP27", "name": "Overview", "width": 284, - "height": 36, + "height": 32, "padding": [ 0, 4, @@ -32688,10 +32775,14 @@ "fill": "$--subtle-foreground", "icon": "layout-dashboard" }, + "hideui:checkout-name-prefix": { + "fill": "$--muted-foreground", + "enabled": false + }, "hideui:q91d7": { "fill": "$--foreground", "content": "Overview", - "fontWeight": "600" + "fontWeight": "500" }, "hideui:checkout-status": { "fill": "$--secondary", @@ -32778,7 +32869,7 @@ "ref": "hideui:DLP27", "name": "main", "width": 284, - "height": 44, + "height": 48, "padding": [ 0, 4, @@ -32790,10 +32881,14 @@ "fill": "$--subtle-foreground", "icon": "house" }, + "hideui:checkout-name-prefix": { + "fill": "$--muted-foreground", + "enabled": false + }, "hideui:q91d7": { "fill": "$--foreground", "content": "main", - "fontWeight": "500" + "fontWeight": "normal" }, "hideui:checkout-status": { "fill": "$--secondary", @@ -33380,8 +33475,7 @@ }, "hideui:sar-title": { "fill": "$--foreground", - "content": "배포 전 확인", - "fontWeight": "500" + "content": "배포 전 확인" }, "hideui:sar-branch": { "fill": "$--secondary", @@ -33440,6 +33534,10 @@ ], "width": 284, "layout": "vertical", + "padding": [ + "$--spacing-xs", + 0 + ], "fill": "$--muted", "cornerRadius": "$--radius-sm" }, @@ -33449,7 +33547,7 @@ "ref": "hideui:DLP27", "name": "quick/155-browser-display", "width": 284, - "height": 44, + "height": 48, "padding": [ 0, 4, @@ -33461,10 +33559,15 @@ "fill": "$--subtle-foreground", "icon": "git-branch" }, + "hideui:checkout-name-prefix": { + "fill": "$--muted-foreground", + "content": "quick/", + "enabled": true + }, "hideui:q91d7": { "fill": "$--foreground", - "content": "quick/155-browser-display", - "fontWeight": "500" + "content": "155-browser-display", + "fontWeight": "normal" }, "hideui:checkout-status": { "fill": "$--secondary", @@ -33567,7 +33670,7 @@ "ref": "hideui:DLP27", "name": "quick/154-search-palette", "width": 284, - "height": 44, + "height": 48, "padding": [ 0, 4, @@ -33579,10 +33682,15 @@ "fill": "$--pr-draft", "icon": "git-pull-request-draft" }, + "hideui:checkout-name-prefix": { + "fill": "$--muted-foreground", + "content": "quick/", + "enabled": true + }, "hideui:q91d7": { "fill": "$--foreground", - "content": "quick/154-search-palette", - "fontWeight": "500" + "content": "154-search-palette", + "fontWeight": "normal" }, "hideui:checkout-status": { "fill": "$--secondary", @@ -33685,7 +33793,7 @@ "ref": "hideui:DLP27", "name": "electron-shortcut-bindings", "width": 284, - "height": 44, + "height": 48, "padding": [ 0, 4, @@ -33697,10 +33805,14 @@ "fill": "$--pr-open", "icon": "git-pull-request" }, + "hideui:checkout-name-prefix": { + "fill": "$--muted-foreground", + "enabled": false + }, "hideui:q91d7": { "fill": "$--foreground", "content": "electron-shortcut-bindings", - "fontWeight": "500" + "fontWeight": "normal" }, "hideui:checkout-status": { "fill": "$--secondary", @@ -33803,7 +33915,7 @@ "ref": "hideui:DLP27", "name": "design/workspace-ux-prop…", "width": 284, - "height": 44, + "height": 48, "padding": [ 0, 4, @@ -33815,10 +33927,15 @@ "fill": "$--subtle-foreground", "icon": "git-branch" }, + "hideui:checkout-name-prefix": { + "fill": "$--muted-foreground", + "content": "design/", + "enabled": true + }, "hideui:q91d7": { "fill": "$--foreground", - "content": "design/workspace-ux-prop…", - "fontWeight": "500" + "content": "workspace-ux-prop…", + "fontWeight": "normal" }, "hideui:checkout-status": { "fill": "$--secondary", @@ -33902,7 +34019,7 @@ "ref": "hideui:DLP27", "name": "fix/registered-projects-only", "width": 284, - "height": 36, + "height": 32, "padding": [ 0, 4, @@ -33914,10 +34031,15 @@ "fill": "$--subtle-foreground", "icon": "git-branch" }, + "hideui:checkout-name-prefix": { + "fill": "$--muted-foreground", + "content": "fix/", + "enabled": true + }, "hideui:q91d7": { "fill": "$--foreground", - "content": "fix/registered-projects-only", - "fontWeight": "500" + "content": "registered-projects-only", + "fontWeight": "normal" }, "hideui:checkout-status": { "fill": "$--secondary", @@ -34000,7 +34122,7 @@ "ref": "hideui:DLP27", "name": "legacy-shell", "width": 284, - "height": 36, + "height": 32, "padding": [ 0, 4, @@ -34012,10 +34134,14 @@ "fill": "$--destructive", "icon": "git-branch" }, + "hideui:checkout-name-prefix": { + "fill": "$--muted-foreground", + "enabled": false + }, "hideui:q91d7": { "fill": "$--foreground", "content": "legacy-shell", - "fontWeight": "500" + "fontWeight": "normal" }, "hideui:checkout-status": { "fill": "$--secondary", @@ -34367,4 +34493,4 @@ "y": 0 } ] -} +} \ No newline at end of file diff --git a/design/hide-ui.lib.pen b/design/hide-ui.lib.pen index efe3163beb..a8de79f75c 100644 --- a/design/hide-ui.lib.pen +++ b/design/hide-ui.lib.pen @@ -4339,9 +4339,9 @@ { "type": "text", "id": "fnd-size-set-size-checkout-row-value", - "name": "36", + "name": "32", "fill": "$--muted-foreground", - "content": "36", + "content": "32", "fontFamily": "$--font-mono", "fontSize": "$--text-micro", "fontWeight": "normal", @@ -5591,7 +5591,7 @@ "fill": "$--subtle-foreground", "textGrowth": "fixed-width", "width": "fill_container", - "content": "11/600 secondary label, count in micro mono muted, inset --spacing-md, pad-top --spacing-md, pad-bottom --spacing-sm. Title case; the chevron is drawn only where the section collapses.", + "content": "10/500 label in sentence case, count in micro mono muted, inset --spacing-md, pad-top --spacing-md, pad-bottom --spacing-sm. The chevron is drawn only where the section collapses.", "fontFamily": "$--font-ui", "fontSize": "$--text-caption", "fontWeight": "normal" @@ -5665,8 +5665,8 @@ "fill": "$--subtle-foreground", "content": "Uncommitted", "fontFamily": "$--font-ui", - "fontSize": "$--text-body", - "fontWeight": "600" + "fontSize": "$--text-micro", + "fontWeight": "500" }, { "type": "text", @@ -12232,7 +12232,7 @@ "fill": "$--subtle-foreground", "textGrowth": "fixed-width", "width": "fill_container", - "content": "sidebar.tsx WorkspaceRows: the project glyph and name read on the left; the status badge and the fold end the row, a step apart, so the badge ends on the column every row’s time ends on. The badge counts the agents of every checkout under the mark each agent’s own row draws, worst first (× ! ? ● ✓ ○), and stays while the checkouts are open because it is the project’s own summary; a project with no agent draws none. The row carries no time. A folded chevron is always shown; an unfolded one shows under the pointer, with keyboard focus in the row, while its menu is open, and always on an input with no hover. The name opens the Overview; a right-click, or the menu key or ⇧F10 on the focused row, opens the row’s menu, which nothing on the row stands for.", + "content": "sidebar.tsx WorkspaceRows: the project glyph and name read on the left, the name at 13/600, the sidebar’s one semibold, on a 36 row; the status badge and the fold end the row, a step apart, so the badge ends on the column every row’s time ends on. The badge counts the agents of every checkout under the mark each agent’s own row draws, worst first (× ! ? ● ✓ ○), and stays while the checkouts are open because it is the project’s own summary; a project with no agent draws none. The row carries no time. A folded chevron is always shown; an unfolded one shows under the pointer, with keyboard focus in the row, while its menu is open, and always on an input with no hover. The name opens the Overview; a right-click, or the menu key or ⇧F10 on the focused row, opens the row’s menu, which nothing on the row stands for. All projects is this row with its count at 12 where the badge stands.", "fontFamily": "$--font-ui", "fontSize": "$--text-subhead", "fontWeight": "normal" @@ -12281,7 +12281,7 @@ "fill": "$--foreground", "content": "sasu", "fontFamily": "$--font-ui", - "fontSize": "$--text-title", + "fontSize": "$--text-subhead", "fontWeight": "600" }, { @@ -12577,7 +12577,7 @@ "fill": "$--muted-foreground", "content": "12 projects", "fontFamily": "$--font-ui", - "fontSize": "$--text-caption", + "fontSize": "$--text-body", "fontWeight": "normal", "enabled": false }, @@ -14031,7 +14031,7 @@ "fill": "$--subtle-foreground", "textGrowth": "fixed-width", "width": "fill_container", - "content": "sidebar.tsx CheckoutRowView: the kind glyph and the name read on the left. While its agent rows are folded, line one ends in the status badge, which counts them under the mark each row draws, then the fold slot, whose chevron is there only while agents run; opening them takes the badge away, since their own marks now speak, and changes nothing else on the row. Line two is the purpose, and the last-commit age ends it on the column every row’s time ends on; a row with agents keeps line two before a purpose is known, and a row with neither a purpose nor agents is one line with its age there. Nothing moves on hover or while the right-click menu is open. An opened checkout and its agent rows share one small group fill.", + "content": "sidebar.tsx CheckoutRowView: the kind glyph and the name read on the left, 12/400 (500 while its Workspace is in front) with the path prefix up to the first slash muted. While its agent rows are folded, line one ends in the status badge, which counts them under the mark each row draws, then the fold slot, whose chevron is there only while agents run; opening them takes the badge away, since their own marks now speak, and changes nothing else on the row. Line two is the purpose, 11 on a 16 line, and the last-commit age ends it on the column every row’s time ends on; a row without a purpose is one line, 32 high, with its age there, and a row with one is 48. Nothing moves on hover or while the right-click menu is open. An opened checkout and its agent rows share one small group fill with 4 inside above and below.", "fontFamily": "$--font-ui", "fontSize": "$--text-caption", "fontWeight": "normal" @@ -14059,7 +14059,7 @@ { "type": "frame", "id": "DLP27", - "name": "Component / Checkout row (36 or 44)", + "name": "Component / Checkout row (32 or 48)", "reusable": true, "width": "fill_container", "layout": "vertical", @@ -14098,14 +14098,32 @@ "fill": "$--pr-open" }, { - "type": "text", - "id": "q91d7", - "name": "Checkout name", - "fill": "$--foreground", - "content": "prd/browser-like-panes", - "fontFamily": "$--font-ui", - "fontSize": "$--text-subhead", - "fontWeight": "500" + "type": "frame", + "id": "checkout-name", + "name": "Name", + "alignItems": "center", + "children": [ + { + "type": "text", + "id": "checkout-name-prefix", + "name": "Path prefix", + "fill": "$--muted-foreground", + "content": "prd/", + "fontFamily": "$--font-ui", + "fontSize": "$--text-body", + "fontWeight": "normal" + }, + { + "type": "text", + "id": "q91d7", + "name": "Checkout name", + "fill": "$--foreground", + "content": "browser-like-panes", + "fontFamily": "$--font-ui", + "fontSize": "$--text-body", + "fontWeight": "normal" + } + ] }, { "id": "TS5x9", @@ -14507,7 +14525,8 @@ } ] } - ] + ], + "height": 16 } ], "cornerRadius": "$--radius-sm" @@ -14537,7 +14556,15 @@ "type": "ref", "ref": "DLP27", "name": "Row / Collapsed with purpose", - "width": "fill_container" + "width": "fill_container", + "descendants": { + "checkout-name-prefix": { + "content": "prd/" + }, + "q91d7": { + "content": "browser-like-panes" + } + } } ] }, @@ -14571,6 +14598,12 @@ }, "checkout-status": { "enabled": false + }, + "checkout-name-prefix": { + "content": "prd/" + }, + "q91d7": { + "content": "browser-like-panes" } } } @@ -14602,7 +14635,7 @@ "width": "fill_container", "descendants": { "q91d7": { - "content": "chore/pr-template" + "content": "pr-template" }, "checkout-status": { "enabled": false @@ -14615,6 +14648,9 @@ }, "line2-age": { "content": "2d" + }, + "checkout-name-prefix": { + "content": "chore/" } } } @@ -14644,10 +14680,10 @@ "name": "Row / One line", "ref": "DLP27", "width": "fill_container", - "height": 36, + "height": 32, "descendants": { "q91d7": { - "content": "fix/registered-projects-only" + "content": "registered-projects-only" }, "checkout-status": { "enabled": false @@ -14661,6 +14697,9 @@ }, "o6XLUj": { "enabled": false + }, + "checkout-name-prefix": { + "content": "fix/" } } } @@ -14709,6 +14748,9 @@ }, "o6XLUj": { "enabled": false + }, + "checkout-name-prefix": { + "enabled": false } } } @@ -14739,8 +14781,15 @@ "width": "fill_container", "name": "Row / Hover", "fill": "$--accent", - "height": 44, - "descendants": {} + "height": 48, + "descendants": { + "checkout-name-prefix": { + "content": "prd/" + }, + "q91d7": { + "content": "browser-like-panes" + } + } } ] }, @@ -14771,8 +14820,15 @@ "stroke": "$--ring", "strokeWidth": 1, "strokeAlignment": "inner", - "height": 44, - "descendants": {} + "height": 48, + "descendants": { + "checkout-name-prefix": { + "content": "prd/" + }, + "q91d7": { + "content": "browser-like-panes" + } + } } ] }, @@ -14801,8 +14857,15 @@ "width": "fill_container", "name": "Row / Menu open", "fill": "$--accent", - "height": 44, - "descendants": {} + "height": 48, + "descendants": { + "checkout-name-prefix": { + "content": "prd/" + }, + "q91d7": { + "content": "browser-like-panes" + } + } } ] }, @@ -14831,14 +14894,14 @@ "width": "fill_container", "name": "Row / Selected", "fill": "$--secondary", - "height": 36, + "height": 32, "descendants": { "o6XLUj": { "enabled": false }, "q91d7": { "content": "main", - "fontWeight": "600" + "fontWeight": "500" }, "VtSRn": { "icon": "house", @@ -14853,6 +14916,9 @@ }, "IXwZI": { "opacity": 0 + }, + "checkout-name-prefix": { + "enabled": false } } } @@ -14891,7 +14957,7 @@ "ref": "DLP27", "width": "fill_container", "name": "Row / Opened", - "height": 44, + "height": 48, "descendants": { "q91d7": { "content": "main" @@ -14914,6 +14980,9 @@ }, "line2-age": { "content": "12m" + }, + "checkout-name-prefix": { + "enabled": false } } }, @@ -14965,7 +15034,7 @@ "id": "sidebar-agent-row-spec", "name": "Spec", "fill": "$--subtle-foreground", - "content": "sidebar-agent-row.tsx SidebarAgentRow, in Agents and under a checkout in Projects: the status mark, the provider, the title, a branch chip only for a child whose checkout differs from its parent, the device chip, the descendant badge while folded, the elapsed time that is always shown, and the fold slot every row keeps, its chevron drawn only on a parent, so every row's time and chevron share one column each. A request or news has its own line from the start, a quiet sentence is only in the tooltip, and Agents adds a fixed context line. Hover, focus and selection change a fill and a ring, never a height.", + "content": "sidebar-agent-row.tsx SidebarAgentRow, in Agents and under a checkout in Projects: the status mark, the provider, the title at 12/400 in every state (attention and selection brighten it, never thicken it), a branch chip only for a child whose checkout differs from its parent, the device chip, the descendant badge while folded, the elapsed time at 11 that is always shown, and the fold slot every row keeps, its chevron drawn only on a parent, so every row's time and chevron share one column each. Line one is 20 high; a request or news has its own 16 line from the start, so a row is 28 or 44; a quiet sentence is only in the tooltip, and Agents adds a fixed context line. Hover, focus and selection change a fill and a ring, never a height.", "fontFamily": "$--font-ui", "fontSize": "$--text-subhead", "fontWeight": "normal", @@ -14990,7 +15059,7 @@ "type": "frame", "id": "sar-marks", "name": "Marks", - "height": 24, + "height": 20, "gap": "$--spacing-xs", "alignItems": "center", "children": [ @@ -15066,7 +15135,7 @@ "id": "sar-line1", "name": "Line 1", "width": "fill_container", - "height": 24, + "height": 20, "gap": "$--spacing-xs", "alignItems": "center", "children": [ @@ -15174,7 +15243,7 @@ "fill": "$--muted-foreground", "content": "3m", "fontFamily": "$--font-mono", - "fontSize": "$--text-micro", + "fontSize": "$--text-caption", "fontWeight": "normal" }, { @@ -15182,7 +15251,7 @@ "id": "sar-fold", "name": "Fold slot", "width": 16, - "height": 24, + "height": 20, "justifyContent": "center", "alignItems": "center", "children": [ @@ -15210,7 +15279,10 @@ "fontFamily": "$--font-ui", "fontSize": "$--text-caption", "fontWeight": "normal", - "enabled": false + "enabled": false, + "textGrowth": "fixed-width-height", + "width": "fill_container", + "height": 16 }, { "type": "text", @@ -15221,7 +15293,10 @@ "fontFamily": "$--font-ui", "fontSize": "$--text-caption", "fontWeight": "normal", - "enabled": false + "enabled": false, + "textGrowth": "fixed-width-height", + "width": "fill_container", + "height": 16 } ] } @@ -15240,7 +15315,7 @@ "id": "sidebar-agent-row-state-rest-label", "name": "State name", "fill": "$--subtle-foreground", - "content": "Seen at rest (32)", + "content": "Seen at rest (28)", "fontFamily": "$--font-ui", "fontSize": "$--text-caption", "fontWeight": "normal" @@ -15311,8 +15386,7 @@ "fill": "$--secondary", "descendants": { "sar-title": { - "fill": "$--foreground", - "fontWeight": "500" + "fill": "$--foreground" } } } @@ -15433,8 +15507,7 @@ }, "sar-title": { "content": "Electron포팅지침이행", - "fill": "$--foreground", - "fontWeight": "500" + "fill": "$--foreground" }, "sar-line": { "enabled": true, @@ -15486,8 +15559,7 @@ }, "sar-title": { "content": "구현 범위 확인", - "fill": "$--foreground", - "fontWeight": "500" + "fill": "$--foreground" }, "sar-line": { "enabled": true @@ -15586,8 +15658,7 @@ }, "sar-title": { "content": "테스트 실행 실패", - "fill": "$--foreground", - "fontWeight": "500" + "fill": "$--foreground" }, "sar-line": { "enabled": true, @@ -15892,8 +15963,7 @@ }, "sar-title": { "content": "배포 승인 요청", - "fill": "$--foreground", - "fontWeight": "500" + "fill": "$--foreground" }, "sar-line": { "enabled": true, @@ -33643,10 +33713,6 @@ "type": "number", "value": 24 }, - "--size-control-regular": { - "type": "number", - "value": 36 - }, "--size-checkbox": { "type": "number", "value": 16 @@ -33683,10 +33749,6 @@ "type": "number", "value": 18 }, - "--size-compact-agent-leading-inset": { - "type": "number", - "value": 13 - }, "--size-compact-agent-row-vpad": { "type": "number", "value": 5 @@ -33697,7 +33759,7 @@ }, "--size-checkout-row": { "type": "number", - "value": 36 + "value": 32 }, "--size-checkout-icon": { "type": "number", @@ -33989,7 +34051,7 @@ }, "--size-checkout-row-detailed": { "type": "number", - "value": 44 + "value": 48 }, "--size-overview-group-header": { "type": "number", @@ -34696,6 +34758,18 @@ "--size-gallery-scene-h": { "type": "number", "value": 880 + }, + "--size-project-row": { + "type": "number", + "value": 36 + }, + "--size-sidebar-line": { + "type": "number", + "value": 20 + }, + "--size-sidebar-line-detail": { + "type": "number", + "value": 16 } }, "fileToken": "61e6a599-bafe-4c87-80e7-10732d9e7fe4", diff --git a/design/review-targets.json b/design/review-targets.json index 70479a015b..c937d8586f 100644 --- a/design/review-targets.json +++ b/design/review-targets.json @@ -12,8 +12,7 @@ "conditions": { "themes": ["light", "dark"], "widths": [292, 240], - "contents": ["reference", "long"], - "scales": [1, 1.25] + "contents": ["reference", "long"] }, "states": { "rest": "No pointer on the list and no keyboard focus.", diff --git a/design/tokens.json b/design/tokens.json index 41a55f59bc..b68f3b09da 100644 --- a/design/tokens.json +++ b/design/tokens.json @@ -608,10 +608,6 @@ "type": "number", "value": 24 }, - "--size-control-regular": { - "type": "number", - "value": 36 - }, "--size-checkbox": { "type": "number", "value": 16 @@ -634,11 +630,23 @@ }, "--size-checkout-row": { "type": "number", - "value": 36 + "value": 32 }, "--size-checkout-row-detailed": { "type": "number", - "value": 44 + "value": 48 + }, + "--size-project-row": { + "type": "number", + "value": 36 + }, + "--size-sidebar-line": { + "type": "number", + "value": 20 + }, + "--size-sidebar-line-detail": { + "type": "number", + "value": 16 }, "--size-overview-group-header": { "type": "number", @@ -748,10 +756,6 @@ "type": "number", "value": 13 }, - "--size-compact-agent-leading-inset": { - "type": "number", - "value": 13 - }, "--size-compact-agent-row-vpad": { "type": "number", "value": 5 diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md index f05f5f9665..530653e79c 100644 --- a/docs/ARCHITECTURE.md +++ b/docs/ARCHITECTURE.md @@ -357,7 +357,7 @@ Closing follows one flow in `web/src/close.ts`: an unknown activity status asks ### Settings and workspace management in the web shell -Settings (`web/src/SettingsSheet.tsx`, rules in `web/src/settings.ts`) opens from the sidebar's gear or ⌥: General reads the `daemon` frame and `status.{herdr,environment,diagnostics}`, Appearance writes `accent_hex` and `font_size` through `ui_state_update`, Agents reads `status.{background_ai,agent_hooks}` and sends `ai_settings` and `install_agent_hooks`, Devices sends `register_device` (with the helper consent the add form asks for and an optional device Herdr socket), `device_host_consent`, `device_host_retry`, `test_device`, `retry_connect`, `focus_device` and `remove_device` (the sidebar's device switcher sends `focus_device` too), Performance sends `agent_sleep_set` (`after_hours`: null for Never, 12, 24 or 72) and counts this machine's sleeping agents from the navigator, and Shortcuts writes the running host's own set (`browser_shortcut_bindings` in a browser, `shortcut_bindings` in the desktop app). +Settings (`web/src/SettingsSheet.tsx`, rules in `web/src/settings.ts`) opens from the sidebar's gear or ⌥: General reads the `daemon` frame and `status.{herdr,environment,diagnostics}`, Appearance writes `accent_hex` and `font_size` through `ui_state_update` (the sidebar's right edge writes `sidebar_width` the same way, 220 to 440, a value outside refused into the diagnostic log), Agents reads `status.{background_ai,agent_hooks}` and sends `ai_settings` and `install_agent_hooks`, Devices sends `register_device` (with the helper consent the add form asks for and an optional device Herdr socket), `device_host_consent`, `device_host_retry`, `test_device`, `retry_connect`, `focus_device` and `remove_device` (the sidebar's device switcher sends `focus_device` too), Performance sends `agent_sleep_set` (`after_hours`: null for Never, 12, 24 or 72) and counts this machine's sleeping agents from the navigator, and Shortcuts writes the running host's own set (`browser_shortcut_bindings` in a browser, `shortcut_bindings` in the desktop app). Every row shows what the snapshot says; an edit is pending until the snapshot carries it, and a refusal is matched to the edit by the core's `last_error` kind and time. Every page names the daemon's machine (`host_name`) as the owner of what it stores - appearance, shortcuts, Background AI, hooks and the device list - and says, while a device is selected, that selecting it changes where files, Git and panes run and not where those values live (PRD S5.5 B35); the Agents page then says that hooks and AI settings for the device's agents are set up by Hide on that machine and are never copied or installed over SSH (B37). A device row shows only what that device reported (its Herdr version, its helper's platform, and the staged connection test's SSH, auth, Herdr, protocol, PTY, SFTP and Git results), and a refused connection names its step (`problem`: `host_key_changed`, `host_key_unknown` or `authentication`, read off the core's own known_hosts and sign-in words by `remote::connection_problem`) with the action it needs; Hide never edits known_hosts or asks for a password (B36, B38). @@ -367,7 +367,7 @@ Copy diagnostics carries versions, paths, states and the core's recent diagnosti `remove_device` removes Hide's own record of a device and nothing on it (PRD S5.5 B26): its registration, its project registrations and pins, its expanded folders, its open file tabs and its closed items go, while its host, Herdr server, panes, agents and folders are left as they are; a dirty tab closed this way leaves its draft in the browser, where a draft no tab stands for is offered to export or discard, and the confirmation counts the projects, tabs and drafts before anything is removed. Before `remove_device` is sent the page writes every draft of that device's tabs it still has queued, and a draft that could not be stored (B44) holds the removal: the confirmation names it until it is saved or exported (Export releases exactly the text it downloaded, so a later edit holds the removal again, and the confirmation then says that draft leaves only as the exported file, because the page cannot confirm the download was kept), since closing its tab would lose it; once the drafts are being stored the removal can no longer be kept from the dialog. The web's `ui_state_update` echo omits `workspace_registrations` and `device_registrations`, which their own events own, so a stale echo can never undo a registration. -The accent swatches read the `--color-accent-choice-*` tokens; the chosen value replaces `--color-accent`, and `font_size` scales the interface text tokens through `--interface-scale` while the terminal and editor sizes stay their own. +The accent swatches read the `--color-accent-choice-*` tokens; the chosen value replaces `--color-accent`, and `font_size` scales the interface text tokens through `--interface-scale` while the terminal and editor sizes stay their own, and so does the sidebar: its nav carries the generated `.interface-scale-exempt` rule, which declares the text tokens again at scale 1, because a custom property resolves where it is declared and setting `--interface-scale` on the nav alone would change nothing. The sidebar's project and checkout rows open a menu on a right-click, or the menu key or ⇧F10 on the focused row (`EntryContextMenu` in `web/src/components/entry-menu.tsx`, rules in `web/src/workspaceManage.ts`): Pin/Unpin and Remove project for a registered project on any device, New worktree for a Git project on any device, a purpose for any checkout, and deletion for a linked worktree whose gate allows it on any device; an action a row cannot use is drawn disabled with its reason. The dialogs (`web/src/WorkspaceDialogs.tsx`) send `create_worktree`, `set_checkout_purpose` and `remove_worktree` and read only the receipt for their own request (`task_operation` by kind, id and target; `worktree_removal` by checkout and id), so another page's or an older request's answer is never shown as theirs. diff --git a/docs/DESIGN_WORKFLOW.md b/docs/DESIGN_WORKFLOW.md index 408361c7d6..a18d02e4a1 100644 --- a/docs/DESIGN_WORKFLOW.md +++ b/docs/DESIGN_WORKFLOW.md @@ -28,7 +28,7 @@ It is excluded from the production build `hided` serves. The gallery also renders production screens on synthetic scenes, one document per scene because a scene seeds the app's own stores. `/gallery?scene=projects-sidebar` is the shell's real `Sidebar` and `createActions` over `web/src/gallery/sceneData.ts`, a snapshot with the content `Screen / Projects Sidebar` draws; its folds go through the real actions and the scene answers them as the core would. -Its query takes `theme` (`light`, `dark`), `width` (the sidebar's CSS width), `scale` (the interface text scale) and `content` (`reference`, or `long` for long Korean titles). +Its query takes `theme` (`light`, `dark`), `width` (the sidebar's CSS width, seeded as the core's `ui_state.sidebar_width`), `scale` (the interface text scale, which reaches only what lies outside the sidebar, since the sidebar keeps its sizes at every scale) and `content` (`reference`, or `long` for long Korean titles). Every name, path and count in a scene is invented example data, so a capture of it is safe to publish. ## The flow: scratch to one PR @@ -103,7 +103,7 @@ One run, in this order, with each step's real result in `agents/runs//desi 2. The current Pen: the bundle's nodes exported from the target's Pen file in this checkout, so a proposal bundle is set against what the checkout now carries. 3. The production screen: the command starts its own Vite dev server and headless Chromium, opens the target's gallery scene under each selected condition, and measures the bundle's rules there through `web/e2e/sidebar-geometry.mjs`, the same geometry the e2e specs assert on. The rules are the bundle's, never values read back from the code under review: `childIndentPx` (a child's status mark and title start that many pixels per level right of its list's roots), `rootsAligned`, `stableUnderHover` and `stableUnderFocus` (no row moves or resizes while any one row is hovered or keyboard-focused), `noOverlap` (no part of a row overlaps another or runs past the row, no text spills), `sharedColumns` (one column for every time and badge end, one for every chevron) and `noSidewaysOverflow`. -4. Comparisons: for each bundle frame, the reference, the current Pen and the actual screen side by side, captured under that frame's width, theme, text scale, content and state and labelled with them; an image whose width is not the frame's is reported as a different condition, never scaled to look alike. +4. Comparisons: for each bundle frame, the reference, the current Pen and the actual screen side by side, captured under that frame's width, theme, text scale, content and state (a target without `scales` in its conditions is measured at scale 1, as `projects-sidebar` is, because the sidebar does not follow the scale) and labelled with them; an image whose width is not the frame's is reported as a different condition, never scaled to look alike. 5. State sheets: every selected condition and state no Pen frame draws (a narrow width, a larger text size, long titles, hover, focus, a folded parent, a closed checkout) as captures of the actual screen only, labelled as such. The exit status is 0 for PASS, 1 for FAIL (the static contract or a rule failed) and 3 for INCOMPLETE: a missing Pen or Pen login, a node Pen did not export, a bundle file that no longer matches its hash, or a browser step that did not finish. diff --git a/docs/UI_BEHAVIOR.md b/docs/UI_BEHAVIOR.md index ca94ae05d4..ab8b820d7f 100644 --- a/docs/UI_BEHAVIOR.md +++ b/docs/UI_BEHAVIOR.md @@ -217,7 +217,8 @@ Its second line exists only when the row has something to say, and from the mome A quiet sentence is never drawn on the row; the row's tooltip carries it with the full title. In Agents a root row adds a fixed context line naming its project and checkout (`project › checkout`, the project alone for a plain folder), since the list does not otherwise say where the agent works; a row under a checkout in Projects has none, because the rows above it say it. Hover, keyboard focus, selection and an open badge list change a fill, a ring and a chevron's opacity only; they never add a line or change a row's height, so the row below never moves. -A row's height is a minimum, not a cap: at a larger interface font a row grows to hold its lines rather than letting them run into the next row, and it still holds still under hover and focus at that size. +A sidebar agent row is 28 high, or 44 with its second line: line one is 20 and line two 16, and the title is 12/400 in every state, a change brightening it rather than thickening it. +A row's height is a minimum, not a cap: a row grows to hold its lines rather than letting them run into the next row, and it still holds still under hover and focus. No row draws a progress number or step the agent did not report. The Project Overview's agent rows keep their own density: a quiet sentence is revealed on the selected or hovered row over up to two lines, with the whole of it in the tooltip. Web owner: `web/src/agentRow.ts` (rules, reusable by any list of agents), `web/src/components/sidebar-agent-row.tsx` (the sidebar row), `web/src/components/agent-row.tsx` (the Overview row and the descendant badge both draw), `web/src/components/agent-children-popover.tsx`. @@ -418,6 +419,17 @@ The text that results is ordinary Markdown, with nothing hidden or special in it Core owner: `herdr-core/src/sidebar.rs`, `herdr-core/src/project_context.rs`, `herdr-core/src/worktrees.rs`, `herdr-core/src/disk.rs`, `herdr-core/src/worktree_cleanup.rs`, `herdr-core/src/runtime/projects.rs`. Web owner: `web/src/sidebar.tsx`, `web/src/projects.ts`. +### Sidebar type, rows and width + +The sidebar sets its words on three sizes: a project name 13/600, a checkout name, an agent title and a count 12/400, and a second line and a time 11; a section header is 10/500 in sentence case (`Projects · Recent activity · 5`). +A project row, All projects and a one-line plain folder are 36 high, a checkout row 32 or 48 with its second line, an agent row 28 or 44. +A checkout name mutes its prefix up to and including the first slash (`prd/`), so the part that tells checkouts apart reads first; a name with no slash, or one that starts or ends with it, has no prefix. +The checkout whose Workspace is in front turns its name 500 and nothing else about the row. +The sidebar keeps these sizes at every Appearance font size, because its rows are scanned, not read; the font size scales the rest of the interface. +The sidebar's right edge sets its width: under the pointer it shows a line and a column cursor, a drag moves the sidebar over the center between 220 and 440 and stops at either bound, and the release stores the width in the core's ui state, where it survives a reload and a relaunch; the center and its terminals take the new width once, on the release, never on each pointer move. +A double-click on the edge returns the width to 292, and a press that does not move changes nothing. +A width outside the bounds is refused into the diagnostic log: a sent one leaves the width as it was, and a stored one opens the sidebar at 292. + ### Sidebar hierarchy The sidebar hierarchy is Project > Workspace > Agents; a Workspace corresponds to one checkout path, including a plain folder. @@ -454,8 +466,8 @@ A plain folder, a project that is not a Git repository and holds one checkout, i Its first line is the project's folder glyph, name and status badge, set in the checkout row's columns, and the badge stays while its agent rows are open, as a project's does; its second line and trailing chevron are the checkout's, and a plain folder has no commit age. It has no project fold of its own and keeps the checkout row's right slots; the row opens the checkout and is marked while that checkout's Workspace or the project's Overview is in front, its menu lists the project's items and then the checkout's, and its Overview is reached from All projects, the palette or the Workspace toolbar. While a checkout's agent rows are closed, its status badge ends line one; opening them takes the badge away, since their own marks now speak, and changes nothing else on the row. -A checkout's second line is its purpose, with the last-commit age ending it on the time column; it is kept wherever agents run even before a purpose is known, because an agent's title becomes the purpose once it is and the row must not grow then. -A checkout with neither a purpose nor agents, or one whose Git facts have not been read yet, is one line, with its age on that line. +A checkout's second line is its purpose, after the parent checkout it was raised from when there is one, with the last-commit age ending it on the time column; it is drawn only while the checkout has a purpose or a raising parent, so a checkout with agents and neither is one line. +A checkout with neither, or one whose Git facts have not been read yet, is one line, with its age on that line. Workspace disclosure persists across launches and hides only the nested agent rows, preserving selection, running panes, and raised attention rows. An agent row's title is its identity label at both densities: the rolling task, or the workspace label when no task exists; a Herdr agent name remains a control identifier and never becomes display copy. A row whose descendants are folded, and every raised row, wears a descendant badge counting live descendants by state before the elapsed time; opening the fold removes the badge because the opened rows carry their own marks. diff --git a/herdr-core/src/model.rs b/herdr-core/src/model.rs index 23e0769116..dabdd6b048 100644 --- a/herdr-core/src/model.rs +++ b/herdr-core/src/model.rs @@ -2019,6 +2019,12 @@ pub struct UiStateSnapshot { /// The web shell's color theme. #[serde(default)] pub theme: ThemePreference, + /// The Projects and Agents sidebar's width in CSS pixels, dragged on its + /// right edge and kept within `SIDEBAR_WIDTH_MIN..=SIDEBAR_WIDTH_MAX` + /// (PRD sidebar-typography D-08, D-09). A store written before the drag + /// existed loads at the default. + #[serde(default = "default_sidebar_width")] + pub sidebar_width: u32, /// The interface font size, in points, that the Appearance slider sets. /// It scales the shell's own chrome - every `hideFont` call site - and /// nothing else. A pane's terminal bytes are sized by `pane_text_scales` @@ -2158,6 +2164,7 @@ impl Default for UiStateSnapshot { device_registrations: Vec::new(), accent_hex: default_accent_hex(), theme: ThemePreference::Dark, + sidebar_width: default_sidebar_width(), font_size: default_font_size(), pane_text_scales: BTreeMap::new(), editor_text_scale: DEFAULT_PANE_TEXT_SCALE, @@ -2236,6 +2243,20 @@ pub(crate) fn default_accent_hex() -> String { "#B9FF66".to_owned() } +/// The narrowest and widest sidebar the drag lands on (`--size-sidebar-min` +/// and `--size-sidebar-max` in design/tokens.json); a width outside is refused. +pub const SIDEBAR_WIDTH_MIN: u32 = 220; +pub const SIDEBAR_WIDTH_MAX: u32 = 440; + +/// The sidebar's width until the operator drags it (`--size-sidebar-ideal`). +pub(crate) fn default_sidebar_width() -> u32 { + 292 +} + +pub(crate) fn sidebar_width_fits(width: u32) -> bool { + (SIDEBAR_WIDTH_MIN..=SIDEBAR_WIDTH_MAX).contains(&width) +} + pub(crate) fn default_font_size() -> f32 { 13.0 } diff --git a/herdr-core/src/persistence.rs b/herdr-core/src/persistence.rs index 47f207a634..8897487c31 100644 --- a/herdr-core/src/persistence.rs +++ b/herdr-core/src/persistence.rs @@ -8,7 +8,7 @@ use serde::{Deserialize, Serialize}; use crate::model::{ DeviceRegistration, PaneReadRecord, PetOriginSnapshot, RightPanelSection, SessionsMode, ThemePreference, UiStateSnapshot, WorkspaceRegistration, default_accent_hex, default_font_size, - default_pane_text_scale, default_panel_visible, + default_pane_text_scale, default_panel_visible, default_sidebar_width, }; const UI_STATE_SCHEMA_VERSION: u32 = 1; @@ -83,6 +83,8 @@ struct StoredUiState { /// store written before the web theme existed, which loads as Dark. #[serde(default)] theme: Option, + #[serde(default = "default_sidebar_width")] + sidebar_width: u32, #[serde(default = "default_font_size")] font_size: f32, #[serde(default)] @@ -247,6 +249,7 @@ fn decode(bytes: &[u8]) -> (UiStateSnapshot, PaneTerminalSizes, LoadDisposition) device_registrations: stored.device_registrations, accent_hex: stored.accent_hex, theme, + sidebar_width: stored.sidebar_width, font_size: stored.font_size, pane_text_scales: stored.pane_text_scales, editor_text_scale: stored.editor_text_scale, @@ -308,6 +311,7 @@ pub fn save( device_registrations: state.device_registrations.clone(), accent_hex: state.accent_hex.clone(), theme: Some(state.theme.as_str().to_owned()), + sidebar_width: state.sidebar_width, font_size: state.font_size, pane_text_scales: state.pane_text_scales.clone(), editor_text_scale: state.editor_text_scale, diff --git a/herdr-core/src/runtime.rs b/herdr-core/src/runtime.rs index d0b24c8b13..d81e1d6088 100644 --- a/herdr-core/src/runtime.rs +++ b/herdr-core/src/runtime.rs @@ -1351,6 +1351,27 @@ impl Runtime { occurred_at: unix_milliseconds(), }); } + // A stored width the drag could not have produced (a hand-edited + // store) is not drawn; the sidebar opens at its default. + if !crate::model::sidebar_width_fits(snapshot.ui_state.sidebar_width) { + let message = format!( + "Stored sidebar width {} is outside {}..={}; the default was used", + snapshot.ui_state.sidebar_width, + crate::model::SIDEBAR_WIDTH_MIN, + crate::model::SIDEBAR_WIDTH_MAX + ); + crate::diagnostic!(serde_json::json!({ + "component": "ui_state", + "kind": "ui_state.sidebar_width_out_of_range", + "message": message, + })); + snapshot.status.diagnostics.push(DiagnosticSnapshot { + kind: "ui_state.sidebar_width_out_of_range".to_owned(), + message, + occurred_at: unix_milliseconds(), + }); + snapshot.ui_state.sidebar_width = crate::model::default_sidebar_width(); + } let workspace_views = options.workspace_views_path.as_ref().map(|path| { let (store, diagnostics) = WorkspaceViewStore::open( PathBuf::from(path), diff --git a/herdr-core/src/runtime/events.rs b/herdr-core/src/runtime/events.rs index 053e066e4d..d4a2829b41 100644 --- a/herdr-core/src/runtime/events.rs +++ b/herdr-core/src/runtime/events.rs @@ -573,6 +573,9 @@ pub(super) struct UiStateUpdatePayload { pub(super) device_registrations: Option>, #[serde(default)] pub(super) accent_hex: Option, + /// Absent keeps the width: only the web shell's drag and reset send it. + #[serde(default)] + pub(super) sidebar_width: Option, #[serde(default)] pub(super) font_size: Option, /// Ephemeral observation hints for the core-owned provider usage timer. @@ -3061,6 +3064,24 @@ impl Runtime { accent_hex: payload.accent_hex.unwrap_or(current.accent_hex), // `theme_set` owns the theme; a shared UI-state save carries it through. theme: current.theme, + // A width outside the drag's range keeps the last one; the + // shell never sends it, so there is nothing to show. + sidebar_width: match payload.sidebar_width { + Some(width) if crate::model::sidebar_width_fits(width) => width, + Some(width) => { + self.push_diagnostic( + "ui_state.sidebar_width_out_of_range", + format!( + "Sidebar width {width} is outside {}..={}; kept {}", + crate::model::SIDEBAR_WIDTH_MIN, + crate::model::SIDEBAR_WIDTH_MAX, + current.sidebar_width + ), + ); + current.sidebar_width + } + None => current.sidebar_width, + }, font_size: payload.font_size.unwrap_or(current.font_size), // The zoom chords own this map; a navigator or keyboard // save must not erase it, for the same reason the pet diff --git a/herdr-core/src/runtime/tests/appearance.rs b/herdr-core/src/runtime/tests/appearance.rs index b763c7c180..0139d4d3ab 100644 --- a/herdr-core/src/runtime/tests/appearance.rs +++ b/herdr-core/src/runtime/tests/appearance.rs @@ -131,3 +131,109 @@ fn a_ui_state_update_carries_the_theme_through() { assert!(runtime.dispatch_json(&update)); assert_eq!(runtime.snapshot().ui_state.theme, ThemePreference::Light); } + +/// The web's `ui_state_update`: the whole current state with `patch` over it. +fn ui_state_update(runtime: &Runtime, patch: serde_json::Value) -> Vec { + let mut payload = serde_json::to_value(&runtime.snapshot().ui_state).expect("ui state"); + for (key, value) in patch.as_object().expect("patch object") { + payload[key] = value.clone(); + } + serde_json::to_vec(&serde_json::json!({ + "schema_version": SCHEMA_VERSION, + "kind": "ui_state_update", + "payload": payload + })) + .expect("ui state event") +} + +/// PRD sidebar-typography B11: a dragged width survives a restart, and a store +/// from before the drag opens at the default. +#[test] +fn a_dragged_sidebar_width_survives_a_restart() { + let path = state_path("sidebar-width"); + let mut runtime = runtime_at(&path); + assert_eq!(runtime.snapshot().ui_state.sidebar_width, 292); + let event = ui_state_update(&runtime, serde_json::json!({"sidebar_width": 360})); + assert!(runtime.dispatch_json(&event)); + assert_eq!(runtime.snapshot().ui_state.sidebar_width, 360); + drop(runtime); + assert_eq!(runtime_at(&path).snapshot().ui_state.sidebar_width, 360); +} + +/// PRD sidebar-typography B13, D-18 (3): a width outside 220..=440 is refused +/// into the diagnostic log, never presented, and the last width stays while +/// the rest of the event applies. +#[test] +fn an_out_of_range_sidebar_width_is_refused_into_the_log() { + let path = state_path("sidebar-width-range"); + let mut runtime = runtime_at(&path); + let event = ui_state_update(&runtime, serde_json::json!({"sidebar_width": 300})); + assert!(runtime.dispatch_json(&event)); + let error_before = runtime.snapshot().status.last_error.clone(); + for width in [219, 441, 0] { + let event = ui_state_update( + &runtime, + serde_json::json!({"sidebar_width": width, "font_size": 15.0}), + ); + runtime.dispatch_json(&event); + assert_eq!( + runtime.snapshot().ui_state.sidebar_width, + 300, + "{width} is refused" + ); + assert!( + runtime + .snapshot() + .status + .diagnostics + .iter() + .any(|entry| entry.kind == "ui_state.sidebar_width_out_of_range" + && entry.message.contains(&width.to_string())), + "{width} is recorded" + ); + } + assert_eq!( + runtime.snapshot().ui_state.font_size, + 15.0, + "the rest of the event applies" + ); + assert_eq!( + runtime.snapshot().status.last_error, + error_before, + "nothing is presented" + ); + for width in [220, 440] { + let event = ui_state_update(&runtime, serde_json::json!({"sidebar_width": width})); + assert!(runtime.dispatch_json(&event)); + assert_eq!( + runtime.snapshot().ui_state.sidebar_width, + width, + "{width} is a bound, not outside it" + ); + } +} + +/// A stored width the drag could not have produced opens at the default, with a diagnostic. +#[test] +fn an_out_of_range_stored_sidebar_width_opens_at_the_default() { + let path = state_path("sidebar-width-stored"); + let mut runtime = runtime_at(&path); + let event = ui_state_update(&runtime, serde_json::json!({"sidebar_width": 400})); + assert!(runtime.dispatch_json(&event)); + drop(runtime); + let mut stored: serde_json::Value = + serde_json::from_str(&std::fs::read_to_string(&path).expect("saved state")).expect("json"); + assert_eq!(stored["sidebar_width"], 400); + stored["sidebar_width"] = serde_json::json!(900); + std::fs::write(&path, serde_json::to_vec(&stored).unwrap()).expect("edit store"); + let restarted = runtime_at(&path); + assert_eq!(restarted.snapshot().ui_state.sidebar_width, 292); + assert!( + restarted + .snapshot() + .status + .diagnostics + .iter() + .any(|entry| entry.kind == "ui_state.sidebar_width_out_of_range") + ); +} diff --git a/scripts/design-review.mjs b/scripts/design-review.mjs index e994f1f6e8..68aa5d0bb1 100644 --- a/scripts/design-review.mjs +++ b/scripts/design-review.mjs @@ -364,7 +364,8 @@ async function review(root, args) { const themes = list(options.theme, conditions.themes); const widths = list(options.width, conditions.widths, Number); const contents = list(options.content, conditions.contents); - const scales = list(options.scale, conditions.scales, Number); + // A target whose screen does not follow the interface scale lists no scales and is measured at 1. + const scales = list(options.scale, conditions.scales ?? [1], Number); const states = list(options.state, Object.keys(target.states)); for (const theme of themes) if (!['light', 'dark'].includes(theme)) throw new UsageError(`Unknown theme ${theme}`); for (const width of widths) if (!(width > 0)) throw new UsageError(`Bad width ${width}`); diff --git a/scripts/gen-tokens.mjs b/scripts/gen-tokens.mjs index 85187780da..2345bbaf55 100644 --- a/scripts/gen-tokens.mjs +++ b/scripts/gen-tokens.mjs @@ -15,6 +15,9 @@ export const CSS = 'web/src/tokens.css'; export const ACCENTS = 'web/src/generated/accents.ts'; /** The interface text sizes Settings > Appearance > Interface font scales; terminal and editor text do not. */ +/** The class a subtree carries to draw the interface text at its own size whatever the Appearance scale. */ +export const SCALE_EXEMPT = 'interface-scale-exempt'; + export const INTERFACE_TEXT = ['--text-micro', '--text-caption', '--text-body', '--text-subhead', '--text-title', '--text-headline']; export function readTokens(root = process.cwd()) { @@ -34,7 +37,7 @@ function color(value) { export function generate(root = process.cwd()) { const tokens = readTokens(root); - const theme = [], mapped = [], light = [], dark = [], rest = []; + const theme = [], mapped = [], light = [], dark = [], rest = [], fixed = []; for (const [name, token] of Object.entries(tokens)) { if (token.type === 'color') { if (!token.light) throw new Error(`${name} has no Light value`); @@ -50,6 +53,7 @@ export function generate(root = process.cwd()) { mapped.push(` --color-${name.slice(2)}: var(${name});`); } else if (INTERFACE_TEXT.includes(name)) { theme.push(` ${name}: calc(${plain(token)} * var(--interface-scale, 1));`); + fixed.push(` ${name}: ${plain(token)};`); } else if (name.startsWith('--spacing-') || name.startsWith('--radius-')) { theme.push(` ${name}: ${plain(token)};`); } else { @@ -73,6 +77,15 @@ export function generate(root = process.cwd()) { ...rest, '}', '', + // The sidebar does not follow Settings > Appearance > Interface font + // (PRD sidebar-typography D-05). A custom property resolves its var() + // where it is declared, so the scaled sizes above are already fixed at + // :root; a subtree that opts out declares the sizes again. + `.${SCALE_EXEMPT} {`, + ' --interface-scale: 1;', + ...fixed, + '}', + '', '/* `.light` and `.dark` also scope a subtree, so one page can show both (the dev gallery). */', ':root,', '.light {', diff --git a/scripts/pen-screens.mjs b/scripts/pen-screens.mjs index b063b55ccd..d9acdccfe1 100644 --- a/scripts/pen-screens.mjs +++ b/scripts/pen-screens.mjs @@ -321,7 +321,8 @@ function screenSidebarAgentRow(id, {title, symbol = '●', color = '$--agent-wor return themedXref(id, 'sidebar-agent-row', title, {width, padding: ['$--spacing-xs', '$--spacing-xs', '$--spacing-xs', inset], ...(selected ? {fill: '$--secondary'} : {})}, { ...markOverrides({dot: 'sar-dot', ring: 'sar-ring', glyph: 'sar-glyph'}, symbol, color), 'sar-provider': {fill: {type: 'image', enabled: true, url: `../web/src/assets/agent-${provider}.png`, mode: 'fit'}}, - 'sar-title': {content: title, ...(bright || selected ? {fill: '$--foreground', fontWeight: '500'} : {})}, + // 12/400 in every state: attention and selection brighten the title, never thicken it. + 'sar-title': {content: title, ...(bright || selected ? {fill: '$--foreground'} : {})}, 'sar-elapsed': {content: age}, 'sar-line': line ? {enabled: true, content: line, fill: lineFill} : {enabled: false}, 'sar-place': place ? {enabled: true, content: place} : {enabled: false}, @@ -438,7 +439,7 @@ function screenSidebar(tokens, id, suffix, agents) { text(`${id}-agentstab-${suffix}`, 'Agents', {weight: '600'}), text(`${id}-projectstab-${suffix}`, 'Projects', {fill: '$--muted-foreground'}), ]), - text(`${id}-seen-${suffix}`, 'SEEN · 2', {size: '$--text-micro', fill: '$--muted-foreground', weight: '600'}), + text(`${id}-seen-${suffix}`, 'Seen · 2', {size: '$--text-micro', fill: '$--muted-foreground', weight: '500'}), // Agents' rows name their project and checkout on a fixed context line. ...agents.flatMap((agent, index) => [ screenSidebarAgentRow(`${id}-agent${index}-${suffix}`, { @@ -1355,7 +1356,7 @@ function buildProjectsSidebar(tokens) { // A project's badge is its checkouts' added up, and it stays while they are open. function projectRow(id, {name, marks, expanded, selected = false}) { - return themedXref(id, 'qdhY0', name, {width: row, height: num(tokens, '--size-control-regular'), ...(selected ? {fill: '$--secondary'} : {})}, { + return themedXref(id, 'qdhY0', name, {width: row, height: num(tokens, '--size-project-row'), ...(selected ? {fill: '$--secondary'} : {})}, { iBYjj: {icon: expanded ? 'chevron-down' : 'chevron-right'}, // An unfolded project's chevron waits for the pointer in its slot. wgtfo: {opacity: expanded ? 0 : 1}, @@ -1368,7 +1369,7 @@ function buildProjectsSidebar(tokens) { // sidebar.tsx's AllProjectsRow: the project row's columns with the fold slot // empty, the layout-grid glyph, and the project count where a badge stands. function allProjectsRow(id, {count}) { - return themedXref(id, 'qdhY0', 'All projects', {width: row, height: num(tokens, '--size-control-regular')}, { + return themedXref(id, 'qdhY0', 'All projects', {width: row, height: num(tokens, '--size-project-row')}, { wgtfo: {opacity: 0}, mIzlX: {icon: 'layout-grid'}, JkPyX: {content: 'All projects'}, @@ -1377,28 +1378,33 @@ function buildProjectsSidebar(tokens) { }); } - // Line one is the name, the badge while the agent rows are folded (always, on - // a folder, whose badge is its project's) and the fold slot; line two is the - // purpose and the last-commit age, kept wherever agents run. A row with - // neither is one line with its age there, and a missing folder has none. + // Line one is the name, 12/400 with its path prefix muted (500 while its + // Workspace is in front), the badge while the agent rows are folded (always, + // on a folder, whose badge is its project's) and the fold slot; line two is + // the purpose (after the parent it was raised from, if any) and the + // last-commit age, drawn only when one of them exists. A row without either + // is one line with its age there, and a missing folder has none. // Pen draws no ellipsis, so a long name or purpose is written already cut the // way the row truncates it. function checkoutRow(id, {name, kind = 'branch', age, purpose, raisedFrom, marks, expanded = false, selected = false}) { const k = KIND[kind]; const project = kind === 'folder'; const agents = Boolean(marks); - const secondLine = Boolean(purpose) || agents; + const secondLine = Boolean(purpose || raisedFrom); + const slash = name.indexOf('/'); + const [prefix, rest] = project || slash <= 0 ? ['', name] : [name.slice(0, slash + 1), name.slice(slash + 1)]; // Line one starts with the master's mark slot and a gap before the glyph. const leading = (project ? sm : glyphColumn) - markSlot - sm; const inner = row - xs - leading; return themedXref(id, 'DLP27', name, { - width: row, height: num(tokens, secondLine ? '--size-checkout-row-detailed' : project ? '--size-control-regular' : '--size-checkout-row'), + width: row, height: num(tokens, secondLine ? '--size-checkout-row-detailed' : project ? '--size-project-row' : '--size-checkout-row'), padding: [0, xs, 0, leading], ...(selected ? {fill: '$--secondary'} : {}), }, { QetL0: {width: inner}, VtSRn: {icon: k.icon, fill: k.fill}, - q91d7: project ? {content: name, fontSize: '$--text-title', fontWeight: '600'} : {content: name, fontWeight: selected ? '600' : '500'}, + 'checkout-name-prefix': prefix ? {content: prefix, enabled: true} : {enabled: false}, + q91d7: project ? {content: name, fontSize: '$--text-subhead', fontWeight: '600'} : {content: rest, fontWeight: selected ? '500' : 'normal'}, TS5x9: {enabled: kind === 'missing'}, ...status('checkout', project || !expanded ? marks : null), TuosT: !secondLine && age ? {content: age, enabled: true} : {enabled: false}, @@ -1433,17 +1439,22 @@ function buildProjectsSidebar(tokens) { // An opened checkout and its agent rows, on one small group fill. function group(id, rows) { - return frame(id, 'Opened checkout', {width: row, layout: 'vertical', fill: '$--muted', cornerRadius: '$--radius-sm'}, rows); + return frame(id, 'Opened checkout', {width: row, layout: 'vertical', padding: ['$--spacing-xs', 0], fill: '$--muted', cornerRadius: '$--radius-sm'}, rows); } function fold(id, label, level) { return themedXref(id, 'inactive-fold-row', label, {width: row, padding: [0, xs, 0, level === 'project' ? sm : glyphColumn]}, {'inactive-fold-label': {content: label}}); } + // The library's Section Header, 10/500 in sentence case (D-11), at the + // list's own inset, with neither chevron nor detail: these sections do not fold. function section(id, label) { - return frame(id, 'Section', {width: row, padding: ['$--spacing-sm', '$--spacing-sm', '$--spacing-xxs', '$--spacing-sm']}, [ - text(`${id}-t`, label, {size: '$--text-micro', fill: '$--muted-foreground', weight: '600'}), - ]); + return themedXref(id, 'O79KF', label, {width: row, padding: ['$--spacing-sm', '$--spacing-sm', '$--spacing-xxs', '$--spacing-sm']}, { + eK6gz: {enabled: false}, + VOd6D: {content: label, fill: '$--muted-foreground'}, + rVsKB: {enabled: false}, + g7fzt: {enabled: false}, + }); } function build(s) { @@ -1457,9 +1468,9 @@ function buildProjectsSidebar(tokens) { const list = frame(`psb-list-${s}`, 'Projects list', {width, layout: 'vertical', padding: [0, xs]}, [ // Counts the rows below can produce: one pinned, herdr-ide and sasu, and three folded inactive projects. allProjectsRow(`psb-all-${s}`, {count: '6 projects'}), - section(`psb-sec-pin-${s}`, 'PINNED · 1'), + section(`psb-sec-pin-${s}`, 'Pinned · 1'), folderRow(`psb-p-notes-${s}`, {name: 'team-notes', marks: {idle: 1}, purpose: '회의록 요약 정리'}), - section(`psb-sec-recent-${s}`, 'PROJECTS · RECENT ACTIVITY · 5'), + section(`psb-sec-recent-${s}`, 'Projects · Recent activity · 5'), projectRow(`psb-p-herdr-${s}`, {name: 'herdr-ide', marks: {question: 3, working: 5, done: 1, idle: 1}, expanded: true}), checkoutRow(`psb-overview-${s}`, {name: 'Overview', kind: 'overview', selected: true}), group(`psb-g-main-${s}`, [ @@ -1500,7 +1511,7 @@ function buildProjectsSidebar(tokens) { ]); return [frame(`psb-sidebar-${s}`, 'Sidebar', {width, layout: 'vertical', fill: '$--sidebar', clip: true}, [header, list, footer])]; } - return screenSheet('screen-projects-sidebar', 'Screen / Projects Sidebar', 'sidebar.tsx, projects.ts: the Projects tab, the scope picker. All projects heads the list and opens All projects; the row of the scope the center shows carries the selected fill, here the Overview child under herdr-ide, and a checkout only while its Workspace is in front. A project’s primary checkout comes first, then the rest by activity. Every line ends in its time or status badge and then a fold slot, so names never move and the times, badges and chevrons stand in one column each; a folded chevron is drawn and an unfolded one waits for the pointer. A row’s menu opens on a right-click, with nothing drawn for it. A status badge counts agents under the mark each agent’s own row draws, worst first (× ! ? ● ✓ ○). A project row opens the Overview and wears its checkouts’ badges added up, open or folded, and no time. The first row under an expanded Git project is Overview, an instance of the checkout row with a layout-dashboard glyph and empty trailing slots. A checkout row opens the checkout and unfolds its agents; clicking its already selected, unfolded Workspace folds them without leaving it. The chevron changes disclosure alone. While its agent rows are folded its badge ends line one, and its chevron, there only while agents run, opens them on one group fill in place of the badge. Line two is the purpose with the last-commit age on the time column, kept wherever agents run; a checkout with neither is one line with its age there. A parent agent folds its children with the same chevron and speaks for them with its badge. A folded parent keeps its own-checkout descendants in the badge and draws one C-style line per other checkout, with the R1 server-glyph device chip. A checkout raised by an external root prefixes line two with the parent checkout. The kind glyph is the pull request’s lifecycle when GitHub knows one, else folder, primary, detached or branch; a missing folder is danger with no age.', build, build); + return screenSheet('screen-projects-sidebar', 'Screen / Projects Sidebar', 'sidebar.tsx, projects.ts: the Projects tab, the scope picker. All projects heads the list and opens All projects; the row of the scope the center shows carries the selected fill, here the Overview child under herdr-ide, and a checkout only while its Workspace is in front. A project’s primary checkout comes first, then the rest by activity. Every line ends in its time or status badge and then a fold slot, so names never move and the times, badges and chevrons stand in one column each; a folded chevron is drawn and an unfolded one waits for the pointer. A row’s menu opens on a right-click, with nothing drawn for it. A status badge counts agents under the mark each agent’s own row draws, worst first (× ! ? ● ✓ ○). A project row opens the Overview and wears its checkouts’ badges added up, open or folded, and no time. The first row under an expanded Git project is Overview, an instance of the checkout row with a layout-dashboard glyph and empty trailing slots. A checkout row opens the checkout and unfolds its agents; clicking its already selected, unfolded Workspace folds them without leaving it. The chevron changes disclosure alone. While its agent rows are folded its badge ends line one, and its chevron, there only while agents run, opens them on one group fill in place of the badge. A checkout name is 12/400 with its prefix up to the first slash muted. Line two is the purpose with the last-commit age on the time column, drawn only for a purpose or a raised-from parent; a checkout without either is one line with its age there. A parent agent folds its children with the same chevron and speaks for them with its badge. A folded parent keeps its own-checkout descendants in the badge and draws one C-style line per other checkout, with the R1 server-glyph device chip. A checkout raised by an external root prefixes line two with the parent checkout. The kind glyph is the pull request’s lifecycle when GitHub knows one, else folder, primary, detached or branch; a missing folder is danger with no age.', build, build); } // -- assembly --------------------------------------------------------------------- diff --git a/web/e2e/projects-sidebar.spec.ts b/web/e2e/projects-sidebar.spec.ts index 247edaa8c6..e16f2ccc66 100644 --- a/web/e2e/projects-sidebar.spec.ts +++ b/web/e2e/projects-sidebar.spec.ts @@ -61,6 +61,28 @@ async function projectButtonFills(page: Page): Promise { }); } +/** The font size, in px, of a `text-body` probe placed inside `selector`: what the interface's body text measures there. */ +async function probeTextSize(page: Page, selector: string): Promise { + return page.evaluate((within) => { + const probe = document.createElement("span"); + probe.className = "text-body"; + probe.textContent = "x"; + document.querySelector(within)!.append(probe); + const size = Number.parseFloat(getComputedStyle(probe).fontSize); + probe.remove(); + return size; + }, selector); +} + +/** Every text-holding element's font size in the sidebar's lists, in document order. */ +async function sidebarTextSizes(page: Page): Promise { + return page.evaluate(() => + Array.from(document.querySelectorAll("nav[data-sidebar] *")) + .filter((part) => part.getClientRects().length > 0 && Array.from(part.childNodes).some((node) => node.nodeType === Node.TEXT_NODE && node.textContent?.trim())) + .map((part) => getComputedStyle(part).fontSize), + ); +} + async function chooseTheme(page: Page, theme: "light" | "dark"): Promise { await page.keyboard.press("Alt+Comma"); await expect(page.locator('[data-settings="true"]')).toBeVisible(); @@ -138,10 +160,11 @@ test("the Projects tab: kind, age, status badges, opened checkouts and folded pr const lineOf = async (part: Locator) => Math.round((await part.boundingBox())!.y); expect(await lineOf(feature.locator("[data-checkout-age]"))).toBeGreaterThan(await lineOf(feature.getByText("feature/sidebar-rows", { exact: true }))); expect(await lineOf(feature.locator("[data-checkout-age]"))).toBe(await lineOf(feature.locator("[data-purpose]"))); - // A checkout where agents run keeps line two, with its age, before the - // core knows a purpose for it: its agent's title becomes one later (once - // the checkout is opened below), and the row must not grow when it does. - expect(await lineOf(primary.locator("[data-checkout-age]"))).toBeGreaterThan(await lineOf(primary.getByText("main", { exact: true }))); + // PRD sidebar-typography B4: line two is the purpose, here the agent's + // title standing in for one, with the age ending it. Agents alone earn no + // line two (projects.test.ts); a checkout with neither is one line (below). + await expect(primary.locator("[data-purpose]")).toHaveText("메인 체크아웃 정리"); + expect(await lineOf(primary.locator("[data-checkout-age]"))).toBe(await lineOf(primary.locator("[data-purpose]"))); await expect(project.locator('[data-project-status] [data-badge-part="idle"]')).toHaveText("2"); await expect(project.locator("[data-project-row]")).toHaveAccessibleName("repo, 2 idle"); await screenshot(page, "projects-sidebar-closed"); @@ -403,8 +426,17 @@ test("the Projects tab: kind, age, status badges, opened checkouts and folded pr await screenshot(page, `projects-sidebar-${theme}`); } - // B26: at the largest interface font the rows still hold their text and + // PRD sidebar-typography B8 (was sidebar-readability B26): the sidebar + // does not follow the interface font. At the largest size its text and + // rows are the ones the default draws, while text outside it grows, and // hover still moves nothing. + await rest(page); + const projectsAtDefault = { sizes: await sidebarTextSizes(page), row: await rowGeometry(primaryRow, feature, primaryParts) }; + const outsideAtDefault = await probeTextSize(page, "main"); + await page.locator('[data-sidebar-mode="agents"]').click(); + await rest(page); + const agentsAtDefault = { sizes: await sidebarTextSizes(page), row: await rowGeometry(agentRow, nextRow, agentParts) }; + await page.locator('[data-sidebar-mode="projects"]').click(); await page.keyboard.press("Alt+Comma"); await page.locator('[data-settings-tab="appearance"]').click(); const fontSize = page.locator('[data-font-size="true"] [role="slider"]'); @@ -413,26 +445,28 @@ test("the Projects tab: kind, age, status badges, opened checkouts and folded pr await expect(fontSize).toHaveAttribute("aria-valuenow", "17"); await page.keyboard.press("Escape"); await expect(page.locator('[data-settings="true"]')).toHaveCount(0); - await expect.poll(() => page.evaluate(() => document.documentElement.style.getPropertyValue("--interface-scale"))).not.toBe(""); + // The scale is already set at the default size, so wait for its effect, not its presence. + await expect.poll(() => probeTextSize(page, "main")).toBeGreaterThan(outsideAtDefault); await rest(page); + expect(await probeTextSize(page, "nav[data-sidebar]")).toBe(12); + expect(await sidebarTextSizes(page)).toEqual(projectsAtDefault.sizes); + expect(await rowGeometry(primaryRow, feature, primaryParts)).toEqual(projectsAtDefault.row); expect(await sidebarRowsFit(page)).toEqual([]); expect(await projectButtonFills(page)).toBe(true); - const largeAtRest = await rowGeometry(primaryRow, feature, primaryParts); await primaryRow.hover(); - expect(await rowGeometry(primaryRow, feature, primaryParts)).toEqual(largeAtRest); + expect(await rowGeometry(primaryRow, feature, primaryParts)).toEqual(projectsAtDefault.row); await rest(page); await keyboardFocus(page, primary.locator("[data-checkout]")); - expect(await rowGeometry(primaryRow, feature, primaryParts)).toEqual(largeAtRest); + expect(await rowGeometry(primaryRow, feature, primaryParts)).toEqual(projectsAtDefault.row); await rest(page); await screenshot(page, "projects-sidebar-large-font"); await page.locator('[data-sidebar-mode="agents"]').click(); await rest(page); + expect(await sidebarTextSizes(page)).toEqual(agentsAtDefault.sizes); + expect(await rowGeometry(agentRow, nextRow, agentParts)).toEqual(agentsAtDefault.row); expect(await sidebarRowsFit(page)).toEqual([]); - const largeAgentAtRest = await rowGeometry(agentRow, nextRow, agentParts); await agentRow.hover(); - expect(await rowGeometry(agentRow, nextRow, agentParts)).toEqual(largeAgentAtRest); - await keyboardFocus(page, agentRow.locator("[data-agent-open]")); - expect(await rowGeometry(agentRow, nextRow, agentParts)).toEqual(largeAgentAtRest); + expect(await rowGeometry(agentRow, nextRow, agentParts)).toEqual(agentsAtDefault.row); await rest(page); await screenshot(page, "agents-sidebar-large-font"); await page.locator('[data-sidebar-mode="projects"]').click(); diff --git a/web/e2e/sidebar-width.spec.ts b/web/e2e/sidebar-width.spec.ts new file mode 100644 index 0000000000..461cc90d31 --- /dev/null +++ b/web/e2e/sidebar-width.spec.ts @@ -0,0 +1,123 @@ +// The sidebar's width (PRD sidebar-typography B10-B12) on an isolated pinned +// Herdr and hided: the right edge drags between 220 and 440 and stops there, +// the nav alone follows the pointer while the center and its terminal stay +// put, one ui_state_update lands the width on release, a reload keeps it, and +// a double-click returns it to 292. Captures land in HIDE_E2E_SCREENSHOT_DIR. + +import { expect, test, type Locator, type Page } from "@playwright/test"; +import { spawnSync } from "node:child_process"; +import fs from "node:fs"; +import path from "node:path"; +import { startHerdr, type HerdrFixture } from "./herdr-fixture"; +import { startHided } from "./hided-fixture"; +import { countSent, rest, screenshot } from "./wire"; + +test.describe.configure({ timeout: 120_000 }); + +async function prompt(herdr: HerdrFixture, pane: string): Promise { + const deadline = Date.now() + 15_000; + while (Date.now() < deadline) { + const read = spawnSync(herdr.bin, ["pane", "read", pane, "--source", "visible", "--format", "text"], { env: herdr.env, encoding: "utf8", timeout: 10_000 }); + if (read.status === 0 && read.stdout.includes("fixture %")) return; + await new Promise((resolve) => setTimeout(resolve, 100)); + } + throw new Error(`no prompt in pane ${pane}`); +} + +const width = async (element: Locator) => Math.round((await element.boundingBox())!.width); + +/** Presses on the edge's centre, moves by `dx` in steps, and returns the release. */ +async function dragEdge(page: Page, edge: Locator, dx: number): Promise<() => Promise> { + const box = (await edge.boundingBox())!; + const x = box.x + box.width / 2; + const y = box.y + box.height / 2; + await page.mouse.move(x, y); + await page.mouse.down(); + await page.mouse.move(x + dx, y, { steps: 12 }); + return () => page.mouse.up(); +} + +test("the sidebar's edge drags between its bounds, lands once, survives a reload and resets on a double-click", async ({ page }) => { + await page.setViewportSize({ width: 1400, height: 900 }); + const herdr = await startHerdr(); + const daemon = await startHided(herdr, "sidebar-width"); + try { + const folder = path.join(herdr.root, "notes"); + fs.mkdirSync(folder); + const created = herdr.run(["workspace", "create", "--cwd", folder, "--label", "notes", "--env", `PATH=${herdr.fixturePath}`, "--no-focus"]) as { + result: { root_pane: { pane_id: string } }; + }; + await prompt(herdr, created.result.root_pane.pane_id); + + const last = new Map>(); + const sent = countSent(page, last); + await page.goto(`${daemon.origin}/#token=${daemon.token}`); + await page.locator('[data-sidebar-mode="projects"]').click(); + const nav = page.locator("nav[data-sidebar]"); + const box = page.locator("[data-sidebar-box]"); + const edge = page.locator("[data-sidebar-edge]"); + const main = page.locator("main"); + // Open the folder's Workspace so a terminal sits beside the sidebar. + await page.locator("[data-project]", { hasText: /^notes/ }).locator("[data-checkout]").click(); + await expect(page.locator("[data-workspace-screen]")).toBeVisible(); + await expect(page.locator(".xterm").first()).toBeVisible({ timeout: 20_000 }); + await rest(page); + expect(await width(nav)).toBe(292); + + // B10: the edge shows the line under the pointer. + const line = edge.locator("span"); + await expect(line).toHaveCSS("opacity", "0"); + await edge.hover(); + await expect(line).toHaveCSS("opacity", "1"); + await expect(edge).toHaveCSS("cursor", "col-resize"); + + // B10, B12: dragged far past the maximum, the nav follows and stops at + // 440 while the center and its terminal have not moved. + const mainBefore = await main.boundingBox(); + const before = new Map(sent); + const release = await dragEdge(page, edge, 400); + expect(await width(nav)).toBe(440); + expect(await width(box)).toBe(292); + expect(await main.boundingBox()).toEqual(mainBefore); + expect((sent.get("ui_state_update") ?? 0) - (before.get("ui_state_update") ?? 0)).toBe(0); + expect((sent.get("terminal_resize") ?? 0) - (before.get("terminal_resize") ?? 0)).toBe(0); + await screenshot(page, "sidebar-width-dragging"); + await release(); + // One event lands it, and the center takes the width once the core carries it. + await expect.poll(() => (sent.get("ui_state_update") ?? 0) - (before.get("ui_state_update") ?? 0)).toBe(1); + expect(last.get("ui_state_update")?.sidebar_width).toBe(440); + await expect.poll(() => width(box)).toBe(440); + expect(await width(nav)).toBe(440); + await rest(page); + await screenshot(page, "sidebar-width-440"); + + // Dragged far past the minimum, it stops at 220. + const shrink = await dragEdge(page, edge, -600); + expect(await width(nav)).toBe(220); + await shrink(); + await expect.poll(() => width(box)).toBe(220); + expect(last.get("ui_state_update")?.sidebar_width).toBe(220); + await rest(page); + await screenshot(page, "sidebar-width-220"); + + // B11: a reload keeps the width. + await page.reload(); + await expect(nav).toBeVisible({ timeout: 20_000 }); + await expect.poll(() => width(nav)).toBe(220); + + // A press that does not move sends nothing; a double-click returns to 292 and keeps it. + const quiet = new Map(sent); + await edge.click(); + await page.waitForTimeout(300); + expect((sent.get("ui_state_update") ?? 0) - (quiet.get("ui_state_update") ?? 0)).toBe(0); + await edge.dblclick(); + await expect.poll(() => width(box)).toBe(292); + expect(last.get("ui_state_update")?.sidebar_width).toBe(292); + await page.reload(); + await expect(nav).toBeVisible({ timeout: 20_000 }); + await expect.poll(() => width(nav)).toBe(292); + } finally { + await daemon.stop(); + await herdr.stop(); + } +}); diff --git a/web/src/actions.ts b/web/src/actions.ts index 31027aea99..9ac929627c 100644 --- a/web/src/actions.ts +++ b/web/src/actions.ts @@ -761,6 +761,11 @@ export function createActions(dispatch: DispatchFn) { updateUiState({ font_size: size }); }, + /** The width a sidebar drag or its reset lands on, sent once per gesture (PRD sidebar-typography D-09). */ + setSidebarWidth(width: number) { + updateUiState({ sidebar_width: width }); + }, + /** `host`'s pane chords, replaced as a whole; the other host's set is untouched. */ setPaneShortcuts(host: HostKind, bindings: Record) { updateUiState(host === "electron" ? { shortcut_bindings: bindings } : { browser_shortcut_bindings: bindings }); diff --git a/web/src/components/sidebar-agent-row.tsx b/web/src/components/sidebar-agent-row.tsx index 206cde2482..3e650f11fe 100644 --- a/web/src/components/sidebar-agent-row.tsx +++ b/web/src/components/sidebar-agent-row.tsx @@ -45,10 +45,12 @@ export function FoldLane() { * no branch chip, while a child drawn under a parent elsewhere keeps it. * * Nothing here grows or moves on hover, focus, selection or an open menu: - * those change a fill, a ring and the chevron's opacity only. `number` is - * the digit an ⌥ hold shows at the row's top right (PRD - * electron-digit-shortcuts-hints B5), floating over the time and the fold - * slot, which stay where they are. + * those change a fill, a ring and the chevron's opacity only. The title is + * 12/400 in every state; attention and selection brighten it rather than + * thicken it (PRD sidebar-typography D-02). Line one is 20 high and line two + * 16, so a row is 28 or 44 with its padding (D-03). `number` is the digit an + * ⌥ hold shows at the row's top right (PRD electron-digit-shortcuts-hints B5), + * floating over the time and the fold slot, which stay where they are. */ export const SidebarAgentRow = memo(function SidebarAgentRow({ agent, @@ -118,14 +120,14 @@ export const SidebarAgentRow = memo(function SidebarAgentRow({ onClick={() => onOpen(agent.pane_id)} /> - + - + {/* The row button's name already reads all of this out. */} -