Add a floating inline formatting toolbar, when user highlight a text
Is your feature request related to a problem? Please describe.
I have been using Markpad for the past 3 months and really enjoy it!
However, I find that applying formatting can sometimes interrupt the writing flow. Currently, users have to manually type markdown syntax or rely entirely on keyboard shortcuts, which can be inefficient or difficult to memorize for less common formatting options. I believe anyone has a same common thoughts.
Describe the solution you'd like
It will be great to see a floating inline formatting toolbar, that automatically appears whenever text is highlighted/selected.
Similar to the implementation in Notion, this popup menu should allow users to quickly interact with simple formatting options, including (but not limited to):
- Bold
- Italics
- Underline
- Strikeout
- Insert link
- Insert formula
- Convert to code block section
- Etc, anything that useful for users
Describe alternatives you've considered
- Implementing a static formatting toolbar fixed to the top of the editor window (though an inline, context-aware popup is much more convenient and keeps the UI clean).
Additional context
I have attached a screenshot demonstrating how this inline formatting tool looks and functions in Notion for reference.
Thanks! Just ping me back if someone needs to
@alecdotdev Tagging you, in case you missed it
Thanks for this, and for the Notion screenshot — it made the argument better than a description would have.
The alternative you listed has shipped. There is now a formatting toolbar across the top of the editor pane. You can reorder the buttons, hide the ones you do not use, and hide the bar itself. Against your list:
| you asked for | in the toolbar |
|---|---|
| Bold, Italics, Underline | yes |
| Insert link | yes — inserts [link text](url) with the selection as the label |
| Convert to code block | yes, plus inline code |
| Strikeout | no |
| Insert formula | no |
Also there beyond your list: quote, H1–H3, bullet / numbered / task lists, and a table picker.
That is your second choice rather than your first, and I want to be straight about which one it is. It does address the problem you opened with — typing syntax by hand or memorising chords — but it does not do the thing your screenshot is actually arguing for, which is staying out of the way until there is a selection.
The floating version
Not something I am planning to build right now. The reason is worth writing down, because it is not the reason it looks like.
Positioning is not the hard part — Monaco has addContentWidget, which anchors a DOM node to a position in the document, follows it through scrolling and picks above/below on its own. Markpad does not use it yet, but it is there.
The hard part is everything around when the thing may appear:
- it must not appear mid-drag, or it flickers along with the selection
- extending a selection with Shift+arrows would put the toolbar directly over the direction you are extending
- clicking a button has to not destroy the selection it acts on — every button needs to suppress the focus change
- it has to stay away during IME composition, which matters for a lot of this app's users
- the preview is read-only, so it can only exist on the editor side, which makes split view behave differently on each half
None of these is difficult alone. Together they are the kind of feature that ships and then collects follow-up reports about flicker and lost selections for a month. That is a real cost, and right now I would rather not take it on.
Strikethrough, since it looks free and is not
Worth recording, because "just add one more button" was my first thought too.
The renderer has supported ~~struck~~ all along. But GFM defines strikethrough as one or two tildes, so ~struck~ is equally valid — that is why H~2~O renders struck through here and on GitHub, and it is also why the subscript extension is deliberately off in this app: turning it on would take that spelling away from a valid GFM document.
The toolbar's formatting helper decides "is this already formatted?" by checking whether the selection starts and ends with the marker it knows about. With one spelling per format that is fine. With two it is not:
select ~struck~ and press the button → ~~~struck~~~
double-click a word inside ~~struck~~ → ~~~~struck~~~~
Mid-line those are just literal tildes. At the start of a line they are a tilde code fence, and it never closes — so the rest of the document renders as one code block. One button press, and the preview looks like the file broke.
The fix is not difficult, but it is not one line either: the helper has to know a format can have more than one spelling, and it has to look just outside the selection as well as inside it. The same blind spot is already there for bold and italic (_x_ becomes *_x_*), where it is merely useless rather than destructive, which is why nobody has noticed.
So it is a real change with a real test, not a freebie — and it belongs with whatever adds the buttons rather than ahead of it.
Insert formula
Deliberately not doing the cheap version. A button that wraps a selection in $…$ saves exactly two keystrokes over typing them, and pretends to be a feature. If what you had in mind is closer to Notion's — a small editor with live rendering while you type the expression — say so, because that is a different request and worth its own issue rather than a line in this one.
Closing this rather than leaving it open as a maybe. The problem you described is materially better than when you filed it, and I would rather say plainly that the floating form is not planned than keep a ticket alive that suggests it is queued. If it still gets in your way once you have used the toolbar for a while, reopen it or file a fresh one — that would be useful information rather than a repeat.