Skip to content

♻️(frontend) new create button for docs#2423

Merged
AntoLC merged 2 commits into
mainfrom
feat/new-create-button
Jun 23, 2026
Merged

♻️(frontend) new create button for docs#2423
AntoLC merged 2 commits into
mainfrom
feat/new-create-button

Conversation

@AntoLC

@AntoLC AntoLC commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

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

image

@AntoLC AntoLC self-assigned this Jun 12, 2026
@AntoLC AntoLC added enhancement improve an existing feature frontend refacto labels Jun 12, 2026
@AntoLC AntoLC mentioned this pull request Jun 12, 2026
@github-actions

github-actions Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Size Change: +1.89 kB (+0.04%)

Total Size: 4.34 MB

📦 View Changed
Filename Size Change
apps/impress/out/_next/static/88b33c2e/_buildManifest.js 674 B +674 B (new file) 🆕
apps/impress/out/_next/static/cb651381/_buildManifest.js 0 B -670 B (removed) 🏆
apps/impress/out/_next/static/chunks/6990.js 57.6 kB +1.89 kB (+3.39%)

compressed-size-action

@AntoLC AntoLC force-pushed the feat/new-create-button branch 3 times, most recently from 371c6ca to 97834b6 Compare June 22, 2026 13:39
@AntoLC AntoLC requested a review from Ovgodd June 22, 2026 14:14

@Ovgodd Ovgodd left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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?.();
}}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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 }

@AntoLC AntoLC force-pushed the feat/new-create-button branch from 97834b6 to fd033f3 Compare June 23, 2026 12:24
AntoLC added 2 commits June 23, 2026 14:26
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.
@AntoLC AntoLC force-pushed the feat/new-create-button branch from fd033f3 to 4585fd8 Compare June 23, 2026 12:26
@AntoLC AntoLC merged commit 4585fd8 into main Jun 23, 2026
41 checks passed
@AntoLC AntoLC deleted the feat/new-create-button branch June 23, 2026 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement improve an existing feature frontend refacto

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants