-
-
Notifications
You must be signed in to change notification settings - Fork 287
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
Add app navigation sidebar #1819
Conversation
</Box> | ||
</Toolbar> | ||
</AppBar> | ||
<Toolbar /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This <Toolbar />
element adds spacing because the AppBar
position was changed to fixed
so that it's not constrained by the new sidebar.
As per recommended in MUI Drawer docs https://mui.com/material-ui/react-drawer/ ("Clipped under the app bar")
version: VersionOrPreview; | ||
} | ||
|
||
function ToolpadAppLayout({ dom, version, hasShell: hasShellProp = true }: ToolpadAppLayoutProps) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved these to their own component so that we can use React Router hooks.
Nice! Is it that both preview options (1. right panel and 2. top bar) show the same result i.e, the preview for the entire app? If we want to make |
The option at the top opens the app in preview but starting in the default page, while the right-side option opens the app starting in that specific page. So I think it's fine to keep these separate options?
I can add a "Preview" option from the ellipsis menu of each page, but I feel like it should open without |
Intuitively what makes most sense to me is for the top button to open the current page and to remove the button on the right.
As a start I would propose to just document this option in the docs and nothing more |
Agreed, didn't consider that but seems more intuitive, I'll do that instead. |
Would it make sense for the "edit" button on the Toolpad application to do the reverse operation? i.e. open the page editor of the page you were viewing. |
Yes, I think that would make sense. Currently, it shows the first page in edit mode. |
<List | ||
component="nav" | ||
subheader={ | ||
<ListSubheader id={NAV_LIST_SUBHEADER_ID} sx={{ px: 4 }}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps you can leverage React.useId()
here?
280f2b9
to
b811615
Compare
I was thinking, this will break all embeds that are currently in notion already. Our options:
Personally my preference goes out to 3. Would it be hard to implement? I'm fine dealing with this in a separate PR, but we need to prioritize it then so that it makes it in the same release as this one. |
I was thinking option 1 for now but 2 or 3 also seem fine. |
For me, an app-level setting is useful for this since it affects all pages. I was also wondering whether this is a good way to introduce "layouts" to the app: You can start with layout option 1 (a sidebar for navigation), or 2 (full page content, and a separate page for navigation) and then in the future, potentially, option 3 (tabs for navigation?), option 4 ... |
I just implemented option 3 but if we see it doesn't feel that useful we can try the other ones... I guess it would also depend on people's use cases, whether anyone would like different display settings per page or most people would use the same for every page. Also this could definitely support different layouts / navigation UIs. |
I'm not sure the app-wide setting would be the best solution for us. The tools-public application has pages that we need to be chromeless, as well as pages that we need to have the sidebar. |
Ok that's good to hear, I guess option 3 should be good then. |
I've implemented option 3 as discussed:
Screen.Recording.2023-03-31.at.14.59.11.movLet me know if you have any more feedback or I can merge it later today or early next week! |
Closes #813
Closes #1547
?toolpad-display=standalone
Development:
Screen.Recording.2023-03-28.at.18.44.31.mov
Production
Screen.Recording.2023-03-27.at.20.43.07.mov