Skip to content

feat: shp -f でもピッカーを表示して force attach する#4

Merged
uzulla merged 1 commit into
mainfrom
feat/shp-f-picker
Jun 26, 2026
Merged

feat: shp -f でもピッカーを表示して force attach する#4
uzulla merged 1 commit into
mainfrom
feat/shp-f-picker

Conversation

@uzulla

@uzulla uzulla commented Jun 26, 2026

Copy link
Copy Markdown
Owner

概要

shp -f(名前なし)が TUI を出さず cwd 由来名へ即 force attach していた挙動を変更し、shp と同様にピッカーを表示して、選択/新規作成したセッションへ force 付きで attach するようにした。

-f は「attach 時に force を付ける」だけの意味に純化し、セッション選択の UX は shp と共通化する。

背景

shp -f 実行時に「名前を選ばず既存セッションへ繋がってしまう」という指摘があった。これは旧仕様(-f は no-TUI で cwd 名へ強制 attach)どおりの動作だが、名前を選択/新規作成してから force attach したいケースに対応できていなかった。

挙動の対応

コマンド 変更前 変更後
shp ピッカー → 通常 attach 同じ
shp -f TUI 無しで cwd 名へ force attach ピッカー → force attach
shp -f <name> TUI 無しで force attach 同じ

変更点(cmd/shp/main.go のみ)

  • runPicker(force bool)force を渡し、選択/作成したセッションへ force 付きで attach
  • shp -f <name> の明示名指定は従来どおり TUI 無しで直接 force attach
  • usage 文言を更新

動作確認

  • ダミー shpool を PATH 先頭に置き、実セッション/実デーモンに触れずに経路を検証
    • shp -f(名前なし)→ ピッカー経路に入る(shpool attach を直接 exec しない)
    • shp -f <name>shpool attach -f --dir . -- <name> を直接 exec
  • go build / go vet / go test ./... すべて通過

Summary by CodeRabbit

  • Bug Fixes
    • shp -f の動作が、表示文言どおりの TUI ピッカー経由の接続方法に統一されました。
    • セッション名を指定しない場合でも、選択または新規作成したセッションへ強制的に接続できるようになりました。
    • ピッカー画面では、作業中のディレクトリ名が既定の選択肢として扱われます。

これまで `shp -f`(名前なし)は TUI を出さず cwd 由来名へ即 force attach
していたが、名前を選択/新規作成してから force attach したいケースに対応
できなかった。-f を「attach 時に force を付ける」だけの意味とし、選択 UX は
`shp` と共通化する。

- runPicker(force) に force を渡し、選択/作成したセッションへ force 付きで attach
- `shp -f <name>` の明示名指定は従来どおり TUI 無しで直接 force attach
- usage 文言を更新
@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: a3dc4177-dc21-4bb7-a116-66ce91a1380f

📥 Commits

Reviewing files that changed from the base of the PR and between 154973d and fa53287.

📒 Files selected for processing (1)
  • cmd/shp/main.go

Walkthrough

shp-f オプション説明が更新され、セッション名未指定時の処理がピッカー経由に統一されました。選択されたセッションへの attach では、-f の指定が反映されるようになりました。

Changes

CLI ピッカーの force-attach

Layer / File(s) Summary
force 指定の伝播
cmd/shp/main.go
-f のヘルプ文言が更新され、run() の分岐がピッカー委譲に統一され、runPicker から shpool.Attach へ force が渡されるようになりました。

Estimated review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed タイトルは、shp -f でピッカーを表示して force attach するという変更点を簡潔に正しく表しています。
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.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/shp-f-picker

Comment @coderabbitai help to get the list of available commands.

@uzulla uzulla merged commit 8a0f67c into main Jun 26, 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