mirror of
https://github.com/Mintplex-Labs/anything-llm.git
synced 2026-03-02 22:57:05 -05:00
[FEAT]: Refactor settings pages to use a shared layout with React Router instead of duplicating SettingsSidebar in every page #3219
Labels
No labels
Desktop
Docker
Integration Request
Integration Request
OS: Linux
OS: Mobile
OS: Windows
UI/UX
blocked
bug
bug
core-team-only
documentation
duplicate
embed-widget
enhancement
feature request
github_actions
good first issue
investigating
needs info / can't replicate
possible bug
question
stage: specifications
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/anything-llm#3219
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @angelplusultra on GitHub (Feb 27, 2026).
What would you like to see?
Problem
The
SettingsSidebarcomponent is individually imported and rendered inside every single settings page (27 pages total — 19 underGeneralSettings/and 8 underAdmin/). Each page duplicates the same layout wrapper pattern:This causes several issues:
Sidebar remounts on every navigation — Because each page treats the sidebar as its own component instance, navigating between settings pages fully unmounts and remounts the sidebar. This means any transient state (scroll position, mobile menu open/closed, hover states) is lost on every page change. It also causes unnecessary re-renders and flicker.
Maintenance burden — Any change to the settings layout wrapper (spacing, responsive behavior, class names) must be replicated across all 27 files. Some pages have already drifted — for example,
PrivacyAndDataincludeslight:border light:border-theme-sidebar-borderin its wrapper classes while most other pages don't.Inconsistent structure — Because each page owns its own layout, there's no guarantee of structural consistency. Pages can (and do) subtly diverge in their wrapper markup.
Affected files
frontend/src/components/SettingsSidebar/index.jsx— The sidebar component itself (484 lines)19 GeneralSettings pages:
GeneralSettings/LLMPreferenceGeneralSettings/VectorDatabaseGeneralSettings/EmbeddingPreferenceGeneralSettings/EmbeddingTextSplitterPreferenceGeneralSettings/AudioPreferenceGeneralSettings/TranscriptionPreferenceGeneralSettings/ApiKeysGeneralSettings/ChatEmbedWidgetsGeneralSettings/ChatsGeneralSettings/PrivacyAndDataGeneralSettings/SecurityGeneralSettings/BrowserExtensionApiKeyGeneralSettings/MobileConnectionsGeneralSettings/Settings/InterfaceGeneralSettings/Settings/BrandingGeneralSettings/Settings/ChatGeneralSettings/CommunityHub/TrendingGeneralSettings/CommunityHub/AuthenticationGeneralSettings/CommunityHub/ImportItem/Steps8 Admin pages:
Admin/UsersAdmin/WorkspacesAdmin/InvitationsAdmin/AgentsAdmin/DefaultSystemPromptAdmin/SystemPromptVariablesAdmin/LoggingAdmin/ExperimentalFeaturesProposed solution
Use React Router's layout route pattern to render the sidebar once at a parent level, with individual settings pages rendered as child
<Outlet />content. This is a first-class feature of React Router v6.1. Create a
SettingsLayoutcomponent:2. Refactor routes in
frontend/src/main.jsx:Convert the flat settings routes into nested routes under the layout:
3. Simplify each settings page — Remove the
<Sidebar />import/render and the outer layout wrapper from all 27 pages. Each page would only export its own content.Benefits