fix(calendar): live-redraw during resize and view-aware minimums #24
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!24
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "development_calendar_resize_glitches"
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
Fixes the two calendar resize glitches reported in issue #18: aspect-ratio distortion during the drag (children visibly stretched until release), and broken renders at odd aspect ratios (rows collapsing on top of each other).
Related Issue
Closes #18
Changes
crates/hero_whiteboard_ui/static/web/js/whiteboard/calendar.jsgetMinSize(viewMode)returning per-view minimums (month 280x260, week 320x220, day 200x280) and exported it from the module.cellH = Math.max(14, (contentH - 20) / 6)in the month view;hourH = Math.max(10, ...)in the week and day views.crates/hero_whiteboard_ui/static/web/js/whiteboard/objects.jsapplyTransformcalendar branch now clamps toWhiteboardCalendar.getMinSize(node._calState.viewMode)instead of the hardcoded 240x200.crates/hero_whiteboard_ui/static/web/js/whiteboard/tools.jstransformer.on('transform', ...)handler that, for calendar nodes, applies the live scale to the bg, clamps to the view-aware minimum, resets the group scale to 1, and callsWhiteboardCalendar.redraw(node)on every tick. Scoped to calendars only so other types stay cheap.Test Results
cargo check --workspace: passcargo clippy --workspace -- -D warnings: passcargo fmt --check: passcargo test --workspace --lib: 0 passed / 0 failed (workspace has no Rust unit tests)Changes are entirely vanilla JS; UI behavior needs manual verification in the browser.
Manual verification