Skip to content
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

add keyboard shortcuts for markdown formatting and handle format toggling #55088

Open
blimpich opened this issue Jan 10, 2025 · 3 comments
Open
Assignees
Labels

Comments

@blimpich
Copy link
Contributor

This issue is a follow up to this issue. In that issue we added the ability to apply markdown formatting via the iOS format menu. See below example:

401399936-4a9a3f76-b5b4-4cfa-b151-ef882e9cbfef.mp4

🎉 This is great 🥳. However, there's a couple things we want to add to make this better.

Part 1: Toggle behavior

Right now if you take a piece of text and format it to be bold it encircles it with asterisks. If you then repeat this process on the same text it adds another layer of asterisks. This adds no value to the user, and isn't how other websites handle this behavior (e.g. Github). Instead of adding redundant asterisks, we want the following behavior:

  • when a user selects the text *text* and clicks "Bold" from the format menu the text should become text
  • when the user selects text that is enclosed by asterisks and clicks "Bold" from the format menu the text it should unbold the text, even if the asterisks aren't selected:

Example:

Screen.Recording.2025-01-10.at.10.33.08.AM.mov

Note: (1) this example is from Github and they use double asterisks for bolding, we only use single asterisk (2) the format menu isn't used here, instead I'm using keyboard shortcuts, but the intended result is the same

Part 2: Keyboard shortcuts

In addition to being able to use the format menu on mWeb Safari, we want keyboard shortcuts to work on MacOS: Chrome / Safari
and MacOS: Desktop. It would behave like this:

  • a user selects text and presses Cmd-b the text should be enclosed by asterisks. Should have toggle behavior.
  • a user selects text and presses Cmd-i the text should be enclosed by underscores. Should have toggle behavior.

Conclusion:

Please present proposals that implements both of these behaviors and accounts describes unit tests that will cover these new behaviors.

Copy link

melvin-bot bot commented Jan 10, 2025

Current assignee @dubielzyk-expensify is eligible for the Design assigner, not assigning anyone new.

@blimpich
Copy link
Contributor Author

blimpich commented Jan 10, 2025

Looking to get confirmation from @Expensify/design before applying the external label to this. Are we good with the behavior changes outlined in the issue?

Contributors: please hold on proposals until we've finalized the design.

@dannymcclain
Copy link
Contributor

I think they look great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants