[GH-ISSUE #2053] [FR] Improve the tooltip for toolbar item #823

Closed
opened 2026-03-23 20:41:34 +00:00 by mirror · 2 comments
Owner

Originally created by @LucasXu0 on GitHub (Mar 21, 2023).
Original GitHub issue: https://github.com/AppFlowy-IO/AppFlowy/issues/2053

Originally assigned to: @Samiksha-Garg on GitHub.

Description

Screenshot 2023-03-21 at 09 48 27

At the moment, the tooltip for the toolbar item doesn't contain the description of its connected shortcut. Like, we can trigger the selected text as Bold using cmd / ctrl + B. We want to show this event in its tooltip. For example:

Bold
⌘ + B // For macOS 
CTRL + B // For Windows

Impact

Users who don't know the built-in shortcut.

Additional Context

Please refer to those files.

  • document_page.dart.
  • built_in_shortcut_events.dart.
Originally created by @LucasXu0 on GitHub (Mar 21, 2023). Original GitHub issue: https://github.com/AppFlowy-IO/AppFlowy/issues/2053 Originally assigned to: @Samiksha-Garg on GitHub. ### Description <img width="635" alt="Screenshot 2023-03-21 at 09 48 27" src="https://user-images.githubusercontent.com/11863087/226501002-eedb7439-39bf-4a15-b232-f8d4b210d73e.png"> At the moment, the tooltip for the toolbar item doesn't contain the description of its connected shortcut. Like, we can trigger the selected text as `Bold` using `cmd / ctrl + B`. We want to show this event in its tooltip. For example: ``` Bold ⌘ + B // For macOS CTRL + B // For Windows ``` ### Impact Users who don't know the built-in shortcut. ### Additional Context Please refer to those files. * `document_page.dart`. * `built_in_shortcut_events.dart`.
Author
Owner

@Samiksha-Garg commented on GitHub (Mar 26, 2023):

Hey @LucasXu0, can I work on this issue? Although I am not quite sure about how to go about it, the simplest way would be editing the tooltipsMessage for each item with a shortcut (in toolbar_item.dart), something like :
tooltipsMessage: AppFlowyEditorLocalizations.current.bold + "\n" + (Platform.isMacOS ? "⌘ + B" : "CTRL + B"),
If this is good, then we are good to go, or maybe you can point in the right direction.

P.S. Platform.isMacOS ? "⌘ + B" : "CTRL + B" could be fetched from a class tho, it would make the code more readable in my opinion.

<!-- gh-comment-id:1484037629 --> @Samiksha-Garg commented on GitHub (Mar 26, 2023): Hey @LucasXu0, can I work on this issue? Although I am not quite sure about how to go about it, the simplest way would be editing the tooltipsMessage for each item with a shortcut (in toolbar_item.dart), something like : ` tooltipsMessage: AppFlowyEditorLocalizations.current.bold + "\n" + (Platform.isMacOS ? "⌘ + B" : "CTRL + B"),` If this is good, then we are good to go, or maybe you can point in the right direction. P.S. `Platform.isMacOS ? "⌘ + B" : "CTRL + B"` could be fetched from a class tho, it would make the code more readable in my opinion.
Author
Owner

@LucasXu0 commented on GitHub (Mar 27, 2023):

P.S. Platform.isMacOS ? "⌘ + B" : "CTRL + B" could be fetched from a class tho, it would make the code more readable in my opinion.

Yes, it's a good idea. However, as I know, we can't fetch this tooltip from any class for now. Because the shortcut event registration is separate from the toolbar item registration. So I think we can hardcode the tooltip for the toolbar item temporarily. Once this PR has been merged, then we can get the connection between them. https://github.com/AppFlowy-IO/AppFlowy/pull/2112

<!-- gh-comment-id:1484741788 --> @LucasXu0 commented on GitHub (Mar 27, 2023): > P.S. Platform.isMacOS ? "⌘ + B" : "CTRL + B" could be fetched from a class tho, it would make the code more readable in my opinion. Yes, it's a good idea. However, as I know, we can't fetch this tooltip from any class for now. Because the shortcut event registration is separate from the toolbar item registration. So I think we can hardcode the tooltip for the toolbar item temporarily. Once this PR has been merged, then we can get the connection between them. https://github.com/AppFlowy-IO/AppFlowy/pull/2112
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
AppFlowy-IO/AppFlowy#823
No description provided.