Repository navigation
fix(chat): 채팅 보기가 공유 터미널 크기를 바꾸지 않도록 수정 - #363
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. 🧰 Additional context used📚 Code guidelines (1)No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (6)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 SummarySummary by CodeRabbit
WalkthroughChat-lens attachments now preserve the shared pane’s terminal size. Terminal mode can still fit the terminal to the viewing device. Socket, server, and browser regression checks cover these behaviors. ChangesChat Lens Terminal Size
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix · Severity of issue fixed: Medium Suggested reviewers: Merge Risk: ⚪ Minimal · up to Chat view no longer resizes the shared terminal, and terminal view still fits the terminal to the device. Remote PCs keep the old behavior until their bridge bundle is updated. No merge-blocking risk is evident. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The change reduces interference between chat and terminal users while preserving existing access and read-only controls. A bounded remaining risk concerns password-prompt recognition when the hidden terminal adopts a different screen size. No credential disclosure or privilege expansion was established, and compatibility with older remote servers remains only partially confirmed. Retained concerns
Security review detailsSecurity Blast Radius
Security Findings and Attack Paths
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Linked Issues checkExplanation Issue Full details: Docstring CoverageExplanation Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 8 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
# Conflicts: # scripts/ui-regression.ts
…aw the chat lens for the shared grid Two cases the covered attach (keep_size) left open, found in review: - A resize that reached the server while the pane's attachment was still being created was dropped. A chat lens that attached and then switched to the terminal lens before the terminal was looked up stayed on the pane's own grid under a terminal fitted to the device. The resize now waits for the creation. - The terminal lens ignores pane-geometry (it drives the grid), so a device that entered the chat lens after another one had resized the pty kept its hidden screen at its own size. The last pane-geometry is kept and the hidden screen takes it on entering the chat lens. The changelog entries of devswha#347 and devswha#363 were written before 0.3.44 was cut and merged under that released version: both move to Unreleased, with their PR links. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Thank you for the fix and the tests. Before merging I ran an adversarial review of the diff (Codex, Fixed in affcf98
Not changed
Changelog. The entry was written before 0.3.44 was cut, so the merge left it under that released version. It is now under Checked locally on this branch: |
…the terminal's size alone (#390) ## What was wrong #363 made the chat lens leave the shared terminal's size alone, but only when the page opens on the pane. Picking a chat-lens pane from the sidebar while a terminal-lens pane is open still resized it. - A desktop shows an agent pane in its terminal lens at 38×145. - A second, smaller window has a shell pane open in the terminal lens and picks that agent pane, whose lens there is chat. - The `attach` goes out without `keep_size`, and the desktop's pane is fitted to the smaller window. **Cause:** `src/App.tsx` set the selected pane's lens in a `useEffect` after the selection. `PaneTerminal` attaches in the layout effect of the render that selects the pane, so it still saw the previous pane's lens. ## Change The lens is settled in the render that selects the pane (state adjusted during render, keyed by what the effect depended on). What decides the lens is unchanged: the pane's remembered choice, else Settings, else the device. ## Checks - New browser regression `checkPaneSwitchKeepsTerminalSize` in `scripts/chat-size-regression.ts`, run by `scripts/ui-regression.ts`. On `main` it fails: the picked pane's `attach` has no `keep_size`. With the fix it passes and the pane's own `stty size` stays 38 145. - `bun run typecheck`: pass. - `bun run test:unit`: 1083 pass, 3 skip, 0 fail. - `scripts/ui-regression.ts` and `scripts/file-viewer-regression.ts`: all pass on an isolated herdr session. ## Not covered The smaller findings from the same review of #363 are left as they are: a `resize` that arrives while a `keep_size` attachment is still being created is dropped, and the replay/geometry order for a client that adopts the grid.
Change
안녕하세요. #361에서 제기된, 채팅 보기가 공유 터미널 크기를 바꾸는 문제를 확인하여 수정을 제안드립니다. Closes #361
폰에서 pane을 채팅 보기로 열면 그 pane의 터미널이 폰 화면 크기로 바뀌고, 같은 pane을 데스크톱에서 보면 프로그램이 좁은 폭으로 다시 그려집니다. 채팅 보기는 대화를 자체 레이아웃으로 그리므로 터미널 크기를 바꿀 이유가 없습니다.
원인을 확인해 보니
PaneTerminal은 채팅 보기에서도 화면 뒤에 붙어 있고, 처음 연결할 때(attach), 화면 크기가 바뀔 때(키보드가 열릴 때 포함), 탭으로 돌아올 때, 글꼴을 바꿀 때 브라우저 기준cols/rows를 서버로 보내고 있었습니다. 서버는 interact 연결의attach와resize를 받으면 그 크기로 공유 pty를 맞춥니다.이번 변경은 다음과 같습니다.
attach에 선택 필드keep_size를 추가했습니다. 이 값이 있으면 서버는 observe 연결과 같은 방식으로 pty를 pane 자체 크기로 만들고, 이미 있는 pty의 크기도 바꾸지 않습니다. 대신 현재 크기를pane-geometry로 알려 줍니다.keep_size: true로 연결하고,resize를 보내지 않습니다. 재연결할 때도 같은 상태로 다시 연결합니다.pane-geometry에 맞춥니다. 채팅 보기에 표시되는 비밀번호 입력 칸은 이 숨겨진 화면에서 프롬프트를 읽기 때문에, pty와 같은 크기로 그려야 합니다. 이 부분이 빠졌을 때 기존secret-input브라우저 테스트가 재연결 후 프롬프트를 찾지 못해 실패하는 것을 확인했고, 함께 반영했습니다.resize를 보냅니다.새 필드는 선택 사항이라, 아직 갱신되지 않은 원격 PC 번들(
remote-v11)은 이 값을 무시하고 기존처럼 동작합니다. 원격 PC에도 적용하려면 다음 번들 갱신이 필요합니다.server/api.contract.test.ts에keep_size연결이 새 pty와 기존 pty의 크기를 바꾸지 않고 현재 크기를 알려 주는지, 일반 연결은 여전히 크기를 바꾸는지 검증하는 계약 테스트를 추가했습니다.src/lib/ws.test.ts에는 재연결 시keep_size유지와 해제를,scripts/chat-size-regression.ts에는 실제 브라우저 검증을 추가했습니다. 변경 이력도 Unreleased 항목에 기재했습니다.Validation
별도로 만든 테스트 세션에서 데스크톱(1280×800, 터미널 보기)과 폰(390×844, 채팅 보기) 브라우저로 같은 pane을 열고, pane 안의 셸이 보고하는 크기(
stty size)와 폰이 보낸 프레임을 확인했습니다. 원본(bb7ef50)과 수정본을 같은 스크립트로 각각 실행했습니다.bb7ef50attach(keep_size 없음) +resizeattach(keep_size: true)만36 145(데스크톱 그대로)36 57(폰 크기)수정 후 캡처 (데스크톱 터미널 보기:
size-1은 데스크톱만 연 상태,size-2는 폰에서 채팅 보기를 연 뒤)캡처는 이번 검증용으로 생성한 테스트 세션에서 촬영했습니다. 운영 중인 터미널이나 사용자 대화는 포함하지 않았으며, 이미지와 수정 전·후 실행 기록, 전체 브라우저 테스트 로그는 포크의 별도 자료 브랜치에 보관했습니다.
검증 환경: Linux(WSL), Herdr 0.9.3, Bun 1.4.2, lockfile에 맞는 Playwright Chromium 153.
bun run typecheck: 통과bun run build: 통과bun run test:unit: 1,060건 통과, 3건 건너뜀, 실패 없음server/api.contract.test.ts: 76건 통과, 실패 없음(새 계약 테스트는 원본 서버에서 실패, 수정본에서 통과 확인)bun scripts/ui-regression.ts: 전체 통과(새chat-size-regression.ts, 기존secret-input포함)전체 브라우저 테스트를 반복 실행하는 중 한 번
usage-regression.ts의 사용량 표시 단계가 시간 초과로 실패했습니다. 같은 테스트를 원본과 수정본에서 각각 두 번씩 단독 실행했을 때는 모두 통과했고, 다시 실행한 전체 테스트도 통과해 이번 변경과는 무관한 간헐적 실패로 판단했습니다.확인해 주시면 감사하겠습니다. 필드 이름(
keep_size)이나 채팅 보기의 크기 처리 방식에 선호하시는 방향이 있으면 그에 맞춰 조정하겠습니다.