fix(web): thread details lists no longer hide a single item behind "Show 1 more"#33297

draft3
main
GitHub fork: fix/thread-details-lone-extra-pr
opened2d agobyBBrechard
View on GitHubTwo-way sync enabledPR last imported 20h ago

Note

🤖 Claude Opus 5.5 writing on behalf of Rodrigo

Problem

In the thread details card, a "Show N more" toggle can hide a single item. The toggle row is as tall as the row it hides, so it saves no space and costs a click:

  • Two linked PRs show the current PR plus "Show 1 more".
  • Five servers show four plus "Show 1 more". Paging hits it too: nine servers show four, then eight plus "Show 1 more", while the first label said "Show 4 more".

Details in #33296.

Change

A small visibleRowCount(total, limit) helper shows the last row instead of hiding it alone. Both lists use it:

  • Linked PRs: one extra PR renders directly. Two or more still collapse behind "Show N more", as before.
  • Servers: the first view and every next page go through the helper, so the label matches what the click reveals ("Show 5 more" for nine servers). The toggle appears only when the first view hides something. A fifth server shown up front is not marked data-thread-details-server-overflow, so it counts toward the card height like the toggle row it replaces.

The related threads list keeps its toggle. It is capped at 13.5rem, three quarters of a seventh row, and scrolls past that, so a seventh row there would be cut off and scroll by half a rem instead of saving space. The second commit applied the helper there and the third reverts it.

Scope and approval

Closes #33296. There is no maintainer approval of direction yet, and this changes how two visible controls behave, so it may need one. I'm submitting it as a small focused fix for a cosmetic defect: four files in apps/web, no contract, server or other client changes. If maintainers would rather decide the direction first, I'm fine with this staying closed until then.

Verification

On this branch (three commits on upstream/main @ 1a43f4870d, head eb0d11b969):

  • vp test run --project browser on ThreadServersPanel.browser.test.tsx and ThreadRelationshipsControl.browser.test.tsx: 13 of 13 pass. Two new server cases cover five servers (all shown, no toggle, no overflow marker) and nine servers ("Show 5 more", then "Show less" back to four). The existing ten-server paging test is unchanged and passes. The new server cases fail without the fix.
  • apps/web typecheck passes, and the commit hooks (fmt, lint, knip) pass.
  • Linked PR rows have no automated test, before or after.
  • Manual check in the web client: dev server with --no-seed and isolated state, Light theme, 1280x800. The threads, PR links and related threads are fixtures written to the projection tables. The five servers are real local http.server listeners attributed to the thread. This shows rendering only, not provider or backend behavior.
Before (1a43f4870d)After
Two linked PRsExternal imageExternal image (befa62d10e)
Five serversExternal imageExternal image (befa62d10e)
Three linked PRs (unchanged)External imageExternal image (a4a9e0189e)

The "after" captures were taken at befa62d10e or a4a9e0189e. The third commit (eb0d11b969) only reverts the related threads list, so neither list shown here changed after them.

Not checked: dark theme, narrow layouts, desktop and mobile separately, and the status icons against real provider data.

Claude Opus 5.5 and Claude Sonnet 5.5 via Claude Code, running in T3 Code.

🤖 Generated with Claude Code

Checks

21 successful · 8 skipped
All checks passed
eb0d11b

Added 3 commits

  • fix(web): a thread's second linked PR shows directly instead of behind "Show 1 more"a4a9e01
  • fix(web): thread details lists no longer hide a single item behind "Show 1 more"befa62d
  • fix(web): leave the related threads list's toggle as it waseb0d11b