view_dimension_spec - mark-ik/graphshell GitHub Wiki
Date: 2026-02-28 Status: Canonical interaction contract Priority: Blocked (see §7)
Related:
GRAPH.mdgraph_node_edge_interaction_spec.md2026-02-27_viewdimension_acceptance_contract.mdcanvas/2026-02-27_roadmap_lane_19_readiness_plan.md-
../../TERMINOLOGY.md—ViewDimension,ThreeDMode,ZSource,Derived Z Positions,Dimension Degradation Rule
This spec defines the canonical contracts for:
- ViewDimension state — ownership, persistence, and canonical values.
- TwoD ↔ ThreeD transition — interaction continuity, selection continuity, state integrity.
- Degradation — deterministic fallback when 3D is unavailable.
-
ZSource — how per-node
zpositions are derived. - Observability — required diagnostics and evidence for acceptance.
ViewDimension is per-Graph-View state, not global. Each Graph View pane has its own ViewDimension.
ViewDimension =
| TwoD
| ThreeD { mode: ThreeDMode, z_source: ZSource }
ThreeDMode =
| TwoPointFive
| Isometric
| Standard
ZSource = (per-node z-placement policy; see §5)
Persistence: ViewDimension is persisted as part of Graph View state in the frame snapshot. It is not a frame-level UI setting — it is durable intent.
Ownership: ViewDimension changes are explicit reducer-owned state transitions. They must not be triggered by implicit widget state or frame metadata.
- Pan/zoom ownership remains deterministic before and after transition. No focus-repair clicks required after transition to resume standard camera interaction.
- Camera commands (
fit,fit selection, keyboard zoom) continue to target the active graph view through the transition. - Transition must not reset camera position silently.
(x, y)camera state is preserved.
- The selected-node set and primary selection are preserved across transition.
- Selection visualization may change by mode (2D vs 3D rendering); selection truth must not reset silently.
- Lasso/selection command routing remains valid for the active graph view after transition.
-
ViewDimensionchanges are explicit reducer state transitions. No implicit side-effects on unrelated graph topology state. - A transition failure or unsupported path must produce an explicit degraded/fallback outcome (§4), not a silent no-op.
-
(x, y)graph positions remain stable across transitions in both directions.
When persisted ThreeD state is restored and 3D rendering is unavailable, Graphshell deterministically degrades that view to TwoD.
Degradation rules:
-
(x, y)node positions are preserved; no position reset. - Ephemeral
zvalues are discarded. They are never persisted independently and are recomputed on next 2D→3D entry. - The degradation reason is observable: the diagnostics system emits a channel event identifying the cause (unsupported capability, unavailable backend, blocked path, etc.).
- Degradation must not affect other Graph View panes in the same workbench.
- A degraded view may be manually re-elevated to
ThreeDby the user if the capability becomes available; the system does not auto-elevate.
Degradation mode values: full (3D rendering active), partial (fallback active, some 3D features unavailable), unavailable (forced to TwoD).
ZSource is the policy for deriving per-node z placement when a Graph View is in ThreeD mode.
-
ZSourceconfiguration is persisted as part ofViewDimension. - Derived per-node
zpositions are ephemeral runtime data. They are recomputed on 2D→3D entry and discarded on 3D→2D transition. -
zvalues must never be persisted independently ofViewDimension.
ZSource derivation invariant: Derived z positions are always computable from ZSource + current node metadata. Recalculating z for the same ZSource and the same node metadata must produce the same result (deterministic derivation).
- Mode transitions must emit diagnosable events/channels for: success, fallback/degradation, and blocked paths.
- The degradation reason must be observable (specific error or capability code), not just "3D unavailable."
- Acceptance evidence must include targeted diagnostics and automated tests, not manual repro notes only.
#19 (ViewDimension hotswitch implementation) remains blocked until:
- 3D rendering backend capability is confirmed.
- Compositor pass-order correctness and GL-state diagnostics are hardened (see
../aspect_render/frame_assembly_and_compositor_spec.md— the archivedcomposited_viewer_pass_contract.mdwas consolidated here per checkpoint_2026-03-10). - The
TileRenderModeenum is set on everyNodePaneStateat viewer attachment time.
This spec defines the acceptance contract; implementation is not authorized until prerequisites are closed (see canvas/2026-02-27_roadmap_lane_19_readiness_plan.md).
| Criterion | Verification |
|---|---|
| Pan/zoom works immediately after transition | Test: transition TwoD↔ThreeD → camera commands respond without extra focus repair |
| Selected nodes preserved across transition | Test: select N nodes, transition → same N nodes still selected |
(x, y) positions stable across transition |
Test: transition TwoD→ThreeD→TwoD → all (x, y) positions within epsilon of original |
z positions are not persisted |
Test: snapshot roundtrip while in ThreeD → no per-node z field in serialized form |
| Degradation falls back to TwoD deterministically | Test: force 3D-unavailable condition → view degrades to TwoD, positions preserved |
| Degradation emits observable diagnostics channel event | Test: degradation path → diagnostics channel records event with reason field |
| Degradation does not affect sibling panes | Test: one pane degrades → other panes in same workbench unaffected |
| Reducer transition does not mutate graph topology | Test: transition intent → no AddNode/RemoveNode/AddEdge/RemoveEdge in intent side-effects |