Skip to content

fix(frontend): make canvas viewport responsive to laptop displays and… - #49

Merged
Dunkrick merged 1 commit into
mainfrom
fix/frontend-viewport-responsiveness
Nov 9, 2026
Merged

Dunkrick merged 1 commit into
mainfrom
fix/frontend-viewport-responsiveness

Conversation

@Dunkrick

@Dunkrick Dunkrick commented Nov 9, 2026

Copy link
Copy Markdown
Owner

Closes #48

Summary

Ensures the canvas viewport automatically fits small laptop displays (13.6" / 14.2" MacBooks and Windows 1366×768 / 1280×720 at 150%) on load and window resize without clipping or requiring scroll.

Decisions & Rationale

  • True rectangular bounding box: Replaced center-point averaging with exact min/max bounds to prevent card clipping.
  • Empty workspace auto-framing: Pre-frames empty notes (EMPTY_WORKSPACE_CARDS) with adaptive zoom (~0.85–0.96) so they fit on low-height screens.
  • Safe UI insets (84px top/left, 64px bottom/right): Centers content in the clear area around the floating toolbar and color dashboard.
  • Wider cluster threshold (Math.max(median * 4, 2500)): Captures spread workspace thoughts while still filtering distant anomalies.
  • Debounced window resize listener: Adapts camera framing automatically when docking, snapping, or resizing the browser.
  • Fit shortcut (⌘0 / Ctrl+0): Adds standard spatial canvas shortcut and updates the hint copy.

Verification

  • npm run lint — passed (0 errors)
  • npm run build — passed
  • npm test -- --run (frontend) — 7/7 files passed (60/60 tests, including all resolution tests)
  • npm run typecheck (backend) — passed (0 errors)
  • npm test (backend) — 11/11 files passed (76/76 tests)

… window resize

- Calculate true rectangular bounding box in getCameraFrame to eliminate clipping
- Frame empty workspace notes within visible bounds on small laptop screens
- Apply safe UI insets (84px top/left, 64px bottom/right) to clear toolbar and palette
- Add debounced window resize handler to adapt camera on resolution changes
- Add ⌘0 / Ctrl+0 keyboard shortcut to reframe all thoughts on demand
- Update viewport hint copy and add unit tests for 13.6", 14.2", and Windows displays
@Dunkrick Dunkrick self-assigned this Nov 9, 2026
@Dunkrick
Dunkrick merged commit 16ffa23 into main Nov 9, 2026
3 checks passed
@Dunkrick
Dunkrick deleted the fix/frontend-viewport-responsiveness branch November 9, 2026 08:11
@vercel

vercel Bot commented Nov 9, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
nook Ready Ready Preview Nov 9, 2026 10:51am UTC

This branch was successfully deployed

1 active deployment
Preview — d6f9ea2e Deployed Nov 9, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Smaller size screens are having a different experience - 14" and 13.6" laptops

1 participant