feat: 端末が狭いとき一覧の worktree 名列を非表示にする - #22
Merged
Merged
Conversation
端末の横幅が狭いと title/badge/model 等の固定列で幅が埋まり、 worktree(ブランチ)名の列を出すと title が過度に切り詰められる。 端末桁数が閾値未満のときはブランチ列ごと省き、title に幅を譲る。 - core/layout.ts に純関数 showsBranchColumn / MIN_BRANCH_COLUMN_COLUMNS を追加 - session-list.tsx でブランチ列を showBranch で条件描画
…me-narrow # Conflicts: # src/core/layout.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
セッション一覧の行に表示している worktree(ブランチ)名の列を、端末の横幅が狭いときは非表示にします。
狭い端末では
caret / attention / title / badge / model / elapsed / PRの固定・準固定列だけで幅が埋まり、ブランチ列を出すとtitleが過度に切り詰められていました。端末桁数が閾値(MIN_BRANCH_COLUMN_COLUMNS = 80)未満のときはブランチ列ごと省き、その幅をtitleに譲ります。変更点
src/core/layout.tsshowsBranchColumn(columns)と定数MIN_BRANCH_COLUMN_COLUMNSを追加(表示判定はロジックとして core に集約)src/ui/session-list.tsxshowsBranchColumn(columns)の結果でブランチ列を条件描画(幅は既存のuseWindowSize().columnsを利用)src/core/layout.spec.tsshowsBranchColumnの境界値テストを追加設計メモ
coreの純関数へ委譲(architecture.md / ink-components.md の方針に準拠)。テスト計画
showsBranchColumnの境界値ユニットテスト(79→false / 80→true など)npm run typecheck/ Biome lint(変更ファイルは警告なし)