Skip to content

Agent 탭이 마크로 접히기 전에 세 단계로 연속해서 줄어듭니다 - #329

Merged
yansfil merged 6 commits into
mainfrom
prd/agent-tab-shrink
Oct 3, 2026
Merged

yansfil merged 6 commits into
mainfrom
prd/agent-tab-shrink

Conversation

@yansfil

@yansfil yansfil commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Related: #322 (Agent 탭 부분만; File View 탭 스트립은 #321 이후로 남김) · PRD agents/prd/agent-tab-shrink/prd.md

Summary

  • Agent 탭은 같은 몫이 104px 아래로 내려가는 순간 모든 탭이 40px 마크로 접혀, 탭 6개·공간 약 485px에서 바의 절반 가까이가 비었습니다.
  • 이제 세 단계로 연속해서 줄어듭니다: (1) 모두 min(180, 몫) 제목 -> (2) 선택된 탭 104px 제목 유지, 나머지가 남은 폭을 40px까지 나눔 -> (3) 나머지가 모두 마크가 된 뒤 선택된 탭이 줄고 88px 아래에서 64px 마크+닫기.
  • 104px 미만 비선택 탭은 좁은 여백에 마크와 잘린 제목을 그리고 닫기를 두지 않으며, 64px 아래에서는 마크만 가운데에 그립니다.
  • 판단은 순수 함수 tabStripFit(web/src/areaLayout.ts) 하나가 맡아 iconTabs를 대체합니다. 같은 공간·탭 수에는 리사이즈 방향과 관계없이 같은 결과입니다. 새 토큰은 없습니다.
  • View 탭(column !== "agent" 분기)은 그대로이며, File View 탭에 같은 스트립을 주는 일은 사이드 패널을 Agent Views, File Views, Tools 세 컬럼으로 나눈다 #321 이후로 남깁니다.

2단계: 선택된 탭(zsh)이 104px 제목과 닫기를 지키고 나머지 15개가 남은 폭을 나눠 바 끝까지 채웁니다

Review

  • 판단해 주세요: 압축 상태의 문턱(비선택 64px 미만이면 제목을 숨김, 선택 88px 미만이면 64px 마크)이 실제로 읽히는지. 위 이미지의 2단계 탭 폭(약 76px)에서 제목이 두세 글자만 보입니다.
  • 판단해 주세요: 디자인 후속 - design/hide-ui.lib.pen의 Component / Adaptive Work Tab은 새 압축 상태(잘린 제목, 닫기 없음)를 그리지 않습니다. 이 PR은 .pen을 편집하지 않았습니다.
  • 조심해서 볼 파일: web/src/AreaTree.tsx - high-frequency path. 리사이즈마다 ResizeObserver가 탭 목록에 CSS 변수 두 개를 쓰고, 표시 상태가 바뀔 때만 flushSync로 바를 다시 그립니다. 코어, 와이어, Herdr 경로에는 일이 늘지 않습니다.
  • 조심해서 볼 파일: web/src/AreaTree.tsx readTabStripSizes - failure path. 크기 토큰이 풀리지 않으면 0px 탭 대신 throw합니다(앱에 에러 경계가 없어 화면 전체가 비게 됨; 잘못된 빌드에서만 발생).

Evidence

  • 확인한 것: tabStripFit 단위 테스트 - 폭/탭 수 표 14행, 탭 수 1·2·3·6·16에서 0.5px 단위로 줄이며 폭 연속성(88->64 한 번만 점프)과 바 채움 검사.
  • 확인한 것: e2e/tab-strip-fit.spec.ts를 새 곡선으로 다시 씀 - 격리된 debug hided + 고정 Herdr 0.9.1, Chromium, 탭 16개, 뷰포트 2800->700->2800을 10px 단위로 쓸며 탭마다 폭·제목·닫기를 독립 작성한 곡선과 비교, 양방향 결과 동일, 여섯 단계 모두 관측, 넘칠 때만 스크롤(허용 오차 없음), 선택 탭이 보이는 자리, 다른 탭 클릭 시 104px 이동, 스크롤 단계에서 맨 끝 탭 선택 후 더 좁혀도 보임.
  • 확인한 것: 같은 빌드에서 agent-tab-groups, s2 포함 7개 테스트 통과. 전체 bash scripts/verify-web.sh 통과(아래 기록), node scripts/check-design-contract.mjs 통과.
  • 확인하지 못한 것: 패키지된 앱의 네이티브 화면 확인 - 무인 Mac mini에서 하지 않았고 /Applications/hide.app도 건드리지 않았습니다. 화면 근거는 위 e2e 캡처뿐입니다.
  • 확인하지 못한 것: 좁은 밀도에서의 이름 바꾸기 180px(B10, 빌드된 CSS 우선순위로만 확인), ⌘ 숫자·우클릭·드래그(B11), 툴팁/접근성 이름(B9, diff상 변경 없음), "넘치는 프레임이 한 번도 보이지 않음"(B7, 코드상 layout effect + flushSync로만 근거). 에이전트 마크가 있는 탭과 긴 제목은 픽스처에 없었습니다.
  • 확인하지 못한 것: 리사이즈 성능 측정(scripts/web-shell-measure/run.sh)은 돌리지 않았습니다. 속도 주장은 하지 않으며, 비용 설명은 위 Review 항목이 전부입니다.
  • 환경 원인으로 실패한 verify: 같은 head에서 verify-web.sh가 세 번 plugins/hcoord 테스트에서 멈췄습니다. 하나는 하네스 TMPDIR 아래 유닉스 소켓 경로가 macOS 104바이트 한도를 넘은 것(TMPDIR=/tmp로 해소), 다른 하나는 공유 머신 부하(load average 약 10)에서 herdr agent get spawn ETIMEDOUT입니다. 이 diff는 plugins/hcoord를 건드리지 않으며 부하가 6 아래로 내려간 뒤 통과했습니다.
  • CI 재실행: 첫 실행에서 os contract (windows)만 hide-platform/tests/ipc.rs:109 bytes_travel_both_ways로 실패해 집계 verify도 실패했습니다. 이 diff는 웹만 바꿔 그 경로에 닿지 않고 main db2dad61은 같은 코드로 통과했습니다. 실패한 job만 한 번 다시 돌려(attempt 2) 통과했고, 지금 체크는 모두 통과입니다.
추가 증거

3단계: 나머지가 모두 40px 마크가 된 뒤에야 선택된 탭이 줄어들며 잘린 제목과 닫기를 유지합니다

마크로도 넘칠 때만 스크롤하고 선택된 탭은 64px 마크와 닫기로 남습니다

Verification record
  • PRD: agents/prd/agent-tab-shrink/prd.md (sha256 9345590a3d687faa2c3072e50b021f8098526fab57eb778bb51961a284ae4c53)
  • Base c8bb9c0 → head e2affb5, verified 2026-10-02T09:25:21.322Z: PASS
  • Verification report: agents/runs/agent-tab-shrink/verification-report.json and agents/runs/agent-tab-shrink/verification-report.md; source fingerprint 9b6d0b6b6ad34b8d5f0523340ce791bd931aafcf59de7a82ca01c0d7be7b5bbe
  • Suites:
    • S1: EXCLUDED bash scripts/verify-cargo.sh test
    • S2: GREEN bash scripts/verify-web.sh (exit 0)
    • S3: EXCLUDED bash scripts/verify-cargo.sh lint
  • Reviews:
    • Fidelity: deda702 -> 8784fa2 -> 37a9741 검토, Fix now 없음. Follow-up: B6 클릭 직후 확인은 Playwright 자동 스크롤로 약함, e2e 곡선이 코드 분기를 따라 씀, 에이전트 마크/긴 제목 픽스처 없음, .pen 후속, 네이티브 캡처 없음.
    • 두 리뷰 모두 최종 head e2affb5(37a9741 + origin/main db2dad6 병합, 리뷰한 rebase 결과 00d7d316과 트리 동일)까지 재확인, 변경 없음.
    • Code: deda7027에서 Fix now 2건(토큰 미해결 시 0px 탭 / 반올림된 room의 1px 미만 넘침) -> 8784fa28에서 둘 다 수정(토큰 없으면 throw, 소수 경계 내림). Follow-up이던 리사이즈당 재렌더 비용도 반영(폭을 탭 목록 CSS 변수로, fit 바뀔 때만 렌더). 8784fa2, 37a9741 재검토 Fix now 없음. 남은 Follow-up: 공용 throwing tokenPx, 에러 경계, cssVariables 테스트의 setProperty 인식, 압축 탭 위 keycap, 넘침 중 이름 바꾸기 reveal.
  • Evidence: 8 registered (7 screenshot, 1 log); paths are local to the run directory
    • agents/runs/agent-tab-shrink/e2e-shots/crops/tab-strip-fit-others-compact.png
    • agents/runs/agent-tab-shrink/e2e-shots/crops/tab-strip-fit-others-marks.png
    • agents/runs/agent-tab-shrink/e2e-shots/crops/tab-strip-fit-selected-compact.png
    • agents/runs/agent-tab-shrink/e2e-shots/crops/tab-strip-fit-selected-marks.png
    • agents/runs/agent-tab-shrink/e2e-shots/crops/tab-strip-fit-scroll.png
    • agents/runs/agent-tab-shrink/e2e-shots/crops/tab-strip-fit-titled.png
    • agents/runs/agent-tab-shrink/e2e-shots/crops/tab-strip-fit-preferred.png
    • agents/runs/agent-tab-shrink/e2e-tabs.log
  • Changed paths: 25 (see Files changed)

같은 몫이 104px 아래로 내려가는 순간 모든 탭을 40px 마크로 접던 iconTabs를
tabStripFit 하나로 바꿉니다. 같은 몫이 제목 최소폭을 넘는 동안은 모든 탭이
같이 줄고, 그 아래에서는 선택된 탭이 104px 제목을 지키며 나머지가 남은 공간을
40px까지 나눕니다. 나머지가 모두 마크가 된 뒤에야 선택된 탭이 줄고, 88px
아래에서 64px 마크와 닫기로 바뀝니다. 104px 미만 비선택 탭은 좁은 여백에
잘린 제목을 그리고 닫기 컨트롤을 두지 않습니다.

폭은 같은 공간과 탭 수에 늘 같은 값을 내는 순수 함수가 정하고, Agent 바는
결과가 바뀔 때만 다시 그립니다. View 탭 동작은 그대로입니다(#321).
리사이즈마다 바 전체를 다시 그리지 않도록 선택된 탭과 나머지 탭의 폭을
ResizeObserver가 탭 목록에 직접 쓰고, 표시 상태가 바뀔 때만 다시 그립니다.
공간은 소수 경계를 내림해 재므로 탭이 바를 1px 미만으로 넘치지 않습니다.
크기 토큰이 풀리지 않으면 0px 탭 대신 오류를 냅니다. e2e는 스크롤 판정에서
허용 오차를 없애고, 마크도 넘칠 때 맨 끝 탭을 선택해도 보이는지 확인합니다.
cssVariables.test.ts는 소스가 읽는 변수마다 스타일시트 선언이나 소스의 인라인
설정을 요구합니다. 두 폭 변수를 이름을 키로 둔 객체로 써서 그 계약을 따릅니다.
@yansfil
yansfil merged commit 82e694c into main Oct 3, 2026
39 of 41 checks passed
@yansfil
yansfil deleted the prd/agent-tab-shrink branch October 3, 2026 05:06
yansfil added a commit that referenced this pull request Oct 4, 2026
Related: #329, #361, #386, #387
Closes #322

## Summary

- File View도 Agent와 같은 연속 축소 계산과 탭 슬롯을 사용합니다.
- 선택 탭이 제목과 닫기를 가장 오래 유지하며, 최소 마크 폭까지 모자랄 때만 스크롤합니다.
- 기본은 기존 파일 타입 아이콘이며, 전체 이름과 저장 상태는 툴팁·접근성 이름에 남습니다.
- 새 문구는 네 언어에 추가했고 `docs/UI_BEHAVIOR.md`를 갱신했습니다.

![같은 폭에서 main과 변경 화면
비교](https://github.com/user-attachments/assets/87dcc0e7-940e-4861-bedd-69565a884caa)
같은 12개 파일과 영역 폭입니다. 변경 후에는 선택 제목을 남기면서 나머지 파일도 스트립 안에 들어옵니다.

## Review

- **질문**: 최소 상태는 A 파일 타입, B 확장자, C 이름 앞글자 중 무엇을 쓸까요? 기존 패턴인 A를 구현했습니다.
- B/C는 같은 실행 화면에서 최소 상태의 마크만 바꾼 제안입니다. `collapsedDisplayMark` 한 곳에서 교체할
수 있습니다.

![최소 밀도 후보 세
가지](https://github.com/user-attachments/assets/324c3c99-2142-4610-9186-ebd2549c115c)

- **조심해서 볼 파일**: `AreaTree.tsx`의 크기 관찰을 View에도 적용합니다. 공유 계산과 Agent 동작은
유지합니다.
- **비용 검토**: 보이는 View 영역당 ResizeObserver 하나를 추가합니다. 콜백은 경계 두 번 읽기와 CSS 폭
두 번 쓰기입니다.
- 밀도가 바뀔 때만 렌더하며 core 이벤트·PTY 리사이즈를 보내지 않습니다. 최대 6개 영역이고 언마운트 때 해제합니다.

## Evidence

- 수정 전 실제 e2e에서 File 탭이 104px에 멈추는 실패를 확인했습니다. 수정 후 독립 폭 계산과 실제 DOM이
일치합니다.
- `verify-web.sh` 전체 통과: web 942개, desktop 99개 단위 테스트와 타입·lint·빌드,
hcoord 검사 포함.
- 관련 e2e 5개 통과: Agent 연속 축소, File 12탭의 밀도·선택·스크롤·닫기, 미리보기, 좁은 화면, 컬럼 토글.
- 사설 Herdr와 격리된 Electron의 정확한 창 캡처로 축소·미저장 마크를 확인했고, 후보는 두 테마와 한·중·일
이름으로 비교했습니다.
- 디자인 계약, harness 비공개 경계, 공개 소스의 워크스테이션 식별 정보 검사가 통과했습니다.
- **확인하지 못한 것**: 아이콘 최종 선택은 사람의 판단이 남아 있습니다. Windows/Linux 네이티브 UI와 전체
e2e는 실행하지 않았습니다.
- 기존 desktop 단위 테스트의 3개 skip은 그대로이며 이번 변경의 e2e에는 skip·재시도·시간 제한 변경이
없습니다.

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

밝은 테마에서도 같은 세 후보를 비교했습니다.
![밝은 테마
후보](https://github.com/user-attachments/assets/de4033b5-cc99-4d15-8bdd-84c4db451633)

</details>
yansfil added a commit that referenced this pull request Oct 30, 2026
…s and a Windows Node warm-up (#1863)

Closes with-hide/hide-private#331
Closes with-hide/hide-private#332
Closes with-hide/hide-private#333
Closes with-hide/hide-private#338
Closes with-hide/hide-private#329

## Summary

Six flaky tests in five crates came from three causes, and each is fixed
once for its class.
- Tests read through a product time budget they are not about: Memory
reads were cut at the hook's 100 ms and returned no cards, and the usage
store's 250 ms step cut a 40,000-row prune.
A Memory read now has no deadline of its own (the 100 ms stays in the
hook alone), and the usage store's tests hold its clock still.
- Fixture `git` read the account's settings, so a commit failed whenever
the commit-signing agent did not answer; the fixtures now read no global
or system git file.
- The Windows Node test warmed Node with `--version`, which skips most
of Node's start, so the guarded run still paid the slow first start; the
warm-up now runs the same script.

Per issue:

| Issue | Handling |
| --- | --- |
| #331 usage store prune | Cause fixed: store budgets measured on an
injected clock; store tests open it on a still one |
| #332 herdr-core memory tests | Cause fixed: `MemoryStore::retrieve`
has no deadline; memory_hook tests use `answer_until` with a still clock
|
| #338 hide-memory store tests | Same cause as #332, same fix; the store
and hook tests in its latest comments read through
`retrieve_with_expiry`, which no longer adds a wall clock of its own |
| #333 hide-host fixture commit | Cause fixed:
`GIT_CONFIG_GLOBAL=/dev/null`, `GIT_CONFIG_NOSYSTEM=1`; four other
fixtures with the same inheritance too |
| #329 hide-kit Windows Node | Cause fixed: the first start runs the
guarded script, not `--version` |
| #334 omp observed false | Stays open by the lead's decision: the
helper's 1.2 s send budget is in another process; the failure now prints
the time, the recorded cause and the stand-in's calls |

The Windows process end (with-hide/hide-private#327) was in this pull
request and moved to a pull request of its own; its commits here are
taken back out, so `hide-platform`, `hide-ai`'s omp test and its
documentation are as on main.

스크린샷 없음: no screen changes.

## Review

- **조심해서 볼 파일**:
- `hide-memory/src/store.rs`, `hide-memory/src/hook.rs` -
`RetrievalQuery.deadline` is removed. The product's only Memory reader
is the hook (`hook::context_for` and `herdr_core::memory_hook::answer`,
both through `hide_memory::hook::within_hook_budget`, which adds the 100
ms); every `retrieve` call left is in a test.
- `herdr-core/src/usage_ledger/store.rs` - `Store` carries `clock: fn()
-> Instant`; `open` passes `Instant::now`, so product timing is
unchanged.
- `hide-host/src/worktrees.rs` and four test fixtures - git runs with no
global or system configuration file.
- **질문**: #329's readying pays Node's first full start before the 30 s
guard; the test is about the environment the kit hands Node (it aborts
without `SystemRoot`), not its start time. If a cold first start is ever
the operator's own concern, that is a separate product issue.

## Evidence

- **확인한 것**:
- Local macOS at load 30 to 84: `hide-memory --lib` 205/205 four times
(the parallel run that failed in #338), `hide-host --lib` 154/154,
`herdr-core --lib` usage_ledger, memory_hook, project_memory,
memory_analysis and real_agent_trust 135/135, `hide-agent-hooks`
adapter_contract and codex_binary 6/6.
- Windows CI on 7af7724 and 6fe4f39: every Rust suite of `windows
check` passed, including the hide-kit Node test (#329).
- `clippy --all-targets -D warnings` clean for hide-memory, herdr-core,
hide-host, hide-kit, hide-agent-hooks, hide-ai on macOS.
- **확인하지 못한 것**:
  - Windows tests run only on PR CI; this Mac cannot run them.
  - #334 is not fixed; it fails less silently.
- `windows check` failures seen on this branch were outside its diff:
two web unit tests timing out at 5 s together (open
with-hide/hide-private#354, commented there) and a web unit suite that
could not rename a fixture program another worker built (filed as
with-hide/hide-private#371).
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