Skip to content

Animate the sidebar and thread when switching to and from Threads in Top Tabs - #21

Merged
matthewdias merged 6 commits into
mainfrom
animate-thread-tab-return-thr_ch2htru6ii
Oct 5, 2026
Merged

matthewdias merged 6 commits into
mainfrom
animate-thread-tab-return-thr_ch2htru6ii

Conversation

@matthewdias

@matthewdias matthewdias commented Oct 5, 2026 •

Copy link
Copy Markdown
Owner

Going back to Threads was abrupt: the sidebar and a freshly rendered thread just appeared. The strip opens the sidebar instantly on a switch on purpose, so that a long thread lays out once at its final width. This keeps that and draws the motion on top.

What moves

  • Sidebar slides in over the space it already has (200ms, ease-out), using translate only.
  • Thread fades in (180ms), using opacity only.
  • The Threads tab's title ("· thread name") opens as you leave Threads and shuts as you come back. It used to snap, and every tab after it jumped.
  • Leaving Threads, the sidebar stays over the new page until bb has drawn it, then slides away (160ms, ease-in). Its space still collapses instantly, so the page lays out once.
  • Opening Settings slides its sections in with the same entrance.
  • The new page fades in on leaving Threads and going to or from Settings, starting with the sidebar's exit. Switching between other tabs keeps the layout and stays instant, like browser tabs. Leaving Threads for Plugins or Skills, bb swaps in that page's own sidebar partway through, so the old one disappears with it rather than sliding.
  • With reduced motion on, nothing animates.

Getting it to play once, and play smoothly

  • Played with the Web Animations API, not a class on <html>. bb swaps the sidebar and page elements during some navigations, and a class made every new element start the slide again.
  • Coming back from Plugins, Skills or Settings, the first frames still show that page's own sidebar and content. Those are held out of sight until bb has the thread list ready, so the thread list is what slides in. bb marks each page's sidebar in its top row's test id (app-… vs skills-…). Only non-thread-list marks count, so a rename falls back to the plain behaviour.
  • The entrance waits until bb has drawn the thread: two quick frames in a row, or 300ms at most. Started earlier, its clock ran through bb's long render frames, and the sidebar appeared half done or froze partway. The title's width animation runs on the main thread and would stall outright.
  • Any element bb mounts mid-entrance takes the running animation's start time, so it carries on instead of restarting.

Testing

  • npm run check passes: typecheck, tests (77 for Top Tabs) and builds.
  • Checked in a headless bb with the plugin linked:
    • Chromium's trace shows the slide and fade running on the compositor.
    • Recorded frames show the sidebar slide starting near 0% and running smoothly to the end on returns from BB Live, Skills and Plugins, on leaving Threads for BB Live and Skills, and on opening Settings. The page fade starts on the same frame as the sidebar's exit, and BB Live → Skills stays instant.
    • Element tracing shows one entrance per return.
  • Also tried in the desktop app during development: the double slide from Plugins/Skills and the mid-slide pause were both reported there and fixed.

🤖 Generated with Claude Code

matthewdias and others added 5 commits October 4, 2026 17:26
The strip opens the sidebar instantly on a tab switch, so the page lays
out once at its final width. Coming back to Threads, the sidebar and a
freshly rendered thread therefore just appeared. Keep the instant layout
and draw the motion on top with compositor-only properties: the sidebar
slides in over the space it already holds, and the thread fades in.
Reduced motion turns both off.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Leaving Plugins or Skills, bb mounts a fresh sidebar and page shell for
the thread after the old ones are on screen. The entrance was a class on
<html>, so the new elements started the slide and fade over again. Play
it with the Web Animations API on the elements there, and give anything
bb mounts in their place the running start time, so it carries on.

The Threads tab's thread title now opens and shuts by width, keyed on the
route, so it moves with the sidebar and the page instead of snapping and
pulling every tab after it left.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Coming back to Threads from Plugins, Skills or Settings, the first frame
still shows that page's own sidebar and content while bb renders the
thread, so the entrance slid Skills' sidebar in and then bb swapped the
thread list in without one. Hold another page's sidebar and content at the
entrance's first keyframe until that sidebar leaves, then start the
entrance on what is there. bb marks each page's sidebar in its top row's
test id; only non-thread-list marks count, so a rename falls back to the
old behaviour.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The slide and fade started as the navigation began, then bb laid out the
thread in long frames: the compositor's clock ran while nothing new was on
screen, so the sidebar appeared most of the way in, or stalled partway.
The Threads tab's title animates its width on the main thread and froze
outright. Hold the entrance at its first keyframe until frames come
steadily again (two quick frames, or 300ms at most), then start the
slide, the fade and the title together.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Leaving Threads, the strip still collapses the sidebar instantly so the
new page lays out once at full width, but the sidebar is now drawn over
it where it was until bb has drawn that page, then slides away on the
compositor. bb hides a collapsed sidebar and moves it a width left, so
visibility is held and the slide translates back by that width.

Opening Settings slides its sections in with the same entrance as the
return to Threads, waiting for Settings' own sidebar rather than the
thread list's.

syncSidebar stopped running entrances every time it ran, including the
second pass once bb has rendered the page, which cut the exit off before
it started. It now stops them only on a real move.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@matthewdias matthewdias changed the title Animate the return to Threads in Top Tabs Animate the sidebar and thread when switching to and from Threads in Top Tabs Oct 5, 2026
Leaving Threads, the destination appeared at once while the sidebar slid
off it. It now fades in, as the thread does on the way back, and so does
the page going to or from Settings, whose sidebar is its own. Switching
between other tabs keeps the layout and stays instant.

Both the fade and the sidebar's exit wait for the page being left to go
(bb keeps its page shell and <main> and swaps what is inside), then for
bb to finish drawing, so they start together and never fade the old page
back in. Entrances now take that wait as a predicate.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@matthewdias
matthewdias merged commit 29bc359 into main Oct 5, 2026
1 check passed
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.

1 participant