feat(sidebar): accordion menu with slide-down animation#103
Merged
Conversation
- Single-open accordion for top-level sidebar groups: expanding one collapses the others, via a shared openItemId in LayoutMenu. - Auto-open the group that owns the active item; fall back to the first group so a menu is always expanded by default. - Slide-down expand/collapse using grid-template-rows 0fr <-> 1fr, clipped with overflow-hidden and respecting prefers-reduced-motion. - Collapsed submenus stay mounted (aria-hidden) so the exit transition can play. Fixes the one-way auto-expand latch where a parent stayed open after the active selection moved to another group, which left multiple groups (notably the first item) expanded at once on deep links.
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthrough
ChangesLayout menu accordion
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant LayoutMenu
participant MenuItemRenderer
participant SubMenuItemRenderer
User->>MenuItemRenderer: Toggle top-level parent
MenuItemRenderer->>LayoutMenu: Invoke onToggle
LayoutMenu->>LayoutMenu: Update openItemId
LayoutMenu->>MenuItemRenderer: Pass controlled open state
MenuItemRenderer->>SubMenuItemRenderer: Render submenu transition
Possibly related PRs
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
kzamanbd
added a commit
to getdokan/dokan
that referenced
this pull request
Jul 21, 2026
kzamanbd
added a commit
to getdokan/dokan
that referenced
this pull request
Jul 21, 2026
…s UI (#3334) * test(settings): repair admin settings migration E2E for React settings UI The 5.0 React settings UI dropped the legacy #dokan_settings_* DOM ids the migration spec relied on, so the whole adminSettingsMigration spec was dead (0 passing — every test stalled on navigation). - Migrate the page object to role-based navigation and data-testid="settings-field-*" field locators, verified live against the UI. - Fix inverse-mapping old-settings getters/setters (show-customer, add-to-cart visibility, welcome wizard) to expose the positive semantic instead of the raw negated legacy field; the migration bridge itself was verified correct via the DB. - Rewrite the vendor setup wizard logo test for the new media flow (Upload Image / Change -> upload -> Select -> preview); made idempotent. - Update Vendor Capabilities field ids to the flat schema and skip the Product Popup case (no equivalent field in the new UI). Result: 18 passed, 1 flaky (retry-recovered), 1 skipped, 0 failed. * chore(deps): bump @wedevs/plugin-ui to sidebar-accordion (getdokan/plugin-ui#103)
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
Reworks the settings sidebar menu (
LayoutMenu) so top-level groups behave as a single-open accordion with a slide-down animation, and fixes a latch bug where more than one group could stay expanded.Changes
openItemIdinLayoutMenu. Opening a group collapses the others. Nested sub-items keep their own local state.grid-template-rows: 0fr ↔ 1fr(clipped withoverflow-hidden) — auto content height, pure CSS, both directions. Honorsprefers-reduced-motion. Collapsed submenus stay mounted (aria-hidden) so the exit transition can play.MenuItemRenderergains optionalopen/onToggleprops; whenonToggleis passed it is controlled (accordion), otherwise it keeps the previous local-state behavior for standalone use.Bug fixed
Previously each parent kept independent local open state with a one-way auto-expand (opened on active-descendant, never closed). After navigating away, a group stayed open next to the newly-active one — most visibly the first group remained expanded on deep links into another group. Single shared state makes that impossible.
Behavior
Testing
Verified live in the Dokan admin settings via
aria-expandedstate:grid-template-rowsinterpolates 0 → full height over ~200ms on expand.npm run build(webpack +tsctypes) and ESLint both clean.Notes
dist/is gitignored, so this PR is source-only; consumers rebuild.Summary by CodeRabbit