Skip to content

Conversation

arndom
Copy link
Contributor

@arndom arndom commented Jul 20, 2025

PR Checklist

Please check if your PR fulfills the following requirements:

Bugs / Features

What is the current behavior?

Nested sider items are collapsed by default.

What is the new behavior?

Nested sider items can now have expanded/collapsed as the default.

Resolves #6721

Notes for reviewers

@arndom arndom requested a review from a team as a code owner July 20, 2025 16:56
Copy link

changeset-bot bot commented Jul 20, 2025

🦋 Changeset detected

Latest commit: d9724c0

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@refinedev/chakra-ui Minor
@refinedev/mantine Minor
@refinedev/antd Minor
@refinedev/core Minor
@refinedev/mui Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

netlify bot commented Jul 20, 2025

Deploy Preview for refine-doc-live-previews ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit d9724c0
🔍 Latest deploy log https://app.netlify.com/projects/refine-doc-live-previews/deploys/68b6b9f6267a6100082167c7
😎 Deploy Preview https://deploy-preview-6880--refine-doc-live-previews.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@arndom arndom changed the title Feat(core): add siderItems.isCollapsed to refine options to set default expanded for nested sider items Feat(core): add siderItems.isCollapsed to refine options to set default expanded Jul 20, 2025
@arndom arndom changed the title Feat(core): add siderItems.isCollapsed to refine options to set default expanded Feat(core): add siderItems.isCollapsed to refine options Jul 25, 2025
@arndom arndom changed the title Feat(core): add siderItems.isCollapsed to refine options feat(core): add siderItems.isCollapsed to refine options Jul 26, 2025
@alicanerdurmaz alicanerdurmaz added this to the July 2025 Release milestone Jul 29, 2025
@alicanerdurmaz alicanerdurmaz modified the milestone: July 2025 Release Aug 7, 2025
@alicanerdurmaz
Copy link
Member

Hello @arndom, thanks for improving Refine 🚀

Sorry for the late reply.

Instead of passing this directly to <Refine />, I think it would be better to pass it as a prop to <ThemedSiderV2 />.
That way, the code will be easier to follow, and since we won’t be using this feature anywhere else in Refine, it feels like a more appropriate place for it.

What do you think?

import { ThemedLayoutV2, ThemedSiderV2 } from "@refinedev/antd";

<ThemedLayoutV2
  Sider={() => (
    <ThemedSiderV2
      siderItemsAreCollapsed={true}
    />
  )}
/>

@arndom
Copy link
Contributor Author

arndom commented Aug 7, 2025

No worries, @alicanerdurmaz.

Yh, I agree. I did it that way because of the issue's description, but in hindsight, it does make the code clearer if the options to control the sider are its props.

I'll implement it later today.

@arndom arndom changed the title feat(core): add siderItems.isCollapsed to refine options feat(core): add siderItemsAreCollapsed prop to sider components Aug 8, 2025
@arndom arndom changed the title feat(core): add siderItemsAreCollapsed prop to sider components feat(core): add siderItemsAreCollapsed prop to sider components Aug 8, 2025
@erenkurnaz erenkurnaz requested a review from Copilot September 2, 2025 09:47
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a new siderItemsAreCollapsed prop to sider components across all UI packages (Ant Design, Material-UI, Mantine, Chakra-UI) to control whether nested sidebar items are expanded or collapsed by default.

Key changes:

  • Added the siderItemsAreCollapsed boolean prop with a default value of true to maintain backward compatibility
  • Implemented logic in each UI package to respect this prop when determining default expansion state
  • Updated documentation across all UI integration guides to document the new prop

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/ui-types/src/types/layout.tsx Added type definition for the new prop
packages/mui/src/components/themedLayoutV2/sider/index.tsx Implemented prop logic for Material-UI sider
packages/mantine/src/components/themedLayoutV2/sider/index.tsx Implemented prop logic for Mantine sider
packages/chakra-ui/src/components/themedLayoutV2/sider/index.tsx Implemented prop logic for Chakra-UI sider
packages/antd/src/components/themedLayoutV2/sider/index.tsx Implemented prop logic for Ant Design sider
documentation/docs/ui-integrations/*/components/themed-layout/index.md Updated documentation tables to include the new prop
.changeset/purple-bobcats-reflect.md Added changeset for the feature

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Contributor

@erenkurnaz erenkurnaz left a comment

Choose a reason for hiding this comment

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

Hello, @arndom thanks for your contribution, great work! 🚀

@BatuhanW BatuhanW merged commit 2b4c208 into refinedev:main Sep 2, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEAT] Multi level menu - option to show expanded menu by default
4 participants