feat(canvas): open .canvas files in a workspace pane (T-322)
Makes the canvas foundation (parser/renderer/view) reachable. The extension owns an app-scoped MultitabController (the diff/T-233 pattern) so open documents survive the pane being rebuilt; each document is a real sub-tab per the refinement decision, kept alive across switches. Routing goes through the existing seams instead of the dead TabContribution.fileGlobs field: openWorkspaceFile gains a .canvas branch mirroring .md, and ui.open gains a canvas reader for D-6 parity (clide ui open canvas <path>). Also corrects the json_canvas doc header that claimed SVG-lowering — the interactive pane paints the model directly (D-103 live-widget exception). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -3,9 +3,11 @@
|
||||
/// back, so the canvas pane can load, edit, and persist a `.canvas`.
|
||||
///
|
||||
/// Per D-91 `.canvas` is an import format, not clide's native schema — this
|
||||
/// model is the faithful parse; the pane lowers it onto the SVG substrate for
|
||||
/// rendering. Pure data — no Flutter, no I/O here — so it runs under
|
||||
/// `dart test`. Spec: https://jsoncanvas.org/spec/1.0/
|
||||
/// model is the faithful parse. The interactive pane paints this model
|
||||
/// directly via `CanvasPainter` (the D-103 live-widget exception, like the
|
||||
/// graph); only the display-only drawing card lowers to the SVG substrate.
|
||||
/// Pure data — no Flutter, no I/O here — so it runs under `dart test`.
|
||||
/// Spec: https://jsoncanvas.org/spec/1.0/
|
||||
library;
|
||||
|
||||
import 'dart:convert';
|
||||
|
||||
@@ -28,14 +28,16 @@ typedef MessagePublisher = void Function(String publisher, String channel, Map<S
|
||||
|
||||
/// The readers `ui.open` can target → (bus publisher id, payload key the
|
||||
/// reader reads its entry from). Matches each reader's `ReaderNav` dataKey
|
||||
/// (tickets/decisions key on `id`; markdown on `path`). `diff` is not a
|
||||
/// ReaderNav reader — it keys on `path` and its extension subscribes to the
|
||||
/// same `selection` channel to reveal its tab + focus the file (T-233).
|
||||
/// (tickets/decisions key on `id`; markdown on `path`). `diff` and `canvas`
|
||||
/// are not ReaderNav readers — they key on `path` and their extensions
|
||||
/// subscribe to the same `selection` channel to reveal their tab + focus
|
||||
/// the file (T-233, T-322).
|
||||
const Map<String, ({String publisher, String dataKey})> _readers = {
|
||||
'tickets': (publisher: 'builtin.tickets', dataKey: 'id'),
|
||||
'decisions': (publisher: 'builtin.decisions', dataKey: 'id'),
|
||||
'markdown': (publisher: 'builtin.markdown', dataKey: 'path'),
|
||||
'diff': (publisher: 'builtin.diff', dataKey: 'path'),
|
||||
'canvas': (publisher: 'builtin.canvas', dataKey: 'path'),
|
||||
};
|
||||
|
||||
/// Severities the toast verb accepts — mirrors `ToastSeverity` (kept as a
|
||||
|
||||
Reference in New Issue
Block a user