-
Notifications
You must be signed in to change notification settings - Fork 340
feat(sidebar): Provide renderToggleButton for custom toggle component #4371
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
WalkthroughAdded Changes
Sequence DiagramsequenceDiagram
participant App as ContentSidebar
participant Sidebar
participant SidebarNav
participant SidebarToggle as SidebarToggle
participant CustomRenderer as Custom Renderer<br/>(if provided)
participant DefaultButton as SidebarToggleButton<br/>(default)
App->>Sidebar: renderToggleButton prop
Sidebar->>SidebarNav: renderToggleButton prop
SidebarNav->>SidebarToggle: renderToggleButton prop
Note over SidebarToggle: On mount/re-render
SidebarToggle->>SidebarToggle: Create renderProps<br/>{isOpen, onClick, data-*}
alt renderToggleButton provided
SidebarToggle->>CustomRenderer: renderToggleButton(renderProps)
CustomRenderer-->>SidebarToggle: Custom JSX
else renderToggleButton not provided
SidebarToggle->>DefaultButton: Render with<br/>onClick handler
DefaultButton-->>SidebarToggle: Default JSX
end
Note over SidebarToggle: On click
SidebarToggle->>SidebarToggle: handleToggleClick invoked
SidebarToggle->>SidebarToggle: Update state via<br/>history.replace or<br/>internalSidebarNavigationHandler
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (7)
🧰 Additional context used🧠 Learnings (10)📓 Common learnings📚 Learning: 2025-09-03T18:10:42.760ZApplied to files:
📚 Learning: 2025-09-03T18:10:29.467ZApplied to files:
📚 Learning: 2025-06-17T13:30:02.172ZApplied to files:
📚 Learning: 2025-09-03T18:30:44.447ZApplied to files:
📚 Learning: 2025-06-25T13:09:54.538ZApplied to files:
📚 Learning: 2025-06-25T13:09:45.168ZApplied to files:
📚 Learning: 2025-08-27T17:03:48.322ZApplied to files:
📚 Learning: 2025-06-25T13:10:19.128ZApplied to files:
📚 Learning: 2025-06-11T16:30:10.431ZApplied to files:
🧬 Code graph analysis (5)src/elements/content-sidebar/SidebarToggle.js (4)
src/elements/content-sidebar/__tests__/SidebarToggle.test.js (2)
src/elements/content-sidebar/Sidebar.js (2)
src/elements/content-sidebar/ContentSidebar.js (2)
src/elements/content-sidebar/SidebarNav.js (2)
🪛 Biome (2.1.2)src/elements/content-sidebar/SidebarToggle.js[error] 12-16: 'import type' are a TypeScript only feature. Convert your file to a TypeScript file or remove the syntax. TypeScript only syntax (parse) [error] 17-25: type alias are a TypeScript only feature. Convert your file to a TypeScript file or remove the syntax. TypeScript only syntax (parse) [error] 34-34: Type annotations are a TypeScript only feature. Convert your file to a TypeScript file or remove the syntax. TypeScript only syntax (parse) [error] 36-36: Type annotations are a TypeScript only feature. Convert your file to a TypeScript file or remove the syntax. TypeScript only syntax (parse) src/elements/content-sidebar/Sidebar.js[error] 34-34: 'import type' are a TypeScript only feature. Convert your file to a TypeScript file or remove the syntax. TypeScript only syntax (parse) src/elements/content-sidebar/ContentSidebar.js[error] 51-51: 'import type' are a TypeScript only feature. Convert your file to a TypeScript file or remove the syntax. TypeScript only syntax (parse) src/elements/content-sidebar/SidebarNav.js[error] 38-42: 'import type' are a TypeScript only feature. Convert your file to a TypeScript file or remove the syntax. TypeScript only syntax (parse) ⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
🔇 Additional comments (8)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
96c30a5 to
eba34e5
Compare
Sidebar toggle button now supports custom rendering, enabling developers to tailor its appearance and interactions.
Usage example
✏️ Tip: You can customize this high-level summary in your review settings.