Skip to content

refactor: transform useSidebar composable to a pinia store#1897

Merged
JammingBen merged 2 commits intomainfrom
refactor/use-sidebar-to-store
Feb 3, 2026
Merged

refactor: transform useSidebar composable to a pinia store#1897
JammingBen merged 2 commits intomainfrom
refactor/use-sidebar-to-store

Conversation

@JammingBen
Copy link
Member

@JammingBen JammingBen commented Jan 29, 2026

Replaces the useSideBar composable with a pinia store. This results in some changes across the code base:

  • we don't need to pass the sidebar states around since the global store is accessible from everywhere
  • we don't need to rely on events to toggle the sidebar, hence those have been deprecated in favor of store actions

closes #1397

@JammingBen JammingBen self-assigned this Jan 29, 2026
@JammingBen JammingBen added the Type:Maintenance E.g. technical debt, packaging, etc. label Jan 29, 2026
@JammingBen JammingBen force-pushed the refactor/use-sidebar-to-store branch 3 times, most recently from 582e679 to 58506ab Compare January 29, 2026 15:31
Replaces the `useSideBar` composable with a pinia store. This results in some changes across the code base:

* we don't need to pass the sidebar states around since the global store is accessible from everywhere
* we don't need to rely on events to toggle the sidebar, hence those have been deprecated in favor of store actions
@JammingBen JammingBen force-pushed the refactor/use-sidebar-to-store branch from 58506ab to 091bfd1 Compare January 29, 2026 15:38
@JammingBen JammingBen marked this pull request as ready for review January 29, 2026 16:08
@JammingBen JammingBen requested a review from kulmann February 2, 2026 08:17
Copy link
Member

@kulmann kulmann left a comment

Choose a reason for hiding this comment

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

Thanks for the cleanup 😍 Also click-tested it and couldn't find anything broken. Nice job!

sideBarActivePanel.value = panelName
}

eventBus.subscribe(SideBarEventTopics.toggle, toggleSideBar)
Copy link
Member

Choose a reason for hiding this comment

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

should we be really annoying and wrap the functions into another function which prints a deprecation message to debug output? 🙈

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think we really need to, no? When using the event with SideBarEventTopics like you usually do, you immediately see in your IDE that this is deprecated.

@JammingBen JammingBen merged commit d27fb8d into main Feb 3, 2026
28 checks passed
@JammingBen JammingBen deleted the refactor/use-sidebar-to-store branch February 3, 2026 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type:Maintenance E.g. technical debt, packaging, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Transform useSideBar composable into a store

2 participants