Skip to content

Add ⌘1-9 tab and ⌥1-9 agent chords with modifier hold keycaps in the desktop app - #206

Merged
yansfil merged 8 commits into
mainfrom
prd/electron-digit-shortcuts-hints
Sep 27, 2026
Merged

yansfil merged 8 commits into
mainfrom
prd/electron-digit-shortcuts-hints

Conversation

@yansfil

@yansfil yansfil commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

Related: agents/prd/electron-digit-shortcuts-hints/prd.md

Summary

  • The desktop app had no ⌘1-9 / ⌥1-9 and no hold hint, which the removed native app had; this adds both to the web shell's registry, Electron column only.
  • ⌘n brings the nth tab of the strip in front forward as one focus_tab; ⌥n opens the nth row the Agents list draws, exactly as clicking it; an empty number does nothing.
  • Holding ⌘ or ⌥ alone for 150 ms floats each tab's or row's number at its top right as a keycap; release, another modifier, any key, losing the window, or a layer opening clears it.
  • The keycap is a new web/src/components/ui/keycap.tsx overlay in popover tokens; it takes the close control's corner on a tab and moves nothing.
  • The ⌘/ sheet folds each family into one row and says "not on this host" in a browser; Settings > Shortcuts lists both read-only; docs updated.

⌘ held in the desktop app: each tab's number floats at its top right; the Rename field beside it does not move

Review

  • 결정됨: 번호 chord ⌘1-9/⌥1-9는 고정(재바인딩 없음)이며 시트와 Settings에 읽기 전용으로 보입니다; pane chord를 ⌘n에 묶으면 "⌘n is already Select tab n."으로 거부합니다(Observer 판정 2026-09-27, PRD D-02/B4의 "재바인딩 규칙은 기존과 같다"는 기존 규칙 유지의 뜻).
  • 판단해 주세요: ⌥n은 사이드바가 Projects 탭이거나 숨겨져 있어도 Agents 목록 순서로 동작하고, 키캡은 Agents 행이 화면에 있을 때만 뜹니다; 장치가 앞에 있으면 ⌘n은 그 장치의 탭 스트립을 셉니다.
  • 판단해 주세요: 대표 이미지에서 활성 탭의 × 자리를 홀드 동안 키캡이 차지합니다(공간은 유지, 놓으면 복귀); 보드 v3 섹션 2와 같은 위치인지 봐 주세요.
  • 조심해서 볼 파일: web/src/keyboard.ts - 창 keydown capture 리스너(high-frequency path)에 modifier 추적이 더해짐; 키 하나당 Set lookup 하나, 상태 변화가 있을 때만 publish.
  • 조심해서 볼 파일: web/src/shortcuts.ts - MACOS_RESERVED에서 ⌘1-9를 뺐고 레지스트리가 그 chord를 소유; 저장된 macOS set이 ⌘n을 쓰면 여전히 통째로 기본값으로 떨어지지만 진단 문구가 바뀝니다.
  • 조심해서 볼 파일: web/src/navigation.ts - agentTree가 sidebar.tsx에서 옮겨와 사이드바와 ⌥n이 한 목록을 읽습니다.

Evidence

  • 확인한 것: Electron e2e 1개(격리 hided + 고정 Herdr, worktree desktop/dist)를 로컬 1회: ⌘2 한 번에 focus_tab 1회, ⌘3(빈 번호) 0회, 딜레이 전 놓으면 키캡 0, ⌘ 홀드에 탭 키캡 2개(1, 2)와 탭·Rename 입력·+ 버튼 박스 불변, 놓기·홀드 중 ⌘2·blur·컨텍스트 메뉴·Settings 열림 각각에 키캡 0, ⌥ 홀드에 행 키캡 1·2와 제목·fold slot 박스 불변, ⌥2에 focus_pane 1회, ⌥3 0회, Light 테마 캡처.
  • 확인한 것: 브라우저 e2e 1개(headless Chromium): ⌘·⌥ 500 ms 홀드에 키캡 0, ⌘2·⌥2에 이벤트 0, ⌘/ 시트의 두 family 행이 "not on this host"와 "-".
  • 확인한 것: vitest 411(레지스트리 18개·브라우저 null·충돌 거부·시트 접기, 힌트 상태기계의 딜레이·조기 해제·modifier 추가·clear·family, 탭/에이전트 번호 부여와 접힌 자식 제외), desktop vitest 39(메뉴가 번호 명령을 싣지 않음), web/desktop typecheck·lint·build, check-design-contract.mjs, sealed suite(cargo test·lint) PASS.
  • 확인하지 못한 것: 네이티브 창 캡처 - 이 러너에서 screencapture -l이 거부되어 캡처는 CDP 렌더러 이미지입니다; 합성된 네이티브 창은 CI 아티팩트나 설치 후 확인이 필요합니다.
  • 확인하지 못한 것: 실제 OS 포커스 상실(e2e는 합성 blur 이벤트), 실제 키보드로 Electron이 ⌘n을 페이지에 먼저 넘기는지(Playwright chord로만 확인; 메뉴 가속키는 없음), 툴팁과 키캡이 좁은 탭에서 동시에 뜨는 경우, 장치가 앞에 있을 때의 ⌘n 회귀 테스트.
  • 확인하지 못한 것: 전체 web/desktop e2e 스위트는 로컬에서 새 spec 2개만 돌렸고 나머지는 CI에 맡깁니다.
추가 증거

⌥ held: the Agents list rows carry their number at the right, over the fold slot

The same ⌘ hold in Light: popover background, border and mono digit from the tokens

AI tooling: 대부분 AI 도구; 사람이 대조할 것은 대표 이미지의 키캡 위치와 Review의 세 판단 항목.

Verification record
  • PRD: agents/prd/electron-digit-shortcuts-hints/prd.md (sha256 75217108929150d772e1db1603e2e30c14f18004359c96cb5be735e92f0b5ff8)
  • Base 17a14c0 → head 9a3a606, verified 2026-09-27T14:06:18.848Z: PASS
  • Verification report: agents/runs/electron-digit-shortcuts-hints/verification-report.json and agents/runs/electron-digit-shortcuts-hints/verification-report.md; source fingerprint accbabd3deaa0734e8d5468c9bf849ff68cd8544cd4dfb949ee30da0d23470b0
  • One earlier verify on 9a3a606 failed S1 on hide-agent-hooks/tests/hook_deadline.rs (a 1.5 s wall-clock bound, untouched here) while a reviewer's vitest ran beside it; it passed in isolation (0.28 s) and on the rerun recorded above.
  • Suites:
    • S1: GREEN bash scripts/verify-cargo.sh test (exit 0)
    • S2: GREEN bash scripts/verify-cargo.sh lint (exit 0)
  • Reviews (advisory, native subagents):
    • Fidelity on f9f82ca: Fix now Gate pull requests with a verify workflow and add the contributor surface #1 (Medium) B4/D-02 "재바인딩 규칙은 기존과 같다" read as a promise to rebind the numbered chords; stands unfixed as a recorded assumption for human review (implementor reads it as "the editable set stays the eight pane commands"). Fix now Stamp the app version from the release tag instead of a plist literal #2 (Low-Medium) no coverage of a layer opening mid-hold; fixed in 5a681d2 (context menu and Settings sheet opened while ⌘ held, keycaps asserted gone). Follow-ups: a device-in-front ⌘n regression test, record decision Gate pull requests with a verify workflow and add the contributor surface #1 as an interview decision, a B9 tooltip-plus-keycap capture on a narrow tab.
    • Code on f9f82ca: no Fix now. Follow-ups taken in 5a681d2: narrowing with isNumberedCommand instead of 18 switch cases, endHold skips an idle hold, teardown resets ui.hint. Not taken: a real OS-level blur in the e2e (synthetic blur event kept).
    • Follow-up on 5a681d2 (diff f9f82ca..5a681d2 with the prior context): no Fix now; follow-ups: pin the NO_MODIFIERS reference in a test (taken in bb57299), the double numberedCommand lookup (kept, commented), the human ruling above.
    • Follow-up on bb57299 (diff 5a681d2..bb57299): no Fix now; follow-ups: no focus ring on the close control while its keycap covers it (transient, noted), the double lookup, the human ruling above.
    • Follow-up on the rebased head a5e50ce5 (same commits on origin/main c68e760): range-diff every commit content-identical, no shared file or symbol with the upstream commits; no Fix now. Shipped instead as bb57299 merged with the same origin/main (1731f50) so the run baseline stays; same 22-file diff.
    • Follow-up on 9a3a606 (CI fix, diff 1731f50..9a3a606: web/e2e/s2.spec.ts sheet row count 28 → 30): count verified from the registry, moved count stays 8, no other spec asserts a sheet or Settings row count; no Fix now.
    • Human ruling (Observer, 2026-09-27) on Fidelity Fix now Gate pull requests with a verify workflow and add the contributor surface #1: the numbered chords are fixed and not rebindable, shown read-only in the sheet and Settings; the existing rebinding rules stay; no PRD amend needed.
  • Evidence: 5 registered (5 screenshot); paths are local to the run directory
    • agents/runs/electron-digit-shortcuts-hints/artifacts/e2e-desktop/digit-hints-tabs-dark.png
    • agents/runs/electron-digit-shortcuts-hints/artifacts/e2e-desktop/digit-hints-agents-dark.png
    • agents/runs/electron-digit-shortcuts-hints/artifacts/e2e-desktop/digit-hints-tabs-light.png
    • agents/runs/electron-digit-shortcuts-hints/artifacts/e2e-browser/digit-hints-browser-alt-hold.png
    • agents/runs/electron-digit-shortcuts-hints/artifacts/e2e-browser/digit-hints-browser-sheet.png
  • Changed paths: 25 (see Files changed)

…desktop app

The registry gains select_tab_1..9 (⌘n, the nth tab of the strip in front) and
select_agent_1..9 (⌥n, the nth row the Agents list draws); the browser column
has none, since Chrome keeps ⌘1-9. Holding ⌘ or ⌥ alone for 150 ms floats the
number of each tab or agent row at its top right as a keycap; releasing,
adding a modifier, losing the window, opening a layer or pressing a key
during the hold clears it. The hold is a pure state machine (hints.ts) fed by
the window listener, and the numbers are the screen order (numbering.ts). The
⌘/ sheet folds each family into one row, Settings lists them read-only, and a
pane chord bound onto ⌘n is refused by that command's name.
… in the UI and architecture guides

An Electron spec drives ⌘2, an empty ⌘3, the ⌘ and ⌥ holds (delay, release,
a key during the hold, losing the window) and ⌥2 against a private Herdr and
hided, asserting the tab strip and the agent rows keep their geometry while
the keycaps show; a browser spec asserts no keycap, no tab switch and the
sheet's not-on-this-host rows. UI_BEHAVIOR.md and ARCHITECTURE.md carry the
new behavior and the registry's Electron-only numbered column.
…t on teardown, and cover a layer opening mid-hold

The keyboard listener narrows on the numbered-command type guard so the
command switch needs no list of the eighteen ids; ending a hold that never
started publishes nothing; unmounting the listener clears the revealed
family; and the Electron spec now opens a tab's context menu and the
Settings sheet while ⌘ is held and asserts the keycaps go.
… idle hint reference

The digit takes the close control's corner while ⌘ is held; the control keeps
its space and returns on release. The hold state's idle modifier set is one
shared value, which the listener reads to skip a clear with no hold, and the
unit test now pins that by reference.
The ⌘/ sheet now folds Select tab 1-9 and Select agent 1-9 into one row
each, so the S2 flow expects 30 rows; neither is a Chrome move, so the
eight moved chords stay.
@yansfil
yansfil merged commit adadce7 into main Sep 27, 2026
6 checks passed
@yansfil
yansfil deleted the prd/electron-digit-shortcuts-hints branch September 27, 2026 14:28
yansfil added a commit that referenced this pull request Sep 27, 2026
…th (#208)

Related: PRD `agents/prd/sidebar-typography/prd.md`

## Summary

- Projects 사이드바의 글자가 크기·굵기 단계 없이 비슷해 프로젝트, 체크아웃, 에이전트가 한눈에 갈리지 않았습니다.
- 보드 v7에서 고른 E-mid로 맞췄습니다: 13/600 · 12/400 · 11, 행 높이 프로젝트 36 · 체크아웃
32/48 · 에이전트 28/44, 헤더는 10/500 문장형.
- 체크아웃은 purpose가 있을 때만 두 줄이고, 이름의 첫 `/`까지 접두사는 흐리게 그립니다.
- 사이드바는 Appearance 글자 크기를 따르지 않고, 오른쪽 가장자리를 끌어 220-440 너비를 정하며 코어
`ui_state.sidebar_width`에 저장됩니다(더블클릭은 292).
- Pen 라이브러리 네 마스터와 Screen / Projects Sidebar, 문서 세 개를 같은 수치로 고쳤습니다.

![왼쪽 main, 오른쪽 이 브랜치(292, dark): 프로젝트 13/600, 체크아웃 12/400과 흐린 접두사, 문장형
헤더, 행
높이](https://github.com/yansfil/pr-assets/blob/main/hide/sidebar-typography/8f6a005/before-after-dark-292.png?raw=true)

## Review

- **판단해 주세요**: 대표 이미지에서 11px 둘째 줄(purpose, 시간)이 충분히 읽히는지.
- **판단해 주세요**: 드래그 중에는 사이드바만 가운데 위로 겹쳐 따라오고 가운데와 터미널은 놓을 때 한 번
리사이즈됩니다(포인터 이동마다 PTY 리사이즈를 막으려는 해석).
- **판단해 주세요**: Agents 목록의 그룹 헤더도 같은 10/500 문장형이 됐습니다(같은 마스터 O79KF).
- **판단해 주세요**: D-10은 `--size-compact-agent-row-vpad` 삭제였지만 Pen
`Component / Agent identity`가 참조해 남겼습니다.
- **조심해서 볼 파일**: `herdr-core/src/runtime/events.rs` - runtime mutex 안의
`ui_state_update`; 범위 밖 값은 `last_error`가 아니라 diagnostic으로 거부.
- **조심해서 볼 파일**: `herdr-core/src/persistence.rs` - 저장 형식에
`sidebar_width` 추가, serde default로 이전 저장을 292로 읽음.
- **조심해서 볼 파일**: `web/src/sidebar.tsx` `SidebarEdge` - high-frequency
path; pointermove는 nav의 CSS 변수만 바꾸고 이벤트는 놓을 때 하나.
- **조심해서 볼 파일**: `scripts/gen-tokens.mjs` - 생성 규칙
`.interface-scale-exempt`가 text 토큰을 배율 1로 다시 선언(변수는 선언된 곳에서 풀리므로 nav에
배율만 두면 무효).

## Evidence

- **확인한 것**: 갤러리 12장(dark/light × 220/292/440 × reference/long)을 보드 v7
E-mid, Pen 헤드리스 export와 대조.
- **확인한 것**: 배율 1.25 갤러리 캡처가 배율 1 캡처와 바이트까지 같음(`cmp`); e2e가 글자 크기 17에서
사이드바 글자 크기와 행 기하가 기본값과 같음을 단언.
- **확인한 것**: 격리된 hided + private Herdr e2e가 드래그 중 `ui_state_update`와
`terminal_resize` 0회, 놓을 때 1회, 220/440 경계, 새로고침 유지, 더블클릭 292를 단언.
- **확인한 것**: 코어 테스트 3개(재시작 후 유지, 보낸 값 거부는 로그로, 저장된 범위 밖 값은 292로 열림),
vitest 402, `verify-cargo.sh test`/`lint`, `verify-web.sh`,
`check-design-contract.mjs` 통과.
- **확인하지 못한 것**: Electron 데스크톱 창은 띄우지 않았습니다. 실제 앱 캡처는 격리된 hided가 서빙한 셸을
Playwright Chromium으로 찍은 것입니다.
- **확인하지 못한 것**: 전체 e2e는 66d55015에서 72/73(글자 크기 대기 race 1건)였고, 수정 뒤에는
사이드바 두 스펙만 다시 돌렸습니다.
- **확인하지 못한 것**: 리사이즈 핸들의 키보드 경로는 PRD 비목표라 없습니다.
- **병합**: main의 #207이 체크아웃 둘째 줄에 raised-from 부모를 더해, 둘째 줄은 purpose나 그
부모가 있을 때만 그립니다(에이전트만으로는 한 줄).
- **생성물**: `design/hide-ui.lib.pen`, `design/hide-screens.pen`,
`web/src/tokens.css`는 스크립트 생성 diff입니다(라이브러리는 base JSON에 스크립트로 이식, 구조
diff로 네 마스터와 변수만 바뀜 확인).

<details><summary>추가 증거</summary>

![오른쪽 가장자리를 440 너머로 끌 때: 경계에서 멈추고 놓기 전까지 가운데 위에
그려짐](https://github.com/yansfil/pr-assets/blob/main/hide/sidebar-typography/8f6a005/drag-crop.png?raw=true)

</details>

**AI tooling**: 대부분 AI 도구 - 행 높이와 글자 단계는 사람이 Pen 보드 v1-v7에서 고른 E-mid이고,
캡처를 그 보드와 대조했습니다.

<details><summary>Verification record</summary>

- PRD: `agents/prd/sidebar-typography/prd.md` (sha256
313f696f0cb07ff06dc982ba76c6672046c1fb60a9bc9506a8e8f21b15f975b4)
- Base 7b1ae02 → head 2ddba7f, verified 2026-09-27T15:31:35.649Z: PASS
- Verification report:
`agents/runs/sidebar-typography/verification-report.json` and
`agents/runs/sidebar-typography/verification-report.md`; source
fingerprint
50839c1f5b8c2d8bcd34c1e2e9eb459947cb3ac5536e007468d4477f126f4529
- Suites:
  - S1: GREEN `bash scripts/verify-cargo.sh test` (exit 0)
  - S2: GREEN `bash scripts/verify-cargo.sh lint` (exit 0)
- Reviews:
- Fidelity @ 66d5501: PASS, B1-B16 MET; D-10
편차(`--size-compact-agent-row-vpad` 유지)는 수용; Fix now 없음.
- Code @ 66d5501: FAIL, Fix now 2건. (1) `--size-compact-agent-row-vpad`
삭제 요구: 유지, Pen `Component / Agent identity`(HXWFK) 패딩이 참조하고 그 마스터는 D-11의
네 장 밖. (2) `--size-control-regular` 고아: 522b2dac에서 삭제.
- Code 후속 @ 8f6a005 (diff 66d5501..8f6a005): PASS, 두 처분과 e2e 대기 수정
확인.
- Fidelity 후속 @ 8f6a005 (diff와 실제 앱 캡처 6장): PASS, Fix now 없음; 커서 모양은
캡처가 아니라 e2e의 computed style로 증명됨.
- 병합 후속 @ ebe843e (origin/main의 #205 병합, diff 8f6a005..ebe843e):
PASS, 사이드바 변경과 겹치는 경로 없음, 충돌 해소 편집 없음.
- 병합 후속 @ 2ddba7f (origin/main의 #206/#207/#209 병합, 충돌 4건 해소): PASS, Fix
now 없음. #206 hold 키캡과 #207 raised-from·기기 칩 유지; 체크아웃 둘째 줄은 purpose 또는
raised-from 부모가 있을 때만(에이전트만으로는 한 줄, D-04 유지). Follow-up: PRD D-04 표현에
raised-from 확장 반영(사람 승인 필요).
- Evidence: 22 registered (21 screenshot, 1 log); paths are local to the
run directory
-
agents/runs/sidebar-typography/evidence/gallery/sidebar-dark-220-reference-x1.png
-
agents/runs/sidebar-typography/evidence/gallery/sidebar-dark-220-long-x1.png
-
agents/runs/sidebar-typography/evidence/gallery/sidebar-dark-292-reference-x1.png
-
agents/runs/sidebar-typography/evidence/gallery/sidebar-dark-292-long-x1.png
-
agents/runs/sidebar-typography/evidence/gallery/sidebar-dark-440-reference-x1.png
-
agents/runs/sidebar-typography/evidence/gallery/sidebar-dark-440-long-x1.png
-
agents/runs/sidebar-typography/evidence/gallery/sidebar-light-220-reference-x1.png
-
agents/runs/sidebar-typography/evidence/gallery/sidebar-light-220-long-x1.png
-
agents/runs/sidebar-typography/evidence/gallery/sidebar-light-292-reference-x1.png
-
agents/runs/sidebar-typography/evidence/gallery/sidebar-light-292-long-x1.png
-
agents/runs/sidebar-typography/evidence/gallery/sidebar-light-440-reference-x1.png
-
agents/runs/sidebar-typography/evidence/gallery/sidebar-light-440-long-x1.png
-
agents/runs/sidebar-typography/evidence/gallery/sidebar-dark-292-reference-x1.25.png
  - agents/runs/sidebar-typography/evidence/pen/psb-sidebar-l.png
  - agents/runs/sidebar-typography/evidence/pen/psb-sidebar-d.png
- agents/runs/sidebar-typography/evidence/e2e/projects-sidebar-dark.png
- agents/runs/sidebar-typography/evidence/e2e/projects-sidebar-light.png
-
agents/runs/sidebar-typography/evidence/e2e/projects-sidebar-large-font.png
- agents/runs/sidebar-typography/evidence/e2e/sidebar-width-dragging.png
  - agents/runs/sidebar-typography/evidence/e2e/sidebar-width-440.png
  - agents/runs/sidebar-typography/evidence/e2e/sidebar-width-220.png
-
agents/runs/sidebar-typography/evidence/e2e/full-run-before-race-fix.txt
- Changed paths: 130 (see Files changed)

</details>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant