rspace-online/backlog/tasks/task-8 - Port-shared-hooks-...

43 lines
1.1 KiB
Markdown

---
id: task-8
title: Port shared hooks as FolkJS utilities
status: To Do
assignee: []
created_date: '2026-01-02 16:10'
labels:
- foundation
- utilities
- migration
dependencies: []
priority: high
---
## Description
<!-- SECTION:DESCRIPTION:BEGIN -->
Convert canvas-website React hooks to FolkJS-compatible utilities:
1. **useMaximize** → maximizeShape(shape) utility
- Store original dimensions
- Animate to viewport fill
- Restore on toggle
2. **usePinnedToView** → PinnedViewManager class
- Keep shape fixed as camera moves
- Support multiple pin positions
- Zero-lag with requestAnimationFrame
3. **Shape serialization** - toJSON/fromJSON pattern
- Already implemented in folk-markdown
- Standardize across all shapes
These utilities enable the StandardizedToolWrapper features (maximize, pin, close) across all FolkJS shapes.
<!-- SECTION:DESCRIPTION:END -->
## Acceptance Criteria
<!-- AC:BEGIN -->
- [ ] #1 maximizeShape utility working
- [ ] #2 PinnedViewManager class working
- [ ] #3 All shapes have consistent toJSON/fromJSON
<!-- AC:END -->