Skip to content

feat: rail UI exploration#15471

Draft
JarrodMFlesch wants to merge 18 commits intomainfrom
feature/sidebar-rail-exploration
Draft

feat: rail UI exploration#15471
JarrodMFlesch wants to merge 18 commits intomainfrom
feature/sidebar-rail-exploration

Conversation

@JarrodMFlesch
Copy link
Copy Markdown
Contributor

⚠️ This is early stages exploration

The config would likely need a new entry point for rail items. I think it could be an offering alongside the tabular approach in #15470

543115763-72565cd5-d1de-454b-816f-bf541a90d0c4

JarrodMFlesch and others added 18 commits January 15, 2026 14:41
Add type definitions for extensible sidebar tab system. Tabs can be
registered at config.admin.sidebar.tabs with icon, content component,
and override/disable support.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Create default tab component for displaying collections and globals.
This will be the built-in tab shown by default in sidebar.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Create function that returns built-in sidebar tabs. Currently just
the collections tab, but more can be added later.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Implement config merging logic for sidebar tabs:
- Combines built-in + user tabs
- Merges by slug (override support)
- Filters disabled tabs
- Fully tested

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Ensure sidebar tab icons and components are included in import map
generation so they can be resolved at runtime.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Load active tab from user preferences on mount and save changes.
Ensures tab selection persists across sessions.

- Add activeTab field to NavPreferences type
- Update getNavPrefs to fetch sidebar preferences separately
- Pass navPreferences to SidebarTabsClient
- Save tab changes using setPreference hook

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Move sidebar.tabs from admin.sidebar to admin.components.sidebar
  to be consistent with other component slots
- Update styles to be edge-to-edge like original DefaultNavClient
- Remove horizontal padding from tabs and content
- Add proper width and flex-grow to match nav layout

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Replace made-up CSS variables with actual design system:
- Use base() SCSS function for spacing
- Use --style-radius-l for border radius
- Use --theme-border-color for borders
- Use @include shadow-sm mixin
- Use proper sr-only pattern for labels

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Use auto-fit grid with 24% minmax for responsive 4-column layout
- Remove aspect-ratio for flexible tab sizing
- Reduce padding on individual tabs to calc(var(--base) / 4)
- Update border radius: container to --style-radius-m, tabs to --style-radius-s
- Remove container padding, use gap only
- Active tab border color to --theme-elevation-100

Result: 2-4 tabs fill width, 5+ tabs wrap to max 4 per row.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Create packages/payload/src/preferences/keys.ts with PREFERENCE_KEYS constants
- Replace all preference key strings with imported constants
- Rename sidebar preference key from 'sidebar' to 'nav-sidebar-active-tab'
- Update all files using preferences to import PREFERENCE_KEYS

This prevents typos and makes preference keys more discoverable and maintainable.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Remove CollectionsTab component (poorly named, showed collections AND globals)
- Replace with DefaultNavClient throughout for consistency
- Update Nav to fall back to DefaultNavClient when no custom tabs configured
- Pass explicit props instead of spreading to SidebarTabs
- Move test components from test/_community to test/admin
- Add e2e tests for sidebar tabs functionality

Tests cover:
- Rendering custom sidebar tabs
- Switching between tabs
- Persisting active tab in preferences
- Default nav tab behavior

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant