feat(document): internal scroll and stop auto-growing on edit #75
No reviewers
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_whiteboard!75
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "development_document_scroll_no_autoresize"
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?
Summary
Document elements now respect the size the user chose and expose a vertical scroll for overflowing content.
Related Issue
Closes #73
Changes
crates/hero_whiteboard_ui/static/web/js/whiteboard/objects.jsrenderDocumentContentno longer mutatesbg.height()to fit content. User size is authoritative;editMarkdownText,rerenderDocument, and remote sync re-renders all stop enlarging the element.createDocumentinitializes_scrollY/_contentHeightand attaches_docMaxScroll/_docSetScrollY/_docClampScroll._docSetScrollYclamps, repositions everymd-line-*child by its stamped_baseY - _scrollY, updates the scrollbar thumb, and batchDraws.wheelhandler consumesdeltaYwhen the document overflows (and cancels bubbling so the stage pan/zoom does not fire). Passes through when content fits.renderDocumentContentrebuilds a.scrollbar-track+ draggable.scrollbar-thumbon the right edge whenever content overflows.dragBoundFuncconstrains the thumb to the track;dragmoveconverts position back to_scrollY. Hides when content fits.applyTransformfor documents drops the now no-opskipAutoGrowflag and calls_docClampScrollafter re-render so enlarging pulls scroll back to 0 and shrinking reveals hidden content.Architecture
Konva-only — no HTML overlay. Existing
clipFuncon the document group already clips rounded corners; the scroll offset moves onlymd-line-*children (scrollbar chrome stays pinned). Scroll offset is transient per-client view state and is not serialized.Test Results
cargo check --workspace: passcargo clippy --workspace -- -D warnings: passcargo fmt --check: passManual QA required: add a long document, scroll via wheel and thumb drag, edit to confirm no auto-grow, resize via transformer and confirm scroll re-clamps.