Repository navigation
feat(canvas): Add lane-based canvas with persistent card positions - #7
Conversation
Show related cards in named lanes with zoom, fit and reset controls. Keep layouts deterministic and optionally retain dragged positions so readers can return to a familiar arrangement. Rename memory kind terminology to memory types while preserving the deprecated composable name and its return shape for existing consumers.
Code Review SummaryAdds a lane-based Canvas built on @vue-flow/core, with CanvasCard and CanvasControls, a deterministic lane layout module, localStorage-backed card positions, and an edge registry that merges and deduplicates independent edge sources. Renames useContextKinds to useMemoryTypes with type-named fields while keeping a deprecated alias under the old kind names. CodeGraph and CodeGraph's ink lookup now use the new composable; canvas color tokens are added for both themes. 🚀 Key Improvements
📉 Regressions
💡 Minor Suggestions
|
| return { tone, fill, ink, legend, types: Object.keys(TONE), typeOptions: OPTIONS, typeDescriptions: DESCRIBED } | ||
| } | ||
|
|
||
| /** @deprecated Use `useMemoryTypes`. Kept, under its old field names, for one release. */ |
There was a problem hiding this comment.
The module was renamed, so @sourceant/design/composables/useContextKinds no longer resolves even though the function is kept and the CHANGELOG promises 0.3.0 keeps working unchanged. The "./*": "./src/*" export makes path imports part of the shipped surface. Add a src/composables/useContextKinds.ts shim re-exporting ./useMemoryTypes for this release.
| async load(subject, only) { | ||
| const wanted = only ? new Set(only) : null | ||
| const chosen = [...registered.values()].filter(s => !wanted || wanted.has(s.type)) | ||
| const results = await Promise.allSettled(chosen.map(s => s.load(subject))) |
There was a problem hiding this comment.
CanvasEdgeSource.load may be synchronous, so a source that throws synchronously throws inside map before allSettled sees anything, rejecting the whole load and dropping every other source's edges. Wrapping each call in an async arrow converts a sync throw into a rejected promise that allSettled absorbs, matching the documented 'one source failing costs its own lines' contract.
| const results = await Promise.allSettled(chosen.map(s => s.load(subject))) | |
| const results = await Promise.allSettled(chosen.map(async s => s.load(subject))) |
Provide a reusable canvas for exploring related cards while preserving spatial context across visits. The memory type terminology change retains a deprecated compatibility alias so existing consumers can migrate without changing their current usage.