Skip to content

feat(sidebar): choose how many lines session card titles and previews use - #27111

Merged
iamwhatever merged 1 commit into
mainfrom
feat/session-card-line-counts
Nov 3, 2026
Merged

iamwhatever merged 1 commit into
mainfrom
feat/session-card-line-counts

Conversation

@rnoack1

@rnoack1 rnoack1 commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: Let people choose how many lines a session card's title and its message preview may use, so similar titles can be told apart at a glance.

Session titles often share a long prefix (a tag, a PR or ticket number, a repo name). The sidebar cuts every title to one line, so the words that tell two sessions apart are hidden behind the ellipsis. The preview line under the title is cut the same way. "Show Full Titles While Scrolling" only helps while the list scrolls, and it does nothing on the board view.

Why it matters

Someone working through many sessions in a row has to open each one to remember what it is. Two or three lines of title are often enough to recognise it without opening it.

Not a goal

What changed (motivation → approach → change)

Two new settings sit under Settings → Chat → Sessions, right below "PR and Issue Chips on Session Cards":

Setting Choices Default
Title Lines on Session Cards 1, 2, 3 1
Preview Lines on Session Cards 1, 2, 3 1

At 1 a card looks exactly as it does now. At 2 or 3 the text wraps and is cut with an ellipsis after the last allowed line. "Show Full Titles While Scrolling" still shows a title cut off after its last line, in full on one line (chat-sidebar/scrollPeek.ts). The settings apply at once to cards already on screen, in both the list and the board view, because both draw the same row.

They are stored with the other per-browser chat settings, like "Show Full Titles While Scrolling". A stored value other than 1, 2 or 3 falls back to 1. Every row reads one shared snapshot (chat-sidebar/cardLines.ts), so a list of hundreds of cards does not re-read storage once per row on each change. The settings labels are added for every shipped language (website/src/i18n/locales/*.json), and the generated settings registry (commandPalette/settingsRegistry.gen.ts, src/kiro_crew/docs/settings-registry.generated.json) and UI index (src/kiro_crew/docs/ui-index.generated.json) are regenerated.

Backwards compatibility

Compatible: both settings default to one line, which is today's look, and an unknown stored value falls back to it.

Removes nothing: the change only adds two optional settings.

Tests

website/src/test/ChatSidebar.cardLines.test.tsx:

  • With nothing set, the title and the preview keep the one-line ellipsis.
  • Title and preview follow their own counts (2 and 3 here).
  • A change reaches a row already on screen, with no reload.
  • A stored 0, 4, "2", null or 1.5 falls back to one line.

website/src/pages/chat-sidebar/scrollPeek.test.tsx: a wrapped title cut off after its last line gets a peek chip; one that fits, or a one-line title, does not. This test fails on the old scrollPeek.ts.

Reverting the title wiring in SessionRow.tsx turns two of these tests red. The existing sidebar, chat-panel and settings suites (243 files) pass. Both new test files pass 10 runs in shuffled order (--sequence.shuffle, seeds 11 to 99 and 1234).

Manual verification

On an isolated dev gateway with a built bundle: switched both settings between 1, 2 and 3 and watched the cards re-flow in place, then checked the settings page.

Screenshots / video

One line (default), then three lines for both:

One line, the default Three lines for title and preview

Two lines, and the settings

Two lines for title and preview

The two settings under Settings, Chat, Sessions

Related Issues

Part of #21239

Related: #21238, #21925 (hide the preview line), #23512 (title-only cards).

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 1, 2026
@github-actions

github-actions Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of a9a08b0d8bc081192d4517a7eb1da276b2d4c7bb — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

Nothing blocks: both settings are opt-in, stored per browser, default to today's one-line look, and are easy to revert. The four attached screenshots show this revision.

Notes

  • The scroll peek handles clamped titles with its own measuring (lineCount, firstLineHeight, canvas singleLineWidth), and that code is guesswork when line-height: normal. A simpler option is to turn the peek off when the title is set to 2 or 3 lines, because the wrapped title already shows the words that tell sessions apart.

[DESIGN-REVIEWED] a9a08b0

Description read

[DESCRIPTION-READ] 6390dbe8f6d69ede4054461b0e908666eebc54545ebf314afc8b2f3d8efc26c8

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of a9a08b0d8bc081192d4517a7eb1da276b2d4c7bb — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

First-Principles-Verdict: PASS

Both settings start at one line, so nobody's sidebar changes unless they choose it. Each item answers the clipped-prefix problem in #21239. The only leftover is a second subscription mechanism.

Notes

  • Item 4 — oversized: cardLines.ts writes its own reference-counted store with subscribe/onConfigChanged/snapshot, plus a second coercion one() on top of the one loadChatConfig already does. The repo already has 6 single-setting useSyncExternalStore(sub, get) hooks for the same mc-config-changed event (grep const sub = (cb in website/src/hooks/: 6 hits). Subtraction: replace the store with two primitive-returning hooks shaped like website/src/hooks/useSimplifiedToolNames.ts, and delete one() in read(). A primitive snapshot needs no cache.

What this change ships

Inventory (7 items) — 6 justified

Intent: let people see more of a session card's title and preview so similar sessions can be told apart. ADDITION.

  1. New "Title Lines on Session Cards" setting (1/2/3, default 1) — justified
  2. New "Preview Lines on Session Cards" setting (1/2/3, default 1) — justified
  3. "Show Full Titles While Scrolling" now also peeks titles cut off after their last wrapped line — justified
  4. Shared snapshot store and a duplicate value guard for the line counts — oversized
  5. The title comment "NEVER wraps" becomes "one line by default", keeping its same-height reason — justified
  6. Labels for every locale, plus the regenerated settings registry and UI index — justified
  7. A separate cardLineCount.ts module so tests that mock ChatSettings keep the guard — justified

[FIRST-PRINCIPLES-REVIEWED] a9a08b0

Description read

[DESCRIPTION-READ] 0107d7dff2a0e4c75f547a5421adccb09b77d046471368a9b4692d59f7bcd631

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS

UX-level review of a9a08b0d8bc081192d4517a7eb1da276b2d4c7bb — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

UX-Verdict: PASS

Nothing blocks. The blind reader understood both settings and read the 1/2/3-line card states as the same list each time.

Notes

  • In shot-04 the "Preview Lines on Session Cards" dropdown is cut off at the bottom edge. Recapture the settings shot so it shows both selects in full.

[UX-REVIEWED] a9a08b0

Description read

[DESCRIPTION-READ] 59f16e993faf056017cc44b0b03dd7536405efcf6bc019ce7a0c9a8eecc030d8

That sha256 names everything this verdict read: the PR description, plus the 7 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@rnoack1
rnoack1 marked this pull request as ready for review November 1, 2026 14:45
@rnoack1
rnoack1 requested review from a team and KiroCrewCaptain as code owners November 1, 2026 14:45
@rnoack1
rnoack1 requested a review from chenmingwei23 November 1, 2026 14:45
@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Nov 1, 2026
@github-actions

github-actions Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed a9a08b0d8bc081192d4517a7eb1da276b2d4c7bb — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] a9a08b0

Verdict parsed from the review's SHA-scoped output markers for commit a9a08b0d8bc081192d4517a7eb1da276b2d4c7bb.

False positive or not applicable? A repository writer can comment:
/ai-review override fable a9a08b0d8bc081192d4517a7eb1da276b2d4c7bb false-positive: <reason, 20 to 500 characters>

@github-actions

github-actions Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of a9a08b0d8bc081192d4517a7eb1da276b2d4c7bb and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] a9a08b0

False positive or not applicable? A repository writer can comment:
/ai-review override gpt a9a08b0d8bc081192d4517a7eb1da276b2d4c7bb false-positive: <reason, 20 to 500 characters>

@rnoack1
rnoack1 force-pushed the feat/session-card-line-counts branch from 9fde3c0 to 626eed4 Compare November 1, 2026 16:34
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Nov 1, 2026
@rnoack1

rnoack1 commented Nov 1, 2026

Copy link
Copy Markdown
Contributor Author

self-added: no
mechanism: scroll peek measured only horizontal overflow

  • Clamped titles got no scroll-peek chip span=d0d0cbe19fa0

fixed in 626eed4: measureClippedTitles in website/src/pages/chat-sidebar/scrollPeek.ts treats a wrapped title that overflows vertically (and is not nowrap) as clipped.
The chip shows the full title on one line, sized by a canvas text measure, so measuring writes no style the lane's MutationObserver would react to.
The one-line truncate path is unchanged. The module doc and the title comment in SessionRow.tsx now describe both cases.
Regression test in scrollPeek.test.tsx fails on the old scrollPeek.ts and passes now.

@rnoack1

rnoack1 commented Nov 1, 2026

Copy link
Copy Markdown
Contributor Author

self-added: no
mechanism: scroll peek measured only horizontal overflow

  • Multiline titles stop appearing in scroll peek span=be14cf1a8d6d

fixed in 626eed4: measureClippedTitles in website/src/pages/chat-sidebar/scrollPeek.ts counts a wrapped title cut off after its last line as clipped.
Its chip width is the unclamped single-line width from a canvas text measure, not scrollWidth; no style is written during measurement.
Regression test in scrollPeek.test.tsx fails on the old scrollPeek.ts and passes now.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed readiness: checking Automated validation is still running labels Nov 1, 2026
@rnoack1
rnoack1 force-pushed the feat/session-card-line-counts branch from 626eed4 to ea72650 Compare November 1, 2026 17:38
@github-actions github-actions Bot removed the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Nov 1, 2026
@rnoack1
rnoack1 force-pushed the feat/session-card-line-counts branch from ea72650 to 0d52ece Compare November 1, 2026 18:00
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Nov 1, 2026
@rnoack1

rnoack1 commented Nov 1, 2026

Copy link
Copy Markdown
Contributor Author

self-added: yes
mechanism: scroll peek chip for clamped titles took the whole clamped height

  • Clamped-title chip as tall as all its lines span=abcd67850a4c

fixed in 0d52ece: for a clamped title, measureClippedTitles in website/src/pages/chat-sidebar/scrollPeek.ts sets the chip height to one line box (firstLineHeight, the computed line-height).
It falls back to the title's full height only when line-height is not a length (normal). The one-line truncate path is unchanged.
The chip covers the title's first line; the clamped title's later lines stay visible below it, as the module doc says.
The regression test in scrollPeek.test.tsx asserts a 20px chip for a 3-line, 60px title; it failed on the previous head (got 60).

@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed readiness: checking Automated validation is still running labels Nov 1, 2026
@rnoack1
rnoack1 force-pushed the feat/session-card-line-counts branch from 0d52ece to 56ecc4e Compare November 1, 2026 20:08
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed readiness: passed Eligible automated validation passed for the current revision merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: checking Automated validation is still running labels Nov 1, 2026
@rnoack1
rnoack1 force-pushed the feat/session-card-line-counts branch from 56ecc4e to 8846478 Compare November 2, 2026 00:21
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed readiness: passed Eligible automated validation passed for the current revision merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: checking Automated validation is still running labels Nov 2, 2026
@rnoack1
rnoack1 force-pushed the feat/session-card-line-counts branch from 8846478 to a9a08b0 Compare November 2, 2026 21:09
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision and removed merge conflict Branch has merge conflicts with its base — author must resolve before merge readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Nov 2, 2026

@iamwhatever iamwhatever left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

APPROVE at a9a08b0.

This PR adds two opt-in sidebar settings (title and preview lines, 1/2/3, default 1). At 1 the card renders exactly as today (truncate). Stored values are coerced to 1 unless they are 1, 2 or 3. The earlier GPT and Opus scroll-peek findings were fixed with SHAs in their dispositions. All checks are green and every lane passes.

AI findings judged non-blocking:

  • Design Review: clamped-title measuring is guesswork with line-height: normal. Not applicable here, because the title's line-height is a fixed 20px (listShell.ts#L57), and the NaN path falls back safely (scrollPeek.ts#L86-L96).
  • First Principles: cardLines.ts could use a primitive hook instead of its own store. This is a simplification suggestion; the store is correct and no user is affected (cardLines.ts#L35-L55).
  • UX Review: one settings screenshot is cropped. This is description evidence only and does not affect the code.

— crew-pr-reviewer (r142)

@iamwhatever
iamwhatever merged commit 1a6c323 into main Nov 3, 2026
95 checks passed
@iamwhatever
iamwhatever deleted the feat/session-card-line-counts branch November 3, 2026 00:13
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Nov 3, 2026
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.

2 participants