8.9 KiB
Essential canvas palette consumers — source-only handoff
Commit 092f5244b9264b53bccea884a1a4fe9d860f2ad2, branch codex/palette-canvas-956atf-20260913, isolated worktree .local/palette-canvas-20260913, base aadc6396d39ff336d05381d58d545093d3f37a73. The worktree is clean. Root owns #26, synthesis, integration, compiler/native gates and Gitea. Only the four delegated source files changed; no root tracked files or other workers' files were edited.
Read the palette audit and independent critique before editing. This patch implements essential boundary consumers and the selected state-row cue. As explicitly agreed by root during this task, the architecture warning cue remains a proposal below; existing warning color and “amber line” guidance stay coherent and unchanged.
Implemented sites
behavior.rs:2077,2094: unselected typed activation borders, participant/action cards, fragment/branch outlines usestyle::BOUNDARYinstead of decorative LINE. Existing fills, widths, painter order, message/arrow/label order, typed geometry and hit priority are unchanged.diagram.rs:1176,1602: ordinary architecture edge color#909EADand unselected architecture node/container boundaries now use BOUNDARY. Selected/category/trace/warning paths retain their existing roles. Grid dots remain LINE. No path, port, arrowhead, label bounds, dash pattern or selection handle changes.behavior/scenario_lifecycle/render.rs:243,245,265: editing guides use TEAL when selected and BOUNDARY otherwise; definite lifetime lines use the same roles. The previously very pale dotted guide must remain findable in absent/unresolved intervals. Its dotted 1-unit geometry remains distinct from the solid 2-unit Alive interval; '?' and the existing legend remain intact. Capsule/X painting, clipping, hits and lifetime semantics are unchanged.behavior/state_canvas.rs:1517,1533,1568: selected StateAction and internal-transition relation rows retain their existing fill and gain an inset 1.5-unit TEAL rectangle. This supplies a visible shape change when hue is lost. The outline stays within the existing row, away from text and separator; row dimensions, layout, ordering, relation identity and hit bounds do not change. A defensive guard skips the outline for a row no larger than two units, avoiding negative rectangle dimensions for minimum/degenerate geometry. Existing state node outlines already use INK/TEAL; their header and guidance dividers remain LINE.
Dependency: the separate foundation worker must supply pub const BOUNDARY: iced::Color in style.rs. It is intentionally not defined or copied into this worktree. The isolated commit alone is not claimed to compile; combine with the reviewed foundation first. All other colors remain the existing style roles or existing fills.
Verification and acceptance limits
Executed standalone rustfmt with edition 2024 and skip_children=true, Git whitespace/diff checks, exact four-file ownership review and commit/status checks. No Cargo, rustc, tests, app launch/input, screenshots or Gitea writes. No test source was changed or removed; no mirror-of-implementation unit tests were added for the simple paint-role substitutions.
Root should retain the existing activation WGPU continuity, shoulder/endpoint selection and lifecycle marker/clip tests. State regressions include typed_state_actions_are_named_selectable_rows_before_internal_transitions_and_regions, internal_rows_and_pseudostate_hits_use_shared_persisted_geometry, and selected-endpoint reconnect tests. Diagram route/pin/label/port handles and source/SVG geometry checks should remain unchanged. All are unrun for this commit.
After foundation integration, actual resolved-color tests must cover BOUNDARY against white, six-percent container tints, activation fill and state fills; do not assume the proposed numeric token is the final integrated value. Native/WGPU witnesses must inspect ordinary edges, selected/unselected narrow activations, absence/Alive/unresolved guide distinctions and selected StateAction/internal rows in grayscale, at 100%, Fit/minimum window and overview zoom. Existing selected-border pixel predicates must continue measuring continuity rather than merely a convenient RGB identity. No palette or monitor acceptance is claimed.
Main visual risk: stronger dotted guides and stronger ordinary boundaries increase visual density. They preserve the existing 1-versus-2-unit dotted/solid lifetime distinction, but its legibility requires the combined native witness. The selected-row outline is additional paint inside existing geometry; it is not a font, zoom or layout remedy.
Warning cue proposal: actual current behavior
diagram.rs:1165 colors an edge amber when its derived warnings contain something other than PromotedEndpoints. Selected/highlighted edges instead use TEAL, so hue alone does not identify that selected edge's warning. diagram.rs:1424 paints a fixed 30-unit screen-space warning strip: selected non-suspended route gets its first warning text; otherwise it counts actionable warning routes and says to select an amber line. Suspended custom routes defer to the fixed host hint explaining expansion. These are actual derived routing warnings; do not replace them with unrelated model validation warnings.
routing.rs:46,1269 owns EdgeLabelGeometry and its semantic text, exact bounds and placement. Empty-label routes have zero label bounds. Nonempty labels measure their present text and avoid nodes, prior labels and visible strokes using a bounded search; authored offsets stay exact. diagram.rs:1208 paints these same bounds, and :372 uses them for hit testing. Association-end labels and arrows have separate geometry. Appending ! or a triangle at the current label edge would escape already measured/collision-checked space, while an on-route backplate could erase another path or an endpoint arrow. This palette-only patch therefore does not do that.
| Candidate | Benefit | Cost / falsifier |
|---|---|---|
On-route ! glyph with a contrasting halo |
Immediate spatial association, including in screenshots | Needs an explicit shared placement/bounds contract for unlabeled, short, coincident, reversed, self and authored-label routes; must avoid both endpoint arrow zones and other paths/labels. Placement/hits/export consistency exceed this four-file color-consumer patch. Test an obstacle/no-clear-path case with only a short endpoint segment and a crowded label before choosing it. |
| Explicit selectable warning entries through the existing interaction host | Names the affected relation and actual warning without hue; adds no paint over model geometry or arrows; handles hidden labels and coincident routes | Requires a small host/menu wiring change outside current ownership and a source-context-bound snapshot of the actual visible routed scene. It is a discoverable list rather than an on-route glyph; selection must visibly identify the corresponding edge. |
Recommend the selectable-entry candidate for the next bounded task. The existing architecture host already reserves a fixed-height hint strip outside the measured canvas (views.rs:569–603) and uses the shared menu infrastructure (model_menu.rs:35,47, context_menu::Menu). A “Routing warnings (N)” control in that reserved strip can open entries such as “Warning · Pressure channel — No clear path”. Include stable alias or endpoint names when display names collide. Selecting an entry should use the established relation selection action (Message::Select(id), app.rs:2132) through the existing context-bound menu invocation path; root must confirm the existing select handler's draft/focus safeguards apply. Preserve expand-endpoint guidance for suspended routes.
Requirements before implementing that proposal: obtain warnings from the same settled RoutedView that is displayed, rather than running an independent router every view rebuild; bind entries to document/diagram/revision/epoch and invalidate on context changes using the existing menu protections; keep the fixed strip height constant while dragging/resizing; do not steal focus from an active text edit or commit a pending route gesture. Rename the old “amber line” instruction only when the control actually exists. A plain unspecialized current model_menu::Request does not already carry a warning list, so this is proposed explicit wiring, not a claimed existing capability.
Minimal future evaluators: two warning edges with duplicate names; an unlabeled warning edge; a selected warning edge whose line is TEAL; an ordinary non-warning edge; PromotedEndpoints/suspended custom routing; keyboard open/select/Escape; stale menu after switching document/view or editing geometry; and unchanged routes/source/history plus unchanged measured canvas size. This candidate addresses warning discoverability without expanding the palette patch into a label-placement policy. Warning non-hue identification remains unfinished until that work is implemented and tested.