fix: 隠れが1件のときは"↓他1件"ではなく実項目を表示 - #49
Merged
Merged
Conversation
セッション一覧で画面が埋まった状態で下から2番目のセッションを選ぶと、 末尾1件が "↓ 他 1 件" インジケータに化けていた。インジケータも実項目も 1 行を占めるため、1 件しか隠れていない端はインジケータを出さずその項目 自体を表示するほうが有益(描画行数は不変)。上端も対称に扱う。 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
概要
セッション一覧画面で、画面が埋まった状態で下から2番目のセッションを選択すると、末尾の1件が
↓ 他 1 件(↓ 1 more)インジケータに化けていた。「他 N 件」インジケータも実項目も端末では 1 行 を占める。隠れているのが 1 件だけの端では、インジケータを出しても「1 行で 1 件を表す」だけで得がない。同じ 1 行にその実項目を表示するほうが有益なので、隠れが 1 件だけの端はインジケータをやめてウィンドウをその 1 件ぶん広げる(描画行数は変わらない)。
上端(
↑ 他 1 件)も対称に扱う。変更点
src/core/layout.tsのlistViewshowBelowかつ下に隠れているのが 1 件ならend += 1して末尾項目を表示し、showBelowを落とす。showAboveかつ上に隠れているのが 1 件(start === 1)ならstart -= 1して先頭項目を表示し、showAboveを落とす。cap以下という既存の不変条件を維持する。total === capを意味し早期 return 済み)。挙動の変化(例: cap=5, total=10)
↑他6/ 6,7,8 /↓他1↑他6/ 6,7,8,9テスト計画
npm run typechecknpm run lintnpm test(CI)listView(10, 8, 5)が末尾項目を表示しshowBelow=falseになることtotal/cap/selの組で、インジケータ表示中の端の隠れ件数が必ず 2 件以上(1 件を隠すインジケータは出さない)/選択は常に可視/描画行数 ≤ cap🤖 Generated with Claude Code