refactor(toolbar): extract button sections into dedicated components#4761
Merged
gregpriday merged 1 commit intodevelopfrom Apr 1, 2026
Merged
Conversation
- Extract GitHubStatsToolbarButton with useImperativeHandle for overflow coordination - Extract NotificationCenterToolbarButton with own store subscriptions - Extract ToolbarLauncherButton for terminal/browser/panel-palette buttons - Extract ToolbarSettingsButton with context menu and keybinding - Extract ToolbarProblemsButton with diagnostics shortcut - Extract ToolbarPortalButton with portal store subscription - Reduce Toolbar.tsx from 1532 to 1000 lines - Reduce buttonRegistry useMemo deps from 52 to 22 items - Update source-level tests to read from new component files
40812c6 to
0f7daed
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Toolbar.tsx's inlinebuttonRegistry, reducing the file from 1532 to ~1000 linesbuttonRegistryuseMemodependency array shrinks from 52 to 22 itemsResolves #4736
Changes
GitHubStatsToolbarButton.tsx(341 lines) — full GitHub stats section withuseImperativeHandlefor overflow coordinationNotificationCenterToolbarButton.tsx(79 lines) — notification centre buttonToolbarLauncherButton.tsx(102 lines) — terminal/browser launcher buttonsToolbarPortalButton.tsx(49 lines) — portal buttonToolbarProblemsButton.tsx(52 lines) — problems/diagnostics buttonToolbarSettingsButton.tsx(105 lines) — settings buttonToolbar.tsxreduced accordingly, with imports replacing the inline render functionsTesting
All 159 existing tests pass. Typecheck and lint clean. The existing
Toolbar.githubDropdowns.test.tsandToolbar.shortcuts.test.tssuites were updated to account for the new component boundaries.