Appearance
Milestone 4: Hits Manager
Timeline: Jan 8, 2025 | Status: done
Goal
Borrow and deploy the hits manager from ws (webseriously) to di.
What Emerged
(add this when complete)
Our Work
Review ws implementation
- [x]
src/lib/ts/managers/Hits.ts— main manager (RBush spatial index, click handling) - [x]
src/lib/ts/state/S_Hit_Target.ts— hit target class - [x]
src/lib/ts/signals/Mouse_Timer.ts— timer for long-click, double-click, autorepeat
Identify what di already has
- [x]
S_Mouse— identical to ws ✓ - [x]
T_Hit_Targetenum ✓ - [x]
T_Mouse_Detectionenum ✓ - [x]
T_Dragenum ✓ - [x]
Constants.threshold(autorepeat, double_click, long_click) ✓ - [x]
Point,Recttypes ✓
Dependencies to add
- [x] Install
rbushpackage (yarn add rbush @types/rbush) - [x] Create
src/lib/ts/signals/Mouse_Timer.ts - [x] Create
src/lib/ts/state/S_Hit_Target.ts - [x] Create
src/lib/ts/managers/Hits.ts - [x] Add
asBBoxto Point and Rect in Coordinates.ts - [x] Create
src/lib/ts/signals/Events.ts(mouse event handlers) - [x] Create
src/lib/ts/state/S_Component.ts - [x] Create
src/lib/ts/managers/Components.ts
Simplifications for di
- [x] Remove ws-specific: radial, controls, ancestry, colors references
- [x] Remove ring/paging/widget-specific logic (not needed yet)
- [x] Keep: RBush indexing, hover detection, click/long-click/double-click handling
Integration
- [x] Add
hitsexport to common imports - [x] Create
src/lib/ts/signals/Events.ts(mouse event handlers) - [x] Call
e.setup()on app init (Main.svelte onMount) - [x] Make graph an S_Component hit target
- [x] Add hover reaction (background turns white)
- [x] Fix: clear hover on mouseleave and recalibrate on resize
- [x] Test hover detection
- [x] Test click handling
Deploy
- [x] Verify build passes
- [x] Push to trigger Netlify deploy
- [x] Test on https://designintuition.app
Artifacts
(add links when complete)