[BUG] Desktop sidebar: "Show N more" is one-way — no "Show less" and the reveal count never decreases
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report
- [x] I am using the latest version of Claude Code
What's Wrong?
In the desktop app's session sidebar, each project/date group is truncated and shows a "Show N more" row at the bottom. Clicking it expands the group — but there is no way to ever collapse it back.
- No "Show less" control appears after expanding.
- Clicking the row again only reveals more rows; it never reverses.
- Collapsing the whole group (clicking the group header) hides the rows visually, but re-expanding the group brings back the fully-expanded list — the reveal count is preserved, not reset.
The only way back to the truncated view is restarting the app, and even that is undone as soon as a session outside the first N rows is opened (see root cause below).
For a workspace with many sessions per repo, one accidental click permanently turns a scannable 20-row group into a wall of rows for the rest of the session.
What Should Happen?
After expanding, the same row should offer the inverse action ("Show less"), collapsing the group back to the truncated view — matching the showMore / showLess pair that already exists elsewhere in the product (e.g. the session usage/contribution panel).
At minimum, the expanded state should reset when the group is collapsed and re-expanded.
Steps to Reproduce
- Use the desktop app with a project that has more than ~20 sessions in one sidebar group.
- The group renders truncated, with a "Show 20 more" row at the bottom.
- Click it — the group expands.
- Look for any way to collapse it back to the truncated view. There is none.
- Collapse the group via its header and expand it again — it comes back fully expanded.
Root Cause
This UI is served from the web bundle, not the desktop binary. In https://assets-proxy.anthropic.com/claude-ai/v2/assets/v1/shared-16-CaNKE8ms.js (minified names, extracted from the app's HTTP cache):
1. The button component only has an expand action — four text branches, one callback, no inverse:
function VO({count, bucketLabel, onShowAll, isFetching, loadSessionsFace}) {
return button({
onClick: e => { if (!isFetching) onShowAll(...) },
children: isFetching ? "Loading…"
: count > 0 ? "Show {count} more" // the row in question
: loadSessionsFace ? "Load more sessions"
: "Show more"
})
}
2. The state backing it is monotonically increasing — no setter ever decreases it:
function OU(sorted, truncateAt, isCollapsed) {
const [extraRevealed, setExtra] = useState(0)
...
if (w > extraRevealed) setExtra(w) // auto-reveal up to the focused/open row; only ever raises
return {
showMoreRows: () => setExtra(v => v + truncateAt), // += only
revealAllRows: () => setExtra(Infinity),
}
}
There is no setExtra(0) anywhere in the module. Consequences:
- Nothing can lower
extraRevealedshort of unmounting the component. - The group-collapse path explicitly preserves it (
if (isCollapsed) return extraRevealed), so collapse/re-expand is not a reset either. - Because
useState(0)isn't persisted, an app restart does reset it — but theif (w > extraRevealed) setExtra(w)line immediately re-expands the group when the currently open session sits past the truncation point.
Suggested Fix
Give OU a collapseRows: () => setExtra(0) and render a "Show less" branch in VO when extraRevealed > 0. The showLess string (id: "QJAllUAc2k") already exists in the bundle for the usage panel.
Related
- #87562 — the feature request this truncation implements. It asked for "a 'show more' affordance to expand the rest" and the implementation is expand-only, which is likely how the inverse got missed.
- #83937 — adjacent "no way to collapse" complaint about the same sidebar (group headers).
Environment
| | |
|---|---|
| Claude Desktop | 1.37937.3 (macOS, Apple Silicon) |
| Bundled Claude Code | 2.1.246 |
| macOS | 26.5 (25F71) |
| Web bundle chunk | shared-16-CaNKE8ms.js |