Skip to content

fix: CLI picker opens URLs via configured opener#73

Merged
gavin-jeong merged 1 commit into
masterfrom
fix/cli-picker-opener
Jul 16, 2026
Merged

fix: CLI picker opens URLs via configured opener#73
gavin-jeong merged 1 commit into
masterfrom
fix/cli-picker-opener

Conversation

@gavin-jeong

Copy link
Copy Markdown
Collaborator

Problem

ccx urls/refs/... 서브커맨드는 TUI와 별도의 picker(internal/cli)를 쓰는데, 그 openItems 가 하드코딩된 exec.Command("open", u) 였다. 그래서 open.command_template(예: tmux-chrome open {{url}})이 이 경로에서 무시됐다. 사용자가 스크린샷에서 겪은 "refs에서 안 먹는다"의 실제 원인.

이게 세 번째로 흩어져 있던 URL open 경로였다:

  1. TUI App.openInBrowser (PR #72에서 수정)
  2. conversation artifact browser (PR feat: configurable URL opener via open.command_template #70)
  3. CLI picker openItems (이 PR) ← 매번 누락됐던 곳

Fix — 단일 진입점으로 통일

picker도 TUI와 동일한 opener.Open 을 타게 함:

  • pickerModelopener.Config 를 보유, openItemsopener.Open 호출.
  • cli.RunloadOpenerConfig(=tui.LoadCCXConfig)로 로드해 RunPicker → newPickerModel 로 전달.

이제 모든 interactive URL open 경로(TUI refs/URL 메뉴, conversation browser, CLI picker)가 open.command_template 를 존중하는 하나의 opener를 공유한다.

로컬 이미지 open(openCachedImage)은 의도적으로 OS 기본 유지 — URL이 아니라 이미지 파일을 뷰어로 여는 것이라 성격이 다름.

Test

  • 테스트 call site 갱신, go build/vet/test ./... 전부 통과
  • 설치 후 loadOpenerConfigtmux-chrome open {{url}} 를 로드하고 picker에 전달됨을 확인

The 'ccx urls/refs/...' subcommands run a separate picker (internal/cli) from
the TUI, and its openItems hardcoded exec.Command("open", u) — so
open.command_template never applied there. This was the third scattered URL-open
path (after TUI openInBrowser and the conversation browser); each opener change
had to be duplicated and this one was missed.

Route the picker through the same opener.Open entry point as the TUI:
- pickerModel carries an opener.Config; openItems calls opener.Open.
- cli.Run loads it via loadOpenerConfig (tui.LoadCCXConfig) and threads it
  through RunPicker → newPickerModel.

Now every interactive URL-open path (TUI refs/URL menu, conversation browser,
CLI picker) shares one opener honoring open.command_template.

Local image open (openCachedImage) intentionally left on the OS default — it
opens image files in a viewer, not URLs in a browser.
@Kairo-Kim Kairo-Kim added the auto-review/approved Auto-approved by the Slack auto-reviewer bot label Jul 16, 2026

@jinsekim jinsekim 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.

LGTM!

@jinsekim jinsekim 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.

LGTM!

@gavin-jeong
gavin-jeong merged commit 229fcdf into master Jul 16, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-review/approved Auto-approved by the Slack auto-reviewer bot

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants