canvas: consolidate bubble + table toolbars into the fixed top toolbar (greyed-always) + add font-size #92
Labels
No labels
prio_critical
prio_low
type_bug
type_contact
type_issue
type_lead
type_question
type_story
type_task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_collab#92
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The canvas (TipTap) editor has three separate toolbars:
#canvas-toolbar(fixed top) — block tools only (headings, lists, align, insert, undo).#bubble-menu(floating, on selection) — the ONLY place for inline formatting (bold/italic/underline/strike/code/highlight/color/sub/sup/link).#canvas-table-toolbar(floating, anchored to the active cell) — table row/col/merge/header/delete.Issues:
fontSize/setFontSize, so no rebuild needed — just register + add a dropdown.Change (approved design)
Consolidate everything into the fixed top toolbar:
#bubble-menu+ its positioning JS.#canvas-table-toolbar+ its positioning JS. Render it greyed-always — present but disabled when the cursor isn't in a table, enabled when it is. So the button set never changes → constant height → no vertical jump.Net: removes ~100 lines of floating-position logic; one stable toolbar; font-size added.
Implemented and verified end-to-end on the box (build #23, served from web.sock via the router).
What shipped (branch
development_sameh_collab_toolbar)#canvas-toolbar, which stays a fixed height (71px) whether the cursor is inside or outside a table — no more editor content jumping up/down.setFontSizeemits<span style="font-size: …">.Non-obvious root cause found while wiring font-size
Exporting
FontSizeforced a newer@tiptap/extension-text-style, which moved@tiptap/extension-collaborationonto the@tiptap/y-tiptapfork for itsySyncPlugin. The vendored editor still used the deprecated@tiptap/extension-collaboration-cursor@3.0.0, which resolvesySyncPluginKeyfrom upstreamy-prosemirror— a different key instance. The cursor plugin'sinitthen readgetState() === undefinedand threwCannot read properties of undefined (reading 'doc'), aborting editor construction (the canvas showed the generic "Canvas not found" error box).Fix: replaced the deprecated cursor extension with its official v3 successor
@tiptap/extension-collaboration-caret(shares the y-tiptap key with Collaboration). Also pinned the whole@tiptapfamily to exact3.22.3(deps + overrides) so the vendored bundle is deterministic and won't silently drift on rebuild, updated the remote-caret CSS classes (.collaboration-cursor__*→.collaboration-carets__*), and restored the missingscripts/vendor-bundle/build.sh.Verification
Browser (Playwright) against the running daemon, as canvas owner:
setFontSize('24px')applies; floating menus absentCommits:
e263fb5(toolbar),36da933(FontSize export),73e1d39(cursor→caret fix). Ready to squash-merge todevelopment.