refactor: remove SidebarPanel enum + panel-ID lookup table (#408, #409) - #414
Merged
Merged
Conversation
Replace the SidebarPanel enum with plain String panel IDs throughout the GTK backend. #[watch] expressions use string comparisons against sidebar constants (PANEL_EXPLORER, etc.). Extension panels use "ext:" prefix. sync_sidebar_widgets() now uses lookup-table arrays for panel box visibility and DA focus grab instead of per-variant match arms. Adding a new panel requires one entry in each array, not a new enum variant + match arms in 4 places. Removes: SidebarPanel enum, activity_id_to_panel(), to_panel_id(), from_panel_id(). Msg::SwitchPanel now carries a String panel ID. Closes #408 Closes #409 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
JDonaghy
force-pushed
the
issue-408-409-sidebar-panel-cleanup
branch
from
May 16, 2026 15:48
5321282 to
f9cbf06
Compare
JDonaghy
added a commit
that referenced
this pull request
May 16, 2026
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
GTK: remove SidebarPanel enum — read panel state from engine AppShell in #[watch] bindings #408: Removes the
SidebarPanelenum entirely.active_panel_id: Stringreplacesactive_panel: SidebarPanel. All#[watch]expressions use string comparisons againstPANEL_EXPLORER,PANEL_SEARCH, etc. Extension panels use"ext:"prefix withis_ext_panel_id()/ext_panel_name()helpers.Msg::SwitchPanelcarries aStringpanel ID instead of an enum variant.GTK: collapse sidebar widget sync into a panel-DA lookup table #409:
sync_sidebar_widgets()uses lookup-table arrays for panel box visibility and DA focus grab. Adding a new panel = one entry per array, not a new enum variant + match arms in 4 places.Removes:
SidebarPanelenum (73 references),activity_id_to_panel(),to_panel_id(),from_panel_id(). Net -55 lines.Closes #408
Closes #409
Test plan
cargo test --no-default-features --lib— 1963 passedcargo clippy -- -D warnings— clean🤖 Generated with Claude Code