Skip to content

Conversation

@juliusknorr
Copy link
Member

@juliusknorr juliusknorr commented Jul 26, 2023

📝 Summary

Introduce commands in the smart picker / dialog for useful menubar actions

Some menu items (undo/redo/outline) are excluded as they don't make sense here. Insert attachments would still be nice, but ee need to figure out a good way to trigger the action from within the tiptap suggest plugin, so I'd like to rather do that as a follow up.

🖼️ Screenshots

Recording:
https://github.com/nextcloud/text/assets/3404133/96aaecbc-9254-4786-9b35-210557b9694d

Screenshot 2023-07-26 at 21 58 05 Screenshot 2023-07-26 at 21 59 15

🚧 TODO

  • Double check index highlighting in the popover
  • Check if we shall hide the default add link -> Lets keep this as the insert link menu is not exposed

🏁 Checklist

  • Code is properly formatted (npm run lint / npm run stylelint / composer run cs:check)
  • Sign-off message is added to all commits
  • Tests (unit, integration and/or end-to-end) passing and the changes are covered with tests
  • Documentation (README or documentation) has been updated or is not required

@cypress
Copy link

cypress bot commented Jul 26, 2023

Passing run #11614 ↗︎

0 149 2 0 Flakiness 0

Details:

feat: Expose formatting menu bar actions through slash command
Project: Text Commit: e51ce5ade7
Status: Passed Duration: 03:46 💡
Started: Aug 9, 2023 4:53 PM Ended: Aug 9, 2023 4:57 PM

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings.

@juliusknorr juliusknorr added enhancement New feature or request 2. developing labels Jul 26, 2023
@juliusknorr
Copy link
Member Author

@nextcloud/designers I'd be glad to get some early design feedback on this :)

@mejo-
Copy link
Member

mejo- commented Jul 31, 2023

Really nice, can't wait to use this myself 😍

One thing that immediately came to my mind: should we change the order to hide the formatting options a bit? I don't think it's very intuitive to have six headings options listed as the first smartpicker options 😬

@juliusknorr
Copy link
Member Author

Yes, maybe we could also sort the usual smart pickers first. Regarding the list of visible entries we could also increase that a bit if screen space allows. @nextcloud/designers What do you think?

Copy link
Member

@marcoambrosini marcoambrosini left a comment

Choose a reason for hiding this comment

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

Nice!
I think it would be really nice to have the 4-5 most used styles at the top of the menu so that they're immediately visible.

@juliusknorr
Copy link
Member Author

I think it would be really nice to have the 4-5 most used styles at the top of the menu so that they're immediately visible.

Not sure what the most used would be then. I've pushed a change to sort ToDo list, table, h1, h2 first to at least show that there are different options other than headings.

@marcoambrosini
Copy link
Member

Sorry, I meant most used on a per document base :)
Whichever are the used styles in the document should probably take priority over anything else

@juliusknorr
Copy link
Member Author

I'd rather prefer a default choice of order rather than randomly changing ones. Not only for the complexity that it adds but also users would know what to expect from the menu then. I think changing per document could be confusing and also is not very helpful on empty documents or when documents only have a simple structure like headings and paragraphs.

Copy link
Collaborator

@max-nextcloud max-nextcloud left a comment

Choose a reason for hiding this comment

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

Code looks good. ✨
Will still test locally.

@max-nextcloud
Copy link
Collaborator

Okay.... I tried this out and it's great... 👯

but we should really check if a given action is available in the current context.
For example you cannot create a heading inside a table. or a table inside a table. or a todo list in a table.

So these options should not be available.

@max-nextcloud max-nextcloud self-requested a review August 8, 2023 12:58
Copy link
Collaborator

@max-nextcloud max-nextcloud left a comment

Choose a reason for hiding this comment

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

Please check if the actions are available in the current context.

@juliusknorr
Copy link
Member Author

Copy link
Collaborator

@max-nextcloud max-nextcloud left a comment

Choose a reason for hiding this comment

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

looks good!

@max-nextcloud
Copy link
Collaborator

/compile

@juliusknorr juliusknorr merged commit fe0d548 into main Aug 9, 2023
@juliusknorr juliusknorr deleted the feat/slash-command branch August 9, 2023 16:58
@juliusknorr
Copy link
Member Author

/backport e4e5f42 to stable27

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Slash commands

6 participants