-
Notifications
You must be signed in to change notification settings - Fork 94
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
enh(ui): smart picker button at the start of line #6855
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6855 +/- ##
==========================================
+ Coverage 46.55% 46.77% +0.22%
==========================================
Files 748 735 -13
Lines 34318 34457 +139
Branches 1242 1254 +12
==========================================
+ Hits 15976 16118 +142
- Misses 17720 17732 +12
+ Partials 622 607 -15 ☔ View full report in Codecov by Sentry. |
95a2190
to
cbdb933
Compare
I'm pondering still showing the button if one is in the middle of the line and moving the cursor to the end of the line if the button is clicked / activated. I imagine it would be nice to say change the current line into a heading with tab navigation from any point in the line. |
* Show a `+` button that opens the smart picker. * Show the button when the cursor is at the end of the line. * Do not show the button if the smart picker is already open. * Remove the placeholder text. * Tab navigation to the smart picker works. Signed-off-by: Max <[email protected]>
cbdb933
to
35296f7
Compare
Signed-off-by: Max <[email protected]>
Signed-off-by: Max <[email protected]>
Also standardize our use of it. Signed-off-by: Max <[email protected]>
Signed-off-by: Max <[email protected]>
Props get all the reactivity overhead. Avoid making editor reactive. Signed-off-by: Max <[email protected]>
Signed-off-by: Max <[email protected]>
I updated the screen recording to reflect the latest changes. |
Pushed a small commit to use NcButton, add an aria label to prevent console warnings and fix the jest tests. |
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.
Very nice, gave it some testing and the code looks good 👍
@marcoambrosini Can you also check?
I'd also be fine with merging and doing follow ups on polishing
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.
I think that as soon as there's something in the current line, the plus button should either:
- disappear (for now)
- Open the smart picker in a new line, right after the current one
Sounds good. That would imply that if i select say "Heading" it would not turn the current line into a heading but rather start a heading below. Makes sense to me. |
src/plugins/currentLineMenu.js
Outdated
@@ -131,7 +131,7 @@ function currentParagraphDecorations(doc, currentParagraph, editor) { | |||
*/ | |||
function decorationForCurrentParagraph(currentParagraph, editor) { | |||
return Decoration.widget( | |||
currentParagraph.pos + 1, | |||
currentParagraph?.pos + 1, |
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 will still cause an exception if currentParagraph is undefined, right? I'd expect undefined + 1
to raise a type error. I'll make sure this never gets called without a paragraph instead.
Signed-off-by: Max <[email protected]>
Signed-off-by: Julius Knorr <[email protected]>
3f7c343
to
d289b67
Compare
d289b67
to
9f01835
Compare
Also improve some type annotations. Signed-off-by: Max <[email protected]>
9f01835
to
641dda4
Compare
Fixes #6818.
+
button that opens the smart picker.🎥 Screen recording
Bildschirmaufzeichnung.vom.2025-01-15.22-52-09.mp4
TODO