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

Change sidebar tree creation to use path instead of parentId. Also move sidebar to web-ui #47

Merged
merged 1 commit into from
Jul 19, 2024

Conversation

andresgutgon
Copy link
Contributor

What?

We decided to start using document.path as source of truth. We need to change sidebar tree creation

@andresgutgon andresgutgon added the 🚧 wip Work in progress label Jul 19, 2024
@andresgutgon andresgutgon force-pushed the feature/prettify-sidebar branch 2 times, most recently from 68dc0f8 to ea7ba6f Compare July 19, 2024 15:20
isRoot = false,
name = '',
}: {
id: string
Copy link
Collaborator

Choose a reason for hiding this comment

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

what is this id? do we need it?

Copy link
Contributor Author

@andresgutgon andresgutgon Jul 19, 2024

Choose a reason for hiding this comment

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

for key react elements in the dom tree. Is nice to do key={node.id}

@andresgutgon andresgutgon removed the 🚧 wip Work in progress label Jul 19, 2024
@andresgutgon andresgutgon force-pushed the feature/prettify-sidebar branch from ea7ba6f to 917de40 Compare July 19, 2024 15:57
// We pre-sorted documents by path depth, so we know
// that the parent node exists
const parent = nodeMap.get(parentPath)!
parent.children.push(node)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Before pushing the node find their place alphabetically. if it's a folder goes first.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll do this in another PR Carlos wants this code

Copy link
Contributor

@csansoon csansoon left a comment

Choose a reason for hiding this comment

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

👍

@andresgutgon andresgutgon merged commit d6f7737 into main Jul 19, 2024
2 checks passed
@andresgutgon andresgutgon deleted the feature/prettify-sidebar branch July 19, 2024 16:10
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.

3 participants