feat(ui): context panel 2.0 - surface rail, changes-first git view, live PR surface (#2418)

* feat(ui): add context surface registry and rail switcher

* feat(ui): move git and project notes into context surfaces, embed editor file tree

* feat(ui): replace right sidebar with context surfaces, per-surface panel widths

* refactor(ui): retire legacy main-tab overlays and right-sidebar state

* feat(ui): rail polish, right-docked file tree, terminal surface

* feat(ui): move terminal into context surface, per-surface tab closing, editor empty state

* feat(ui): tune default rail order and activity dot

* fix(ui): keep context panel controls anchored during width animations

* feat(ui): lazy-follow context panel resize with window-level drag tracking

* feat(ui): panel dividers, right-dock tree icon, muted outline folder icons

* feat(ui): restructure git view into changes-first surface with standalone PR surface

- Remove commit/update/pr tabs; git view is always changes + commit
- Promote pull request to its own rail surface with shared repo context
- Move update-branch and re-integrate flows into separate dialogs
- Add PR status chip and repo actions menu to the git header row
- Seed new PR-status entries from resolved sibling remotes to avoid
  a false "checking status" state when the PR is already known
- History/graph dialog refresh button, fingerprint global identity icon,
  muted outline folder icons follow-ups

* feat(ui): progressive-disclosure PR surface with live checks and pinned chat context

- Segment the PR surface into Overview / Checks / Comments pill tabs with
  live badges; merge controls move to the status row
- Live checks segment: progress bar, per-run rows with workflow names,
  elapsed timers, expandable failures, auto-refresh while pending
- PR comments and failed checks pin as chat-context drafts (like terminal
  selections) instead of sending an immediate message; works on new-session
  drafts too
- Shared prContext cache client+server, ETag conditional requests in the
  octokit wrapper (304s bypass rate limits), extended checks aggregate
  (inProgress/queued/startedAt)
- Resolve gh-CLI auth login for merge-permission checks
- Full-width description editor with matched control heights

* fix(ui): single source of truth for PR checks and status readers

- Derive the checks aggregate from the visible run list and sync it into
  the PR-status store so bar, badges, header, and git-view chip agree
- Route PR body hydration through the shared context cache
- Git-view PR chip reads the freshest entry across remote keys

* fix(github): freshness stamps prevent stale cache responses from regressing PR state

- pr/status and pulls/context responses carry a server-side fetchedAt that
  survives cache serves
- The status store rejects responses older than the held snapshot (only
  clearing the loading flag), and the checks sync adopts the context's
  stamp so stale status polls cannot flip fresher derived checks
- Regression test for the stale-response guard

* perf(github): repo-level pull-list cache collapses per-branch PR resolution

- One pulls.list per repo per state per 45s answers every branch (10
  worktrees = 1 call, not 10 query fans); in-flight fetches coalesce
- A complete repo list makes a no-PR miss authoritative, skipping the
  per-owner head queries AND the Search API fallback (the 30/min killer)
- force refresh bypasses the repo list cache; PR create/merge/ready
  invalidate it

* perf(github): back off Search API misses per repo+branch

A branch without a PR re-searched on every poll; with >100 closed PRs the
list miss is never authoritative, so the search fallback still ran and
burned the 30/min search quota. Remember misses for 10 minutes; PR
creation clears remembered misses for the repo.

* fix(github): dedupe re-run check runs to the latest per (app, name)

listForRef returns the superseded completed run alongside its re-run;
GitHub's UI shows only the latest per name. Mirror that in both pr/status
and pulls/context so counts and run lists match github.com.

* fix(ui): address review findings on registry test, surface docs, and PR-context keys

- Rail-order test asserts against the registry itself (was stale after the
  'pr' surface landed and failed)
- surfaces DOCUMENTATION.md describes actual behavior: has-content surfaces
  hide until content exists; only multi-instance/terminal panes are
  keep-alive, singleton surfaces remount and restore from stores
- PR-context cache keys are runtime-scoped JSON tuples; invalidation
  compares the directory exactly instead of by string prefix (+ test)

* fix(ui): wrap long unbreakable tokens in check-run details

Annotation messages with long SHAs/URLs overflowed the panel; break-words
on annotation title/message/rawDetails and output summary/text, and the
expanded run body clips instead of widening the panel.

* fix(ui): busy state for context-attach buttons and honest attach labels

- 'Attach failed checks' / 'Attach all to chat' show a spinner and disable
  while the context request runs (previously nothing happened for seconds)
- Action labels/tooltips reworded from send-to-agent to attach-to-chat
  semantics across all locales

* fix(i18n): Ukrainian attach wording uses 'прикріпити' with proper cases

* fix(ui): runtime-scope PR-view remote caches, correct surfaces doc on preview

- Remote/remote-url caches in PullRequestView are keyed by runtime +
  directory so a backend switch never serves another runtime's remotes
- surfaces DOCUMENTATION.md: preview is not keep-alive; preview tabs
  remount on switch like singleton surfaces

* fix(ui): rail active color, clearer collapse icon, remove dead bottom-terminal dock

Design-review feedback on the context panel:

- Context rail: icons enlarged 16px -> 18px; the active surface is now
  highlighted with the primary color only (no background, no scale
  animation), replacing the previous scale-up effect that read as a
  resize rather than a selected state.
- Files tree: the icon-only 'collapse all folders' toolbar button now
  uses collapse-vertical instead of contract-up-down, which was easily
  mistaken for a close button. The labelled 'Collapse all' dropdown item
  in the session sidebar keeps its icon since text removes the ambiguity.
- Terminal: removed the leftover bottom-dock expand/close buttons that
  rendered in the context-panel terminal but controlled a dock that no
  longer exists (nothing toggles it anymore), so the expand button
  appeared to do nothing and duplicated the panel-header fullscreen
  control. Cleaned up the entire inert layer with it: four useUIStore
  fields (isBottomTerminalOpen/Expanded, bottomTerminalHeight,
  hasManuallyResizedBottomTerminal), five actions, their persistence,
  the MainLayout resize listener that only served the dock height, the
  dock-driven refit effect in TerminalView, and the
  terminalView.bottomDock.* keys across all 10 locale dictionaries.

Validated: ui type-check and lint clean; messages parity test (2 pass)
and useUIStore contextPanel test (13 pass) green; icon sprite
regenerated via icons:generate.

* refactor: use PR visual state for git header icon

Derives the pull request icon color from a single visual state
Covers merged, closed, draft, blocked, and open PR states
Removes conditional class handling from the git header icon
This commit is contained in:
Bohdan Triapitsyn
2026-07-27 23:07:42 +03:00
committed by GitHub
parent 005b2e61b0
commit e2fa7dbad2
67 changed files with 3767 additions and 2347 deletions
+39 -22
View File
@@ -8,6 +8,10 @@ export const dict: Record<I18nKey, string> = {
'chat.message.terminalContext': '{terminal}, {start}-{end}행',
'chat.chatInput.terminalContext': '{terminal}, {start}-{end}행',
'chat.chatInput.terminalContextRemove': '터미널 컨텍스트 제거',
'chat.chatInput.prCommentContext': 'PR 댓글',
'chat.chatInput.prCommentContextRemove': 'PR 댓글 컨텍스트 제거',
'chat.chatInput.prCheckContext': '실패한 PR 체크',
'chat.chatInput.prCheckContextRemove': 'PR 체크 컨텍스트 제거',
'common.loading': '로딩 중...',
'common.unavailable': '사용할 수 없음',
'common.language.english': '영어',
@@ -709,6 +713,8 @@ export const dict: Record<I18nKey, string> = {
'gitView.header.noIdentity': '인증 정보 없음',
'gitView.header.noProfiles': '적용할 프로필 없음',
'gitView.header.repositoryViews': '저장소 보기',
'gitView.header.updateBranch': '브랜치 업데이트',
'gitView.header.openPullRequest': '풀 리퀘스트 열기',
'gitView.header.removeRemoteAria': '리모트 제거',
'gitView.header.removeRemoteTitle': '리모트 제거',
'gitView.header.upstreamSynced': '동기화됨',
@@ -760,6 +766,7 @@ export const dict: Record<I18nKey, string> = {
'gitView.history.renamedNoDiff': '이름 변경된 파일 — diff 미지원',
'gitView.history.renderDiffAnyway': '그래도 렌더링',
'gitView.history.title': '히스토리',
'gitView.history.refresh': '새로고침',
'gitView.graph.title': '그래프',
'gitView.integrate.checking': '확인 중…',
'gitView.integrate.cherryPickAbortedToast': 'Cherry-pick이 중단되었습니다',
@@ -894,15 +901,15 @@ export const dict: Record<I18nKey, string> = {
'gitView.pr.actions.openOnGitHubAria': 'GitHub에서 PR 열기',
'gitView.pr.actions.openSettings': '설정 열기',
'gitView.pr.actions.repo': '레포지토리',
'gitView.pr.actions.resolveFailedChecks': '실패한 체크 해결',
'gitView.pr.actions.resolveFailedChecksAria': '실패한 검사를 에이전트에 보내기',
'gitView.pr.actions.resolveFailedChecks': '실패한 체크 첨부',
'gitView.pr.actions.resolveFailedChecksAria': '실패한 체크를 채팅 컨텍스트에 첨부',
'gitView.pr.actions.savePr': '저장 PR',
'gitView.pr.actions.savePrAria': 'PR 변경 사항 저장',
'gitView.pr.actions.sendCommentToAgent': '보내기 댓글로 에이전트',
'gitView.pr.actions.sendCommentToAgentAria': '이 댓글을 에이전트에 보내기',
'gitView.pr.actions.sendToAgent': '보내기로 에이전트',
'gitView.pr.actions.shareComments': '댓글 공유',
'gitView.pr.actions.shareCommentsAria': '보내기 PR 댓글로 에이전트',
'gitView.pr.actions.sendCommentToAgent': '댓글을 채팅 컨텍스트에 첨부',
'gitView.pr.actions.sendCommentToAgentAria': '이 댓글을 채팅 컨텍스트에 첨부',
'gitView.pr.actions.sendToAgent': '채팅에 첨부',
'gitView.pr.actions.shareComments': '댓글 첨부',
'gitView.pr.actions.shareCommentsAria': '풀 리퀘스트 댓글을 채팅 컨텍스트에 첨부',
'gitView.pr.actions.toggleDraftAria': '드래프트 상태 전환',
'gitView.pr.actions.refresh': 'PR 상태 새로고침',
'gitView.pr.actions.refreshAria': '풀 리퀘스트 상태 새로고침',
@@ -940,6 +947,10 @@ export const dict: Record<I18nKey, string> = {
'gitView.pr.noMergePermission': '이 PR을 병합할 권한이 없습니다.',
'gitView.pr.notMergeable': '병합 불가',
'gitView.pr.numberLabel': 'PR #{number}',
'gitView.pr.segment.overview': '개요',
'gitView.pr.segment.checks': '체크',
'gitView.pr.segment.comments': '댓글',
'gitView.pr.comments.addAll': '모두 채팅에 첨부',
'gitView.pr.placeholder.additionalContext': '제약 사항, 배포 메모 또는 리뷰어 참고사항을 입력하세요…',
'gitView.pr.placeholder.description': '변경 사항 설명…',
'gitView.pr.placeholder.main': 'PR 요약',
@@ -974,9 +985,6 @@ export const dict: Record<I18nKey, string> = {
'gitView.pullRequest.createHint': '이 브랜치에서 PR을 만들고 관리하세요.',
'gitView.pullRequest.availableOnFeatureBranches': '현재 브랜치에서 PR을 열 수 있을 때 사용할 수 있습니다.',
'gitView.pullRequest.title': 'PR',
'gitView.tabs.commit': '커밋',
'gitView.tabs.pr': 'PR',
'gitView.tabs.update': '업데이트',
'gitView.tabs.worktree': '워크트리',
'gitView.toast.abortOperationFailed': '작업 중단 실패',
'gitView.toast.appliedIdentity': '인증 정보를 적용했습니다: {name}',
@@ -1043,9 +1051,26 @@ export const dict: Record<I18nKey, string> = {
'contextPanel.mode.stagedDiff': 'Staged Diff',
'contextPanel.mode.workingDiff': 'Working Diff',
'contextPanel.mode.plan': '계획',
'contextPanel.mode.pr': '풀 리퀘스트',
'contextPanel.mode.context': '컨텍스트',
'contextPanel.mode.preview': '미리보기',
'contextPanel.mode.browser': '브라우저',
'contextRail.aria.rail': '패널 서피스',
'contextPanel.editorEmpty.title': '열린 파일 없음',
'contextPanel.editorEmpty.description': '트리에서 파일을 선택해 편집을 시작하세요.',
'contextRail.surface.editor.description': '프로젝트 파일 편집',
'contextRail.surface.git.description': '커밋, 브랜치, 풀 리퀘스트',
'contextRail.surface.terminal.description': '내장 터미널',
'contextRail.surface.diff.description': '작업 중인 변경 사항 검토',
'contextRail.surface.plan.description': '현재 계획 보기',
'contextRail.surface.pr.description': '현재 브랜치의 풀 리퀘스트를 생성, 검토, 병합',
'contextRail.surface.notes.description': '프로젝트의 노트, 할 일, 계획',
'contextRail.surface.context.description': '세션 컨텍스트 및 토큰 사용량',
'contextRail.surface.browser.description': '내장 웹 브라우저',
'contextRail.surface.preview.description': '개발 서버 미리보기',
'contextRail.surface.chat.description': '나란히 연 세션',
'contextRail.surface.notes': '프로젝트 노트',
'contextRail.editorTree.toggle': '파일 트리 표시 전환',
'contextPanel.browser.open': '브라우저 패널 열기',
'contextPanel.browser.addressAria': '브라우저 주소',
'contextPanel.browser.empty': '웹 브라우저',
@@ -1133,6 +1158,7 @@ export const dict: Record<I18nKey, string> = {
'sidebarFilesTree.actions.newFileTitle': '새 파일',
'sidebarFilesTree.actions.newFolderTitle': '새 폴더',
'sidebarFilesTree.actions.refreshTitle': '새로고침',
'sidebarFilesTree.actions.collapseAllTitle': '모든 폴더 접기',
'sidebarFilesTree.actions.fileMenuTitle': '파일 메뉴',
'sidebarFilesTree.state.searching': '검색 중…',
'sidebarFilesTree.state.loading': '로드 중…',
@@ -1494,13 +1520,6 @@ export const dict: Record<I18nKey, string> = {
'terminalView.quickKeys.enterAria': 'Enter',
'terminalView.tabs.closeTabTitle': '탭 닫기',
'terminalView.tabs.newTabTitle': '새 탭',
'terminalView.bottomDock.resizeAria': '터미널 패널 크기 조정',
'terminalView.bottomDock.restoreTitle': '터미널 패널 높이 복원',
'terminalView.bottomDock.restoreAria': '터미널 패널 높이 복원',
'terminalView.bottomDock.expandTitle': '펼치기 터미널 패널',
'terminalView.bottomDock.expandAria': '펼치기 터미널 패널',
'terminalView.bottomDock.closeTitle': '터미널 패널 닫기',
'terminalView.bottomDock.closeAria': '터미널 패널 닫기',
'terminalView.viewport.inputAria': '터미널 입력',
'directoryExplorerDialog.title': '프로젝트 디렉터리 추가',
'directoryExplorerDialog.description': '프로젝트로 추가할 폴더를 선택하세요.',
@@ -1578,10 +1597,9 @@ export const dict: Record<I18nKey, string> = {
'helpDialog.item.focusChatInput': '채팅 입력창으로 포커스 이동',
'helpDialog.item.togglePromptNavigator': '프롬프트 탐색기 표시/숨기기',
'helpDialog.item.abortActiveRun': '활성 실행 중단(두 번 누르기)',
'helpDialog.item.toggleRightSidebar': '오른쪽 사이드바 전환',
'helpDialog.item.openRightSidebarGitTab': '오른쪽 사이드바 Git 탭 열기',
'helpDialog.item.openRightSidebarFilesTab': '오른쪽 사이드바 파일 탭 열기',
'helpDialog.item.cycleRightSidebarTab': '오른쪽 사이드바 탭 순환',
'helpDialog.item.toggleRightSidebar': '컨텍스트 패널 표시 전환',
'helpDialog.item.openRightSidebarGitTab': 'Git 서피스 열기',
'helpDialog.item.openRightSidebarFilesTab': '파일 서피스 열기',
'helpDialog.item.toggleTerminalDock': '터미널 독 전환',
'helpDialog.item.toggleTerminalExpanded': '터미널 펼치기/접기',
'helpDialog.item.togglePlanContextPanel': '플랜 컨텍스트 패널 전환',
@@ -2196,7 +2214,6 @@ export const dict: Record<I18nKey, string> = {
'commandPalette.item.addProject': '프로젝트 추가',
'commandPalette.item.showSessionSwitcher': '세션 전환기 표시',
'commandPalette.item.toggleSidebar': '토글 사이드바',
'commandPalette.item.toggleRightSidebar': '오른쪽 사이드바 전환',
'commandPalette.item.showContextUsage': '컨텍스트 사용량 표시',
'commandPalette.item.toggleTerminal': '토글 터미널',
'commandPalette.item.openSettings': '설정... 열기',