Repository navigation
feat(sidebar): 에이전트 목록 우클릭으로 탭 닫기 - #672
Closed
WOULDU-pres wants to merge 1 commit into
Closed
WOULDU-pres wants to merge 1 commit into
WOULDU-pres wants to merge 1 commit into
Conversation
사이드바 Agents 목록의 행을 우클릭(메뉴 키, Shift+F10 포함)하면 "탭 닫기" 메뉴가 열리고, 그 에이전트가 실행 중인 herdr 탭을 닫는다. - 닫기 규칙을 lib/tabClose.ts(tabCloseCost)로 빼서 TabStrip과 함께 쓴다. 워크스페이스의 마지막 탭이거나 작업 중인 에이전트가 있으면 먼저 묻고, 에이전트 행에서는 탭에 다른 패널이 함께 있을 때도 묻는다. - 요청은 그 행이 속한 PC의 MachineContext 안에서 useMachineApi로 보낸다. - 연결되지 않은 PC의 행은 브라우저 기본 메뉴를 그대로 둔다. - 데모 회귀 스크립트(agent-tab-close-demo-regression.ts)를 추가하고 CI 브라우저 레인에 등록했다. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Owner
|
Thanks for this. The problem it set out to solve, that a workspace with one tab had no tab strip to close it from, is fixed on |
devswha
added a commit
that referenced
this pull request
Oct 11, 2026
## Change 사이드바 **Agents** 목록에서 같은 워크스페이스의 에이전트를 **테두리 카드** 하나로 묶습니다. 지금도 Workspaces 순서에서는 같은 워크스페이스의 에이전트가 붙어 있지만, 경계가 보이지 않습니다. 그래서 행마다 두 번째 줄에 워크스페이스 이름이 반복되고, 어디까지가 한 워크스페이스인지 이름을 읽어야만 알 수 있었습니다. ### 모습 - 카드는 `--hairline` `--border` 테두리, `--radius-lg`, 안쪽 여백 `--space-1`, 카드 사이 `--space-2`이고 **채움은 없습니다**. 그래서 행의 hover와 선택 채움이 카드 밖에서와 똑같이 보입니다. - 카드에 채움을 깔면 hover 채움(bg-hover 50%)과 세기가 비슷해져서 안에서 hover가 흐려지기 때문에, 테두리만 썼습니다. - 카드 머리글은 `--space-6` 높이의 한 줄입니다. 앞 칸에 `--space-4` 폴더, 그 옆에 워크스페이스 이름을 `--text-dim` `--fs-xs`로 씁니다. PC가 2대 이상이면 `PC · 워크스페이스`로 씁니다(지금 두 번째 줄의 규칙과 같습니다). - 머리글은 이름일 뿐 **컨트롤이 아닙니다**. 행은 pane을 열고, 워크스페이스는 위쪽 목록이 엽니다. - 에이전트가 하나뿐인 워크스페이스도 카드로 묶습니다. 모양을 일관되게 하려는 것입니다. ### 두 번째 줄 - 카드 안의 행은 두 번째 줄에서 PC와 워크스페이스를 뺍니다. 예: `claude · checkout-api · Tab 1` → `claude · Tab 1` - 위치 정보는 사라지지 않습니다. 툴팁에는 그대로 남고, 스크린리더에서는 카드의 목록이 머리글을 이름으로 갖습니다(`<ul aria-labelledby>`). - 규칙은 `agentContext`의 `grouped` 옵션입니다. 탭 이름이 워크스페이스 이름과 같으면 지금처럼 생략합니다. ### Activity 순서 **Activity** 순서는 워크스페이스를 섞어 놓으므로 카드를 그리지 않습니다. 지금처럼 평평한 목록이고, 행마다 자기 위치를 씁니다. 묶음을 유지하면서 묶음 순서를 바꾸는 방법도 검토했습니다. 하지만 그러면 "가장 최근 것이 위"라는 Activity의 의미가 깨져서 하지 않았습니다. ### 바뀐 파일 - `src/lib/sidebarAgents.ts`(+ 테스트): `groupRows`(키별로 묶되 첫 행의 자리를 지킴), `agentContext`의 `grouped` - `src/components/AgentSidebar.tsx`, `AgentSidebar.css`: 카드와 머리글. 행 그리기를 `agentItem`으로 뺐습니다(행 DOM, `data-machine`/`data-pane`, 클래스는 그대로입니다). - `scripts/sidebar-activity-demo-regression.ts`: 카드 확인을 추가했습니다(아래 Validation). - `DESIGN.md`, `src/AGENTS.md`, `CHANGELOG.md`(Unreleased → Changed) 새 `t()` 문자열, 서버 계약, 설정 항목은 없습니다. ### #672와의 관계 #672(에이전트 행 우클릭으로 탭 닫기)도 `AgentSidebar.tsx`를 크게 고칩니다. 먼저 머지되는 쪽에 맞춰 나머지를 rebase하겠습니다. 합칠 때는 #672의 행 메뉴 부제목(`RowMenu subtitle`)이 줄어든 `context`가 아니라 전체 위치(`place`)를 써야 합니다. 그래야 카드 안 행의 메뉴에도 워크스페이스 이름이 나옵니다. ## Validation - `bun run check fast`: 통과(workflow syntax, generated types, typecheck, build, unit tests 2012 pass / 0 fail) - `HERDR_TEST_MODE=unit bun test ./src/lib/sidebarAgents.test.ts`: 17 pass - `groupRows`: herdr가 pane을 어떤 순서로 주든 워크스페이스마다 묶음이 하나이고 herdr의 순서를 지킴. 첫 행의 자리와 묶음 안 순서를 지킴 - `agentContext` `grouped`: PC와 워크스페이스를 빼고, 탭이 워크스페이스와 같으면 여전히 생략 - `bun scripts/sidebar-activity-demo-regression.ts`(데모 transport, herdr 불필요): 통과 - 기본(Workspaces) 순서: 카드 이름이 `checkout-api, web-dashboard, infra, docs-site, cli-tools`. 카드 안 행의 두 번째 줄에는 워크스페이스가 없고, 툴팁에는 있음. 카드의 목록이 머리글로 레이블됨 - Activity 순서: 카드 0개, 행의 두 번째 줄에 워크스페이스가 있음 - 기존 순서와 DONE 검사 그대로 통과 - `bun run check run bun scripts/ui-regression.ts`(격리 herdr 세션): 93개 모두 PASS - Agents 목록 확인: `PASS Agents excludes shells, survives PC folds, selects its machine target and disables offline rows`(카드 안 행의 선택, PC 대상, 오프라인 비활성) 검증 범위: - **브라우저에서 확인:** PC 1대일 때의 카드, 머리글, 두 번째 줄, aria-labelledby. Activity에서 카드가 없는 것. 다크와 라이트 테마. 한국어 UI - **단위 테스트로만 확인:** 묶음 로직과 두 번째 줄 규칙 - **확인하지 않음:** PC 2대일 때의 `PC · 워크스페이스` 머리글을 브라우저로 보지 않았습니다. 데모는 PC가 1대뿐입니다. 스크린샷(데모 세션, 1280×1000 @2x, checkout-api에 탭 두 개와 에이전트 두 개를 더 띄운 상태): | Workspaces 순서 (다크) | Workspaces 순서 (라이트) | Activity 순서 (카드 없음) | | --- | --- | --- | | <img width="320" alt="Agents 목록: checkout-api 카드에 에이전트 셋, 나머지 워크스페이스는 하나씩" src="https://github.com/user-attachments/assets/df722183-810a-42d5-a567-102502b00b4e" /> | <img width="320" alt="라이트 테마의 같은 화면" src="https://github.com/user-attachments/assets/d00cc2fd-727e-422b-8058-b67c6196d56e" /> | <img width="320" alt="Activity 순서: 카드 없이 평평한 목록, 행마다 워크스페이스를 씀" src="https://github.com/user-attachments/assets/91e8e373-3cc0-4729-bdfc-1b364dc668e0" /> | 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <[email protected]> Co-authored-by: Hako <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Change
사이드바 Agents 목록의 에이전트 행을 우클릭하면 메뉴가 열리고, 탭 닫기(Close tab) 를 고르면 그 에이전트가 실행 중인 herdr 탭을 닫습니다. 지금까지는 탭을 닫으려면 그 에이전트를 열고 위쪽 탭 줄로 가야 했고, 탭이 하나뿐인 워크스페이스에서는 탭 줄이 보이지 않아 워크스페이스 메뉴를 거쳐야 했습니다.
무엇을 닫는지
POST /api/tab/close, 기존 엔드포인트). 새 서버 계약은 없습니다.언제 묻고, 언제 바로 닫는지
닫기 규칙을
src/lib/tabClose.ts의tabCloseCost로 빼서 TabStrip과 에이전트 행이 함께 씁니다. TabStrip의 동작은 그대로입니다.It holds {n} panes, and they all close with it.)role="alert"줄로 6초 동안 보여 줍니다.여러 PC
Agents 목록은 모든 PC의 에이전트를 함께 보여 줍니다. 메뉴와 대화상자는 그 행이 속한 PC의
MachineContext.Provider안에서 그려지고, 요청은useMachineApi().closeTab으로 그 PC에 갑니다. 열린 메뉴는 PC id와 pane/tab id만 들고 있고, 실행할 때 그 PC의 최신 스냅샷을 다시 읽습니다. 다른 곳에서 pane이나 탭이 닫히거나 PC 연결이 끊기면 메뉴와 대화상자도 함께 닫힙니다.입력 방법
바뀐 파일
src/components/AgentSidebar.tsx,AgentSidebar.css: 행 메뉴, 확인 대화상자, 오류 줄src/lib/tabClose.ts(+ 테스트): 닫기 규칙src/components/TabStrip.tsx: 같은 규칙 사용(동작 변화 없음)src/lib/i18n.{ko,ja,zh}.ts: 새 문자열 1개DESIGN.md,src/AGENTS.md,docs/development.md,CHANGELOG.md(Unreleased → Added)scripts/agent-tab-close-demo-regression.ts: 새 데모 회귀 스크립트,scripts/ci-browser.sh에 등록(ci-browser.test.ts의 스크립트 수 19 → 20)Validation
bun run generate:types --check,bun run typecheck,bun run build,bun run test:unit: 통과HERDR_TEST_MODE=unit bun test ./src/lib/tabClose.test.ts: 마지막 탭, busy, split(에이전트 행에서만), 바로 닫는 경우bun scripts/agent-tab-close-demo-regression.ts(데모 transport, herdr 불필요): 통과Close tab Idempotent payments?, 본문은 last-tab 문구. 취소하면 그대로 남고 포커스가 행으로 돌아옴. 확인하면 에이전트 행과 워크스페이스 행이 함께 사라짐bun scripts/sidebar-activity-demo-regression.ts: 통과(기존 Agents 목록 동작 회귀 없음)bun scripts/ui-regression.ts(격리 세션herdr-web-ui-test, herdr 0.9.3): Safari IME 재생 검사(terminal-safari-ime-regression.ts) 하나를 빼고 92개 PASSPASS a tab is renamed by a double-click, F2 and its menu, and closed from its x and Delete, asking first while its agent worksPASS Agents excludes shells, survives PC folds, selects its machine target and disables offline rowsterminal-safari-ime-regression.ts는 이 PC(WSL2, lockfile의 Playwright Chromium)에서 이 PR 이전의origin/main(13ca352)에서도 똑같이 실패합니다('abcㅎ' !== 'abc', provisional Hangul must stay local). 이 PR과는 무관한 실패라 그 검사만 빼고 나머지를 끝까지 돌렸습니다.검증 범위:
/api/tab/close는 focus를 갱신하지 않습니다. 이 경우는 선택된 pane이 스냅샷에서 사라질 때 herdr의 focus로 돌아가는 App의 기존 동작에 맡깁니다.스크린샷(데모 세션, 1280×800 @2x):
English UI
🤖 Generated with Claude Code