Skip to content

feat: 터미널별 로컬 서버 주소 표시와 브라우저 열기 - #39

Merged
safethecode merged 6 commits into
mainfrom
feat/terminal-local-servers
Nov 3, 2026
Merged

safethecode merged 6 commits into
mainfrom
feat/terminal-local-servers

Conversation

@safethecode

@safethecode safethecode commented Nov 3, 2026 •

Copy link
Copy Markdown
Owner

개발 서버 로그가 스크롤되어도 터미널 헤더에서 로컬 주소를 확인하고 브라우저로 열 수 있게 합니다. localhost:3000 서버를 실행하면 해당 칸에 주소가 나타나고, 종료하면 약 1초 간격으로 제거됩니다.

  • 셸과 자식 프로세스의 실제 로컬 TCP listener를 native API로 확인합니다. 고정 libghostty에 atomic root PID 조회를 추가하고 버전·출처·라이선스를 유지합니다.
  • 주소가 하나면 직접 열고, 여러 개면 목록을 제공합니다. 탭 보기에는 선택한 터미널의 주소를 표시합니다. 좁은 칸에서는 :port +N으로 줄이며 전체 URL과 경로는 툴팁에 남깁니다.
  • 자동 브라우저 열기·접속은 없습니다. 기본 HTTP이며 같은 포트의 로컬 주소 출력에서 scheme만 반영합니다. 화면상 마지막 HTTP/HTTPS가 우선하고 확인한 방식은 listener가 유지되는 동안 보존됩니다. 힌트 조회는 ACTIVE 화면의 최대 32KiB로 제한합니다.

검증: ./scripts/check.sh 전체 44개 테스트 14.435초, release·서명·아이콘·format 및 디자인 게이트 PASS. 실제 별도 AppKit 앱에서 두 터미널의 단일·복수 주소, 기본·최소 창, 라이트·다크, 탭·빈 칸, Ctrl+C·재실행 시 주소 제거를 확인했습니다. Chrome에서 두 주소를 열어 HTTP 200 테스트 페이지를 확인했습니다. 실제 관찰과 검증 범위.

리뷰: 셀프 리뷰에서 PID count 해석과 privileged macOS login의 후손 탐색을 보완했습니다. CodeRabbit 자동 리뷰의 fixture 부분 쓰기 경합과 HTTPS 조건 설명 지적도 반영했습니다. 외부 사람의 승인은 아닙니다. 로컬 주소 제한, HTTP override·대문자 HTTPS, 터미널별 격리·종료, 최소 칸의 컨트롤 겹침을 검사했습니다.

제한: TCP 포트만으로 HTTP 서비스 여부를 확정하지 않습니다. 외부 Docker·daemon, 셸에서 완전히 분리된 프로세스, 원격 서버의 자동 추적은 범위 밖입니다. 물리 VoiceOver 전체·실제 TLS 인증서·모든 개발 프레임워크 검증은 하지 않았습니다. 사용 중인 원래 Chop은 종료하지 않았습니다.

@coderabbitai

coderabbitai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Walkthrough

The change adds discovery of local TCP listeners associated with terminal processes, derives browser URLs, and displays server controls in pane headers and the selected tab bar. It also adds process-PID support, tests, and feature documentation.

Changes: Local Server Feature

Layer / File(s) Summary
Listener discovery and process identity
Dependencies/ghostty-config.patch, Dependencies/README.md, Sources/ChopCore/LocalServer.swift, Tests/ChopCoreTests/LocalServerTests.swift
The Ghostty patch exposes the terminal child PID. LocalServerDiscovery scans validated process trees for listening TCP sockets, and LocalServer builds browser URLs. Tests cover process discovery, URL hints, and listener lifecycle.
Terminal monitoring and URL updates
Sources/Chop/TerminalEngine.swift, Sources/Chop/TerminalView.swift, Sources/Chop/TerminalPaneView.swift, Sources/Chop/WorkspaceView.swift
TerminalEngine scans registered terminal child PIDs and applies results only when the PID still matches. TerminalView stores derived URLs and signals changes that refresh pane and workspace controls.
Pane and tab server controls
Sources/Chop/LocalServerButton.swift, Sources/Chop/TerminalPaneView.swift, Sources/Chop/TerminalTabBar.swift, Tests/ChopTests/LocalServerButtonTests.swift, Tests/ChopTests/TerminalIntegrationTests.swift
The button displays one or more URLs and opens them on activation. Pane headers and the selected tab bar show the current terminal’s URLs and adjust the control layout to available width. Tests cover activation, visibility, terminal isolation, and cleanup.
Feature documentation and reference records
DESIGN.md, README.md, design/evidence/local-servers.md, design/local-server-reference/*, design/review.md
The documents describe the feature’s scope and interactions. The reference records include layout observations, comparison metadata, and a source snapshot.

Estimated code review effort: 3 (Moderate) | ~30 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant TerminalEngine
  participant LocalServerDiscovery
  participant TerminalView
  participant LocalServerButton
  TerminalEngine->>LocalServerDiscovery: Scan registered terminal child PIDs
  LocalServerDiscovery-->>TerminalEngine: Return listeners by root PID
  TerminalEngine->>TerminalView: Apply listeners when the PID still matches
  TerminalView->>LocalServerButton: Refresh displayed URLs after a change
Loading
Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 3.85% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title "feat: 터미널별 로컬 서버 주소 표시와 브라우저 열기" (terminal-specific local server address display and browser opening) matches the main change. The changeset adds per-terminal local-server discovery, a Loca…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed 설명은 문제와 변경 후 동작, 검증 결과, 리뷰 범위와 수정 사항, 남은 제한을 모두 포함합니다. 템플릿의 필수 정보가 명확하게 제공되며, 실행한 테스트와 수동 검증 범위도 구체적입니다.
Full details: Title check

Explanation

The title "feat: 터미널별 로컬 서버 주소 표시와 브라우저 열기" (terminal-specific local server address display and browser opening) matches the main change. The changeset adds per-terminal local-server discovery, a LocalServerButton in pane headers and the tab bar, and direct or menu-based opening of the detected addresses in the browser.

Full details: Docstring Coverage

Explanation

Docstring coverage is 3.85% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 26 functions across 10 files. (13 skipped: 13 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches
Generate docstrings
  • Commit to this branch
  • Create a new PR
Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Review coverage is incomplete: 3 files could not be fully reviewed. Findings from completed review steps are included; see review info for details.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.
Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2929cda8-8dd3-4ba3-8271-7f575476f430
Commits

Reviewing files that changed from the base of the PR and between 534c412 and e12169f.

Files selected for processing: 26
  • DESIGN.md
  • Dependencies/README.md
  • Dependencies/ghostty-config.patch
  • README.md
  • Sources/Chop/LocalServerButton.swift
  • Sources/Chop/TerminalEngine.swift
  • Sources/Chop/TerminalPaneView.swift
  • Sources/Chop/TerminalTabBar.swift
  • Sources/Chop/TerminalView.swift
  • Sources/Chop/WorkspaceView.swift
  • Sources/ChopCore/LocalServer.swift
  • Tests/ChopCoreTests/LocalServerTests.swift
  • Tests/ChopTests/LocalServerButtonTests.swift
  • Tests/ChopTests/TerminalIntegrationTests.swift
  • design/evidence/local-servers.md
  • design/failure-events.jsonl
  • design/gate-contract.json
  • design/gate-report.json
  • design/local-server-reference/comparison.json
  • design/local-server-reference/core-review.json
  • design/local-server-reference/decomposition.json
  • design/local-server-reference/handoff.json
  • design/local-server-reference/interpretation.json
  • design/local-server-reference/raw.md
  • design/local-server-reference/source-snapshot.txt
  • design/review.md
Files not fully reviewed because their changes were unavailable: 3
  • design/gate-report.json
  • design/gate-contract.json
  • design/failure-events.jsonl

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@coderabbitai coderabbitai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Fix comments: Fix CodeRabbit comments on this PR

Comment thread README.md Resolved
@safethecode
safethecode merged commit 9090aef into main Nov 3, 2026
2 checks passed
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