♻️(frontend) new create button for docs#2423
Merged
Merged
Conversation
Contributor
|
Size Change: +1.89 kB (+0.04%) Total Size: 4.34 MB 📦 View Changed
|
371c6ca to
97834b6
Compare
Ovgodd
approved these changes
Jun 23, 2026
Ovgodd
left a comment
Collaborator
There was a problem hiding this comment.
just a little suggestion for readability but nice PR !
Comment on lines
+28
to
+41
|
|
||
| return ( | ||
| <> | ||
| <Button | ||
| href="/docs/new" | ||
| data-testid="new-doc-button" | ||
| color="brand" | ||
| onClick={(e) => { | ||
| if (!e.ctrlKey && !e.metaKey && !e.shiftKey) { | ||
| e.preventDefault(); | ||
| void router.push('/docs/new'); | ||
| } | ||
| onClose?.(); | ||
| }} |
Collaborator
There was a problem hiding this comment.
Suggested change
| return ( | |
| <> | |
| <Button | |
| href="/docs/new" | |
| data-testid="new-doc-button" | |
| color="brand" | |
| onClick={(e) => { | |
| if (!e.ctrlKey && !e.metaKey && !e.shiftKey) { | |
| e.preventDefault(); | |
| void router.push('/docs/new'); | |
| } | |
| onClose?.(); | |
| }} | |
| const handleNewClick = (e: React.MouseEvent<HTMLAnchorElement>) => { | |
| if (!e.ctrlKey && !e.metaKey && !e.shiftKey) { | |
| e.preventDefault(); | |
| void router.push('/docs/new'); | |
| } | |
| onClose?.(); | |
| }; | |
| // ... | |
| <Button href="/docs/new" onClick={handleNewClick} ...> | |
| return ( | |
| <> | |
| <Button | |
| href="/docs/new" | |
| data-testid="new-doc-button" | |
| color="brand" | |
| onClick={handleNewClick } |
97834b6 to
fd033f3
Compare
New create button for docs. It is now a link button instead of a pure button, meaning we can navigate to this new created doc and open it in another tab by doing ctrl + click. This new button has a dropdown menu that allows users to import a docx file or a markdown file. We removed the old import button.
We added a sub button to create sub-documents from the New button. This sub button is only visible when the user is in a document, and it allows them to create a new document that is a child of the current document.
fd033f3 to
4585fd8
Compare
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.
Purpose
New create button for docs.
It is now a link button instead of a pure button, meaning we can navigate to this new created doc and open it in another tab by doing ctrl + click.
This new button has a dropdown menu that allows users to import a docx file or a markdown file.
We removed the old import button.
This is part of the UI V3: #2364
Demo