Skip to content
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

web: new sidebar ui #7081

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Conversation

01zulfi
Copy link
Collaborator

@01zulfi 01zulfi commented Dec 10, 2024

Signed-off-by: 01zulfi [email protected]

@thecodrr
Copy link
Contributor

thecodrr commented Dec 20, 2024

Just gave this a test run. A few bugs:

  1. The middle pane is still navigating when switching to Notebooks/Tags in the sidebar
  2. Adding a subnotebook when a root notebook is collapsed doesn't properly expand the root notebook in the tree
  3. Adding a new notebook at the root level is not possible after adding the first notebook
  4. Adding a new tag is not possible from the sidebar
  5. The counts in the sidebar aren't updated when creating a new note

@01zulfi 01zulfi force-pushed the feat/sidebar-ui branch 2 times, most recently from 33b18e3 to 85e0162 Compare December 24, 2024 10:49
@01zulfi 01zulfi changed the title web: (wip) new sidebar web: new sidebar ui Dec 24, 2024
@01zulfi 01zulfi marked this pull request as ready for review December 24, 2024 10:57
Copy link
Contributor

@thecodrr thecodrr left a comment

Choose a reason for hiding this comment

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

Good work overall but since this contains a lot of changes, I'll have to review it chunk by chunk.

apps/web/src/components/navigation-menu/index.tsx Outdated Show resolved Hide resolved
apps/web/src/components/route-container/index.tsx Outdated Show resolved Hide resolved
Comment on lines +88 to +96
// const children = await getChildNodes(rootId, -1);
// setNodes(children);
const nodes = await fetchChildren(
rootId,
-1,
expandedIds,
getChildNodes
);
setNodes(nodes);
Copy link
Contributor

Choose a reason for hiding this comment

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

Why this change?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Whenever the tree was refreshed, the children of expanded notebooks weren't loaded. This change fixed that

apps/web/src/navigation/routes.tsx Outdated Show resolved Hide resolved
Comment on lines 42 to 49
useEffect(() => {
if (location === "sidebar") return;
tags?.item(0).then((item) => {
if (item && item?.item) {
navigate(`/tags/${item.item.id}`);
}
});
}, [tags, location]);
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this is needed.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is in case a user manually navigates to app.notesnook.com/tags, we can redirect them to the first tag. Plus this also prevents showing the tags listing in the middle pane.

@thecodrr
Copy link
Contributor

thecodrr commented Jan 2, 2025

You will also have to run a rebase with master.

Signed-off-by: 01zulfi <[email protected]>
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.

2 participants