Dock the text note's formatting bar like the list one - #892
Conversation
The list bar was moved out of the modal's scrolling body and pinned above the action bar in #886; the content bar was left in flow under the textarea, on the reasoning that a text note has one editing surface the bar can attach to. That reasoning does not survive a long note. The textarea grows to fit its content, so the bar goes with it: on a 40-line note it sits below the viewport while the caret is at the top — the same failure the list bar had at 25 items, reached by a different route. Mobile already pins both of its bars above the action bar for exactly this reason. Both variants now render from one slot between the scrolling body and the action bar, swapping only the button set (`variant`), the action handler and — for list rows — the focus-settled blur callback. A text note's edit mode is not focus-driven (it ends on Escape, Done or a click outside), so the content bar has nothing to report back and passes no `onBlurOut`. Consequences worth naming: - The slot is reserved for text notes too, so a note collapsed to its preview shows ~34px of empty space above the action bar rather than the panel resizing every time editing starts. This is what a list note with no row focused already does. - Tab out of the textarea now passes the body's remaining controls (the labels button, share avatars) before reaching the bar, since DOM order follows the visual order. It costs nothing because leaving the field does not end the edit; the keyboard-focus spec asserts the new order. - One toolbar instance now serves both variants, so the new-note type selector can shorten the button set under a live roving tabindex. The index is clamped to the buttons that exist — left dangling it would give no button `tabIndex=0` and drop the bar out of the tab order. Adds an e2e regression test asserting the bar is in the viewport with the caret at the top of a 60-line note, the text-note counterpart of the long-list one, plus unit coverage for the reserved slot and the clamp. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JMybPS1iBFR2XWkMRjtQjT
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (6)
WalkthroughThe modal now renders one docked Markdown toolbar for text and list-item editing. The toolbar targets the active textarea, remains hidden while preserving its slot when inactive, and exposes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
#886 moved the list bar out of the modal's scrolling body and pinned it above the action bar. The content bar was left in flow under the textarea, on the reasoning that a text note has one editing surface for the bar to attach to.
That reasoning does not survive a long note. The textarea grows to fit its content, so the bar goes with it — on a 40-line note it sits below the viewport while the caret is at the top, the same failure the list bar had at 25 items, reached by a different route. Mobile already pins both of its bars above the action bar for exactly this reason, so this also puts the two clients back in step.
Both variants now render from one slot between the scrolling body and the action bar, swapping only the button set (
variant), the action handler, and — for list rows — the focus-settled blur callback. A text note's edit mode is not focus-driven (it ends on Escape, Done, or a click outside the panel), so the content bar has nothing to report back and passes noonBlurOut.Screenshots
Captured but not attachable from the environment this was written in — they are with the author to drop in. What they show:
Consequences worth naming
keyboard-focus.spec.tsasserts the new order; the toolbar is still one tab stop with arrow-key navigation.tabIndex=0and drop the bar out of the tab order entirely.Tests
aria-controlsacross the edit/preview swap, and the roving-tabindex clamp when the type selector swaps the button set.keyboard-focus.spec.tsfor the tab order above.task checkandtask test-e2eboth pass (393 e2e tests).docs/specs/markdown-rendering.md§5.1 is updated: the placement rule now covers both bars, and the paragraph saying the content bar keeps its in-flow place is gone.No API changes; webapp only.