Skip to content

Show thread numbers in sidebar - #1174

Open
ryanbbrown wants to merge 2 commits into
get-bb:mainfrom
ryanbbrown:bb/thread-number-prefix
Open

Show thread numbers in sidebar#1174
ryanbbrown wants to merge 2 commits into
get-bb:mainfrom
ryanbbrown:bb/thread-number-prefix

Conversation

@ryanbbrown

@ryanbbrown ryanbbrown commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Closes #1243.

Summary

  • add a browser-local Thread numbers option to the sidebar display menu
  • keep the option off by default and remember it in local storage
  • show subtle, fixed-width 19 prefixes beside the first nine rendered thread rows
  • update the numbers when rows mount, move, or unmount so they match the existing thread jump shortcuts
  • observe sidebar changes only while numbers or keyboard shortcut hints are visible

User impact

Thread numbers stay hidden by default. A user can open the sidebar display menu and select Thread numbers. The choice applies to that browser instead of every bb client.

Testing

  • pnpm exec turbo run test --filter=@bb/app -- --run src/components/sidebar/ThreadRow.test.tsx src/components/sidebar/sidebarThreadShortcuts.test.ts src/components/sidebar/SidebarViewOptionsMenu.test.tsx
  • pnpm exec turbo run typecheck --filter=@bb/app
  • pnpm exec turbo run lint --filter=@bb/app (passes with existing warnings)
  • git diff --check

@ryanbbrown
ryanbbrown marked this pull request as ready for review August 8, 2026 02:45
@ryanbbrown
ryanbbrown force-pushed the bb/thread-number-prefix branch from af1c0ab to ef531f1 Compare August 9, 2026 13:13
@ryanbbrown
ryanbbrown force-pushed the bb/thread-number-prefix branch from ef531f1 to 7b3937f Compare August 12, 2026 01:08

@bb-slop-cop bb-slop-cop Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🚨 SLOP COP 🚨 · review

I am SlopCop. I am reviewing this pull request for security, code quality, architecture, performance, and end-to-end behavior.

useLayoutEffect(() => {
const sidebar = sidebarRef.current;
if (!sidebar) return;
return observeSidebarThreadShortcutTargets(

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🚨 slopcop/review — Avoid the observer when both thread displays are inactive.

Please observe only when numbers are enabled or the command modifier is held. The default state still scans every sidebar child-list change. Target changes also replace the context map and render all mounted rows with unchanged output. Clear the assignments and target reference when this observer stops.

@bb-slop-cop bb-slop-cop Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🚨 SLOP COP 🚨 · review

ELI5 summary

This change adds an optional number beside each of the first nine sidebar threads. The numbers match the existing keyboard shortcuts.

Findings

  1. Medium priority: the app always observes the full sidebar subtree. It does this when numbers are off and no modifier key is held. Each child change scans the subtree. It can also render every mounted thread row again. I left an inline comment with a focused fix.

  2. Merge blocker: current main already contains 0093_peaceful_thing. This pull request adds a different migration at index 0093. GitHub reports a merge conflict. Rebase the branch, then use Drizzle to generate migration 0094, its snapshot, and its journal entry.

I found no security issue. I found no duplicate implementation. The shared sidebar shortcut module is the correct location for this logic.

Checks

  • All 116 focused app, CLI, database, and server tests passed.
  • Type checks passed for the app, CLI, server, database, and domain packages.
  • Browser tests showed no numbers by default.
  • The setting showed exactly 1 through 9 for ten threads.
  • Control+1 opened the first numbered thread.
  • The CLI disabled the setting, and the open app removed the numbers.
  • GitHub CI passed against the old base.

I posted this as a comment review. I did not approve or request changes.

@ryanbbrown
ryanbbrown force-pushed the bb/thread-number-prefix branch from 7b3937f to 13a92eb Compare August 14, 2026 23:26
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.

Optionally show thread numbers in the sidebar

1 participant