diff --git a/.gitignore b/.gitignore index 7ce5c1e..be68094 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,6 @@ static/vendor/ !.env.example *.tsbuildinfo .DS_Store + +# Local Vercel project metadata and prebuilt deployment output +.vercel/ diff --git a/.prettierignore b/.prettierignore index 022d5c3..7959965 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,4 +1,5 @@ node_modules +.vercel build sandbox static/vendor diff --git a/README.md b/README.md index 6646b47..89a4531 100644 --- a/README.md +++ b/README.md @@ -39,12 +39,12 @@ OpenMBEE View Editor brings source editing, named model views and reviewed graph **Source owns model semantics. Presentation owns geometry.** Renaming a part or connecting ports produces a reviewed source transaction; moving a symbol changes its position. The application runs locally in browser workers and requires no application backend.
-
+
Inspection rover: connected assemblies, declared component values and typed interfaces.
-Explorer has independent Files, Views and Model sections. Fold a section to make room without losing its state; the Explorer activity button at the left edge toggles the sidebar. New view and model expand/collapse actions remain separate from section toggles. Diagram selection reveals the Model owner chain without moving keyboard focus away from the diagram. Section expansion lasts for the current session and is not saved in project files. Model representation labels wrap to the pane width. High-contrast mode retains a selection marker separate from keyboard focus; reduced motion follows system preferences. See [verification](docs/verification.md) for targeted accessibility coverage and limits. +Explorer has independent Files, Views, Documents and Model sections. Fold a section to make room without losing its state; the header Explorer toggle shows or hides the sidebar. New view and model expand/collapse actions remain separate from section toggles. Diagram selection reveals the Model owner chain without moving keyboard focus away from the diagram. Section expansion lasts for the current session and is not saved in project files. Model representation labels wrap to the pane width. High-contrast mode retains a selection marker separate from keyboard focus; reduced motion follows system preferences. See [verification](docs/verification.md) for targeted accessibility coverage and limits. ## Features @@ -55,19 +55,23 @@ Explorer has independent Files, Views and Model sections. Fold a section to make - **Open source-defined views.** Navigate named SysML views independently of the active source file. Inspect nested and inherited parts, typed inherited ports and resolved connection endpoints. - **Read generated documents.** Open document definitions (`part def` specializations of `DocumentQueries::Document`) next to named views. The embedded OpenSysML engine plans, evaluates and renders them; headings, table rows and inline references reveal their source declarations, and `Diagram` blocks mount the editor’s native view renderer. - **Navigate source issues.** Open an issue’s reported file and line in the source editor. Missing or stale locations are explained while drafts and the last valid diagram are retained. -- **Browse the model hierarchy.** Expand packages, definitions and declared members in the Model tree. Selection opens Inspector details. Inspect type/kind labels; use arrow keys, type-ahead and Enter/Space to navigate and select. +- **Browse the model hierarchy.** Expand packages, definitions and declared members in the Model tree. Selection updates the current element; **Inspect selection** opens the bottom inspection panel. Inspect type/kind labels; use arrow keys, type-ahead and Enter/Space to navigate and select. - **Review graphical changes.** Rename parts, create native views, add typed part usages and connect compatible directed ports through an exact source-change preview. - **Preserve compatible layouts.** Keep verified symbol positions across supported edits, including inactive views. Unsafe identity mappings are reported and arranged again. - **Keep projects portable.** Download applied source, unfinished drafts and compatible diagram positions together; reopen the bundle or import multiple SysML files. - **Recover unfinished work.** Inspect the saved copy’s time, files, draft status and source sizes before restoring or discarding local browser recovery. Competing-tab conflicts explain that Retry only inspects the saved copy and keeps the current project open. -- **Arrange your workspace.** Resize or collapse Explorer, Inspector, source/diagram panes and Issues using dividers, keyboard controls or panel options. +- **Arrange your workspace.** Keep the model central, open source on the right and inspection below, or focus a single surface. Independent panel toggles, maximise/restore and keyboard-resizable dividers preserve editor and camera state. Properties, Relationships and Issues share the bottom dock. - **Choose your appearance.** Use Light, Dark or Follow system, six diagram palettes and custom muted element colors. Theme and panel preferences stay in the browser. Structural, native requirement and bounded action/state workflows have real-engine browser coverage. Use-case, mixed, sequence and geometry renderers remain unavailable; behavior diagrams do not execute or simulate models. Generated documents are read-only: there is no inline text editing, publication or Flexo MMS export, and PDF/AsciiDoc output is unavailable in the browser. See [capabilities and limits](docs/capabilities.md) and [local verification](docs/verification.md) for the implemented scope. In the source editor, use **Ctrl+F** / **Cmd+F** for find/replace and **Ctrl+Z** / **Cmd+Z** for draft editing undo; **Ctrl+Y** / **Cmd+Shift+Z** redo draft edits. **Tab** moves focus out of the editor. Toolbar **Undo source** / **Redo source** operate on accepted model revisions. Highlighting is lexical; the pinned engines still validate source when you apply it. Use **Ctrl+Space** for engine-backed completion, **F1** for symbol information and **F12** for project-file definitions; pointing at a symbol also requests hover information. Queries use the complete current draft source set. Unsupported completion edits and stale replies are rejected. **Format source** updates the current draft; applying remains explicit. Inline diagnostics remain future work. -**Arrange Source and Model:** the global arrangement controls choose **Source only**, **Source + Model** or **Model only**. The Model representation remains independent. Its header labels the representation, applied/draft status and diagram target. Requirements tables/matrices cover the project, independently of the named view. Source history, Apply/Discard and language actions live in the Source header; show Source to reach them. A **Draft** badge beside the filename describes that file only, while Apply/Discard affect all project source drafts. +**Arrange Source and Model:** the panel controls independently toggle Explorer, right-side Source and bottom inspection. Focus model temporarily hides supporting panels; Restore workspace returns to the previous layout. Each panel can maximise, restore and close. Source only / Source + Model / Model only remain available. At narrow widths source stacks below the model and Explorer yields space while source is open. Panel preferences stay in the browser, independently of portable project files. + +**Browse with tabs:** named views, temporary explorations, requirements representations and documents open workspace tabs. Source files have their own tab strip. Closing a tab retains project drafts; one tab remains open in each strip. Switching source files retains their draft undo and scroll state until source is replaced or the project changes. Workspace tabs and model back/forward history are session-local. Project overview and Explore selection use the existing supported exploration scopes; no hidden view declarations are authored. Use the scope breadcrumb to choose another package or part; the adjacent Ownership overview/Structure control changes its presentation. Scope details are shown once, and the chooser opens on demand. The home icon opens Project overview. Source history, Apply/Discard and language actions remain in the Source header. A Draft badge beside a filename describes that file only, while Apply/Discard affect all project source drafts. + +**Read inspection values:** select an element and choose **Inspect selection**. Declared expressions are visible in value cards; expand **Declaration details** for their declaration and provider. These are authored expressions, not evaluated values. Explorer section counts include collapsed model descendants. **Read large views:** large authored trees and interconnections open at a readable scale when fitting the whole graph would reduce zoom below 60%. Pan to continue, choose **Fit view** for an overview, or select a diagram occurrence and choose **100%** to read it. These camera actions preserve source and saved symbol positions. @@ -94,8 +98,8 @@ Choose **Load example** to open the **Inspection rover** in **Model only** arran Explore the named views **architecture → mission → lifecycle → requirements → definitions**. Choose **Guide** in the project header for a tour of the editor controls. The opening diagram includes a 480 Wh battery, two distinct drives, lidar, controller, camera and radio. Declared values, successions and satisfaction links are model content; the app does not execute or simulate them. -1. Select another named view in Explorer or the diagram’s **Named view** selector. -2. Choose **Source + Model** (tooltip: **Show source and model**) to see source; selecting a file keeps the active diagram open. +1. Open a named view in Explorer or use **Open workspace tab** (+). Switch opened views, project-wide Requirements/Traceability, and documents in the single workspace tab strip. +2. Choose **Show Source** to open source on the right; selecting a file keeps the active diagram open. Choose **Inspect selection** when you need element details. 3. Edit source and choose **Apply source**. Invalid drafts retain the applied model and appear in **Issues**. 4. Choose **Download project** to preserve sources and arranged view geometry. @@ -114,7 +118,7 @@ Connection creation currently requires explicit compatible directions and identi ### 4. Inspect requirements and source -Choose **Requirements table** above the diagram to browse applied requirement identifiers, documentation and declared links; search or sort the rows and export CSV. **Traceability matrix** shows satisfaction or verification declarations against linked elements, including explicitly negated links. These are read-only views, not executed verification results. Select a requirement or link to open its Inspector details. Choose **Open source** there to navigate to its declaration; apply or discard a changed draft in that file first. +Choose **Requirements table** above the diagram to browse applied requirement identifiers, documentation and declared links; search or sort the rows and export CSV. **Traceability matrix** shows satisfaction or verification declarations against linked elements, including explicitly negated links. These are read-only views, not executed verification results. Inspect a requirement row or select a diagram link and choose **Inspect selection** to open its details. Choose **Open source** there to navigate to its declaration; apply or discard a changed draft in that file first. In the source pane, **Find references** (also Shift+F12) lists project reference locations. **Format source** formats the current draft with Toolkit. Formatting supports local editor undo; **Apply source** validates and accepts it into source history. Failed or stale queries retain your work. @@ -164,7 +168,7 @@ Models without named views open a temporary project overview. Choose **Explore m | Theme, palette, custom colors and panel arrangement | Browser preferences; separate from project content | | Undo history, selection and camera | Current session; not restored from the project bundle | -Drag a divider or focus it and use arrow keys to resize a panel. Header options provide button alternatives. Reopen collapsed tools from their edge rails, open **Issues** from the footer, or use **Workspace layout** to adjust/reset the arrangement. Below 900 px, the source/diagram split becomes vertical. [Panel behavior](docs/architecture/workbench-layout.md). +Drag a divider or focus it and use arrow keys to resize a panel. Use the header toggles to reopen collapsed tools, open **Issues** from the footer, or use **Workspace layout** to reset the arrangement. Below 900 px, the source/diagram split becomes vertical. [Panel behavior](docs/architecture/workbench-layout.md). Use **Appearance** for Light/Dark/System, palettes and custom muted fills. Preferences never modify source, project files or model undo history. [Design system](docs/design-system.md). diff --git a/docs/README.md b/docs/README.md index 042dfe7..a2de18c 100644 --- a/docs/README.md +++ b/docs/README.md @@ -32,6 +32,8 @@ OpenMBEE View Editor is a sandbox browser workspace for SysML v2 source and name ## Planned work and research +- [Model-first redesign assessment](design/redesign-implementation-plan.md): Stitch reference, existing component reuse, staged panel/tab/navigation changes and preservation gates. [Brand and styling specification](design/DESIGN.md). + - [OpenMBEE brand-guide review](research/openmbee-brand-review.md): PR #53 scope, corrected brand-mark attribution, screenshot inspection and verification limits. - [November stabilization review](research/stabilization-2026-11.md): open PR dispositions, CubeSat timeout replay, issue reconciliation and remaining investigation boundaries. diff --git a/docs/architecture/README.md b/docs/architecture/README.md index 7116719..f9e0619 100644 --- a/docs/architecture/README.md +++ b/docs/architecture/README.md @@ -55,7 +55,7 @@ Unit tests exercise workspace interfaces with controlled engine responses. These ## Workbench arrangement -The [panel shell](workbench-layout.md) composes resizable tools and editors, with validated browser layout preferences and accessible icon actions. It owns no semantic transactions or portable-project fields. Divider movement retains camera/model-space geometry; explicit editor mode changes retain the existing fit-to-pane behavior. +The [panel shell](workbench-layout.md) composes resizable tools and editors, with validated browser layout preferences and accessible icon actions. It owns no semantic transactions or portable-project fields. Divider movement and panel visibility changes retain the camera and model-space geometry; fitting remains an explicit action after the initial view layout. [Source assistance and local recovery](source-assistance-recovery.md) describes draft-bound language queries, supported edits, the independent recovery envelope and concurrency policy. diff --git a/docs/architecture/model-exploration.md b/docs/architecture/model-exploration.md index dcd4642..f9cc2e7 100644 --- a/docs/architecture/model-exploration.md +++ b/docs/architecture/model-exploration.md @@ -4,7 +4,7 @@ Agreed direction, 2026-11-01; first bounded implementation, 2026-11-05. Project/ ## Current bounded slice -Imports without named views open a project overview; imports with named views retain their existing opening behavior. **Explore model** in the named-view selector opens temporary browsing. Separate **Exploration scope** and **Exploration representation** controls select project roots, a package or an explicit part declaration. Project/package scopes support overview trees; explicit part definitions/usages also support structural projection. Typed usages are not automatically unfolded and show that limit explicitly. No automatic system-root inference is claimed. +Imports without named views open a project overview; imports with named views retain their existing opening behavior. The **Project overview** home action opens temporary browsing. One scope breadcrumb opens an on-demand **Exploration scope** chooser for project roots, packages or explicit parts; the adjacent **Exploration representation** selector chooses the view type. The current scope is not repeated in a second summary. Project/package scopes support overview trees; explicit part definitions/usages also support structural projection. Typed usages are not automatically unfolded and show that limit explicitly. No automatic system-root inference is claimed. Ownership overviews now draw nested packages and declarations from the native artifact's parent identities. Relationship endpoints do not determine ownership: for example, `Q` owns `Motor`, while `P::System` owns its `primary` and `standby` usages. Parallel declarations retain independent correspondence and keyboard/source inspection. Generated ownership layouts reserve right-side routing gutters within the nearest shared owner, with separate rectilinear tracks and label rows clear of declaration bodies and headers. Cross-root routes use the gaps between roots or space below intervening roots. Camera fitting includes route and label bounds. This routing depends on the generated vertical ownership layout; it is not a general router for arbitrary manually positioned diagrams. @@ -58,3 +58,5 @@ Follow-up slices are explicit creation of a named view from exploration, storage ## Engine evidence The [pinned-engine investigation](../research/automatic-exploration-contract.md) executed the current WASM boundary and native renderer. The investigation originally identified a declaration-free project/package seam; the bounded implementation now exposes it through a separate browser contract. A typed system usage did not automatically unfold its definition’s internals. The first delivered exploration must therefore use an overview until structural subject/usage expansion is proven, rather than promise an inferred full-system diagram. + +Temporary exploration publishes exact source correspondence. Native relationships without a recorded source location are omitted with a diagnostic count shown in the exploration header, while declarations and source-backed relationships remain. This bounded projection does not invent origins for implicit typing/subsetting and does not alter authored views. diff --git a/docs/architecture/source-assistance-recovery.md b/docs/architecture/source-assistance-recovery.md index 2b4eb3a..fa2ee95 100644 --- a/docs/architecture/source-assistance-recovery.md +++ b/docs/architecture/source-assistance-recovery.md @@ -4,7 +4,7 @@ The workbench composes a separate Toolkit language adapter in `shell/session.ts` Completion is explicit with Control+Space. Only supported single plain-text edits are offered; snippets, additional edits and commands are excluded. Hover and F1 display plain text. F12 navigates to one exact project-file definition; unavailable, ambiguous and library-only targets explain their limits. The editor rejects results after draft, session, file or busy-state changes and rechecks completion validity when applying it. Queries do not apply source, change model history or replace views. -Diagram selection can highlight a declaration passively without moving focus away from the diagram. Explicit Open source, issue navigation and definition navigation focus the editor. This distinction prevents the Enter key used to select a diagram relationship from being inserted into the source editor during the same key event. +Diagram selection can highlight a declaration passively without moving focus away from the diagram. Explicit Open source, issue navigation and definition navigation focus the editor. A reveal waits for the mounted editor to have a visible, non-inert container with nonzero dimensions; a ResizeObserver retries after panel sizing, and disconnects after focus succeeds or the request is superseded by a new selection, file or user input. It does not rely on a fixed frame count. This distinction prevents the Enter key used to select a diagram relationship from being inserted into the source editor during the same key event. ## Issue navigation diff --git a/docs/architecture/workbench-layout.md b/docs/architecture/workbench-layout.md index 72784e8..cbeae72 100644 --- a/docs/architecture/workbench-layout.md +++ b/docs/architecture/workbench-layout.md @@ -4,64 +4,58 @@ The workbench composes owned shadcn Resizable, Tooltip and Popover primitives ar ## Panel behavior -Explorer and Inspector resize beside the central editor. Source and Diagram share an adjustable divider in Split mode. Below 900 px the editor split becomes vertical. Issues is a separate, resizable bottom dock. Defaults collapse Inspector on a fresh narrow viewport; an edge rail can reopen it. Header options offer Narrow/Widen or Shorter/Taller without dragging, and Workspace layout offers source/diagram share controls and Reset layout. +The model-first shell places Explorer on the left, Source on the right and inspection below the central model workspace. Bottom tabs select Properties, Relationships or Issues. The default is Explorer plus model; source and inspection open on demand. The existing Source only / Source + Model / Model only modes remain supported. Below 900px Source stacks below the central workspace and Explorer yields space while source is open. -Each side panel remembers its expanded percentage through collapse and restore. Reopening uses that percentage unless it would fall below the tool’s pixel minimum, in which case the minimum is requested without replacing the saved percentage. Pixel minimums keep Explorer (145 px), Inspector (190 px) and Issues (96 px) usable; side panels are capped at 420 px and Issues at 60%. The source/diagram panes have horizontal minimums of 160 px for Source and 200 px for Diagram, or 100 px vertically, and their divider cannot collapse an editor while Split mode is selected. The library applies constraints against available space. On screens below 600 px, explicitly opening one side tool collapses the other. +Independent header controls toggle each supporting panel. Focus model and panel maximise/restore are temporary layouts, separate from saved normal sizes/visibility. Close returns focus to the visible corresponding toggle. Explicit requirement inspection opens Properties; ordinary tree/diagram selection only updates the selection. New diagnostics open Issues without intentionally moving keyboard focus. File selection and guarded Open source reveal Source. Explicit reveal requests are consumed within their project surface; replacing a project does not replay earlier Source/inspection requests. -Dividers have accessible names and library-provided pointer/keyboard behavior. They remain registered in the layout when a tool collapses: removing a divider from layout can invalidate its association with the neighboring panels. The source/diagram divider is disabled outside Split mode. Hidden contents remain mounted and inert, keeping draft text and component state out of keyboard navigation. Single-editor modes reapply their layout when a resize callback reports space retained by the hidden pane after constraint registration. This avoids the old Diagram minimum leaving a blank strip after Split → Code; returning to Split retains the saved share. - -Explicit collapse moves focus to the corresponding visible edge-rail reopen control. Explicit reopen returns focus to the panel's collapse button, after the restored content is no longer hidden/inert. New diagnostic/error text opens Issues without taking editor focus. A user can close and reopen that dock independently. Explicit model, diagram or requirements-data selection opens Inspector without taking desktop focus from the selected item. Below 600 px this transfers focus to the visible Inspector collapse control, because opening it collapses Explorer. Unrelated renders do not reopen a manually collapsed Inspector. - -The canvas waits for measured dimensions and initialized nodes before fitting. Authored trees/interconnections enter at 100% when a complete fit would be below 60%, with a top-aligned component (rather than empty container space) or centered selected occurrence. Fit view remains an explicit complete-graph overview, and 100% reads the exact selected diagram node or port owner (or the first structural component, then root, when none is selected). Trees allow zoom down to 10%, so an overview is not limited by the old 50% floor. These actions alter only the camera. Explicit Code/Split/Diagram mode changes refit the available diagram, retaining the previous workflow. Dragging dividers or collapsing side tools does not repeatedly fit or arrange nodes, so the user's camera and saved model-space coordinates survive those changes. +The existing resizable-panel library supplies pointer and keyboard resizing with larger hit areas than the 1px visible divider. Hidden content remains mounted and inert. The shell owns no semantic transactions. Panel transitions preserve draft/editor lifetime and camera; Fit view and Read at 100% remain explicit camera actions. Initial diagram fitting still applies on a newly evaluated view without a retained session camera. Revisiting a model tab restores its camera under that diagram identity and applied model hash. Geometry remains in the existing presentation owner. ## Preferences and preservation -`workbench/shell/layout.ts` owns a closed TypeBox schema for `sysml-workbench-layout-v1`. It stores version 1, the last expanded side/dock percentages, the source split share and tool collapse flags. Values are bounded; invalid, unknown, oversized or incompatible records fall back to defaults. No document text or semantic identifiers enter these preferences. - -Reads and writes tolerate blocked browser storage. A failed save retains the live layout for the visit and reports the failure under Workspace layout. Reset applies responsive defaults. Preferences are specific to a browser origin; they are not part of the portable project. +`layout.ts` validates closed version-2 records under `sysml-workbench-layout-v2`: Explorer/source/bottom sizes, visibility flags and the bottom tab. Supported version-1 records are validated and migrated conservatively; the old Inspector width is not reinterpreted as a bottom height. Invalid/unknown/oversized data falls back to model-first defaults. Failed writes retain live preferences and show a warning in Workspace layout. No model identifiers or source enter layout preferences, project bundles or recovery through this change. -Panel changes do not invoke workspace transactions, reparse source, alter diagram geometry, mark the project modified or add undo history. Source and Diagram remain mounted through mode changes. Project bundles retain their existing version-1 format. Download provides a portable copy; the separate local recovery workflow offers explicit restore/discard after reload. Remembering panel preferences is not work recovery. +Workspace tab descriptors and back/forward history are session-local and use existing view/document/exploration identities. Navigation goes through the workspace's current revision checks; failed requests retain the existing displayed work. Table/matrix representations remain project-wide. Each exploration scope has one tab; changing its view type updates that tab rather than opening an identical second tab. Camera caches remain keyed by full scope/representation identity. Model selection remains shared. Table filters and table/document scrolling are not snapshotted per tab and can reset when their surface remounts. Closing the final tab is disabled; closing any other tab activates a surviving one before removing the active descriptor. Source tabs retain drafts even when closed. Project replacement clears both tab lists and per-project editor/camera state. ## Source editor -`workbench/source/SourceEditor.tsx` owns one CodeMirror 6 view. The stream language supplies lexical keyword/comment/string/number coloring and brace indentation; engine parsing, diagnostics and semantic edits retain their existing owners. Shared theme roles style highlighting, gutters, selections and the built-in search panel. Semantic completion, hover, definition navigation, formatting and syntax-aware folding are not supplied by this lexical mode. +`workbench/source/SourceEditor.tsx` owns one CodeMirror 6 view, caching per-file EditorState and scroll position for source tabs. A cached state is restored only when its exact raw draft text still matches; external replacements start fresh state. Successful project replacement creates a new editor session. The stream language supplies lexical keyword/comment/string/number coloring and brace indentation; engine parsing, diagnostics and semantic edits retain their existing owners. Shared theme roles style highlighting, gutters, selections and the built-in search panel. Semantic completion, hover, definition navigation, formatting and syntax-aware folding are not supplied by this lexical mode. -Local text changes update workspace drafts. Busy operations reconfigure editing access without replacing the view or local history. A different file or externally replaced source starts a fresh editor state, preventing local undo from reviving discarded work or another file's edits. The view itself stays mounted through resizing and editor-mode changes. Source reveal translates raw UTF-16 positions to CodeMirror's LF-based positions, including CRLF and Unicode. Text edits retain untouched line separators, including mixed endings; inserted lines use the file's first separator. Portable sources, drafts, geometry and the version-1 project format retain their existing schemas and ownership. +Local text changes update workspace drafts. Busy operations reconfigure editing access without replacing the view or local history. File tabs restore their own matching editor state; externally replaced text starts fresh state so undo cannot revive discarded work or another file's edits. The view itself stays mounted through resizing and editor-mode changes. Source reveal translates raw UTF-16 positions to CodeMirror's LF-based positions, including CRLF and Unicode. Text edits retain untouched line separators, including mixed endings; inserted lines use the file's first separator. Portable sources, drafts, geometry and the version-1 project format retain their existing schemas and ownership. ## Toolbar ownership -`WorkspaceToolbar` contains only `ArrangementSelector` and Workspace layout. Source only, Source + Model and Model only retain the internal `code`, `split` and `diagram` states. The mutually pressed arrangement controls are centered in their global bar, independent of the active Diagram/table/matrix representation. `ModelPaneHeader` composes the visibly labeled representation buttons, applied/draft/busy status and diagram target controls for [#42](https://github.com/Open-MBEE/sysml_view_editor/issues/42). +`WorkspaceToolbar` contains `ArrangementSelector` and the independent panel/focus/layout controls. Source only, Source + Model and Model only retain the internal `code`, `split` and `diagram` states. The mutually pressed arrangement controls are centered in their global bar, independent of the active Diagram/table/matrix representation. `ModelPaneHeader` composes model history, contextual diagram controls and pending-draft/busy/rendering notices. One workspace tab strip selects opened diagrams, project data and documents; the adjacent picker opens additional content. Arrangement remains independent of active content. `SourcePaneHeader` lives inside SourceEditor and receives the existing source transaction callbacks from Workbench. It shows the active filename, a per-file draft badge, source undo/redo, workspace source status and labeled Apply/Discard actions. The badge compares that file's draft and applied text; a different file's draft can keep the workspace status pending without marking the active file. SourceEditor supplies its own Find references/Format source actions through a header composition callback; its CodeMirror instance and source-assistance ownership remain unchanged. -Source actions become hidden/inert with Source in Model-only mode. Showing Source makes them reachable; arrangement changes never apply or discard. The existing diagram metadata continues to distinguish the applied model from pending drafts. Source history and action groups align inside the actual pane and wrap at constrained pane widths, so global toolbar alignment no longer measures Explorer/Inspector pixel widths. Source split-ratio observation remains for the single-pane constraint-registration guard, and persisted preferences are unchanged. In the vertical arrangement, Source’s minimum height follows the measured, wrapping header plus 80 px of editor space. A ResizeObserver updates that limit when the header width/content changes, ignoring zero-height measurements while Source is hidden; horizontal Source width limits are unchanged. +Source actions become hidden/inert with Source in Model-only mode. Showing Source makes them reachable; arrangement changes never apply or discard. The existing diagram metadata continues to distinguish the applied model from pending drafts. Source history and action groups align inside the actual pane and wrap at constrained pane widths, so global toolbar alignment no longer measures Explorer/Inspector pixel widths. The right Source pane has a 280px desktop minimum; narrow layouts stack it vertically with a 240px minimum. Panel constraints remain subject to the available viewport. -Sidebar collapse controls remain in their own headers, with contextual edge reopen rails. The activity rail and sectioned Explorer are tracked separately by [#43](https://github.com/Open-MBEE/sysml_view_editor/issues/43). Broader responsive/accessibility integration remains [#44](https://github.com/Open-MBEE/sysml_view_editor/issues/44). See the [agreed product design](../design/workbench-product-decisions.md) for staged scope and preservation gates. +Supporting panels retain local collapse/maximise controls and reopen from the persistent header toggles. Broader responsive/accessibility integration remains [#44](https://github.com/Open-MBEE/sysml_view_editor/issues/44). See the [redesign plan](../design/redesign-implementation-plan.md) for phased scope and preservation gates. ## Model header and renderer lifetime -`ModelPaneHeader` uses the existing Workbench `dataMode` and transaction handlers. `DiagramTargetControls` owns named-view selection, exploration scope/representation focus, view-kind metadata and existing contextual authoring buttons. It is composed once into the header; Diagram no longer renders a competing target header. Its controls remain mounted but hidden/inert for tables/matrices, preserving exploration focus refs without exposing diagram-only controls. +`ModelPaneHeader` uses the existing Workbench `dataMode` and transaction handlers. `DiagramTargetControls` owns the scope breadcrumb chooser, exploration view-type focus, named-view kind metadata and contextual authoring buttons. It is composed once into the header; Diagram no longer renders a competing target header. Its controls remain mounted but hidden/inert for tables/matrices, preserving exploration focus refs without exposing diagram-only controls. The Diagram renderer remains at its existing stable position/key and is hidden for data representations. Its layout, camera, selection, asynchronous arranging/failure reporting and canvas Fit/100%/lock controls remain renderer-owned. `supportsDiagram` shares the original UI capability gate with the header: an evaluated engine artifact can still have no renderer here, as with sequence views. Busy status distinguishes work in progress from the applied revision still being displayed; unapplied drafts do not imply a new rendered model. -Tables/matrices are explicitly labeled Project-wide requirements. Their search, sorting, filters, CSV export, loading/error/retry and guarded inspection remain owned by RequirementsPanel. Header overflow uses a bounded native scroll area when the vertical Model pane is deliberately reduced; representation and target controls remain keyboard reachable. The broader responsive/assistive-technology integration remains #44. +Tables/matrices are explicitly labeled Project-wide requirements. Their search, sorting, filters, CSV export, loading/error/retry and guarded inspection remain owned by RequirementsPanel. Workspace tabs, model navigation and the Model header share one bounded native scroll area when the Model pane is deliberately reduced, retaining room for canvas controls. Representation and target controls remain keyboard reachable. The broader responsive/assistive-technology integration remains #44. ## Icons and controls Lucide icons use the shared shadcn Button sizes, theme roles and focus indicators. Compact history and mode actions use `ui/IconButton.tsx`: each has an explicit accessible name, a Tooltip and a decorative SVG. The root supplies one delayed Tooltip provider, and hints pass pointer events through to the underlying UI. -| Action | Icon | -| ------------------------------------------ | -------------------------------------------------------------- | -| Source undo / redo | Undo2 / Redo2 | -| Source only / Source + Model / Model only | CodeXml / Columns2 / Layers | -| New project / Open / Download | FilePlus2 / FolderOpen / Download | -| Apply / discard draft | Check / X | -| Appearance | Palette | -| New part / connection | SquarePlus / Cable | -| Source reveal / reviewed rename / new view | CodeXml / Pencil / Eye | -| Diagram zoom / fit / lock | ZoomIn / ZoomOut / Scan / LockKeyhole variants | -| Panel visibility | Explorer Folder activity; contextual panel close/open variants | -| Panel options / reset layout | Ellipsis / RotateCcw | +| Action | Icon | +| ------------------------------------------ | ---------------------------------------------- | +| Source undo / redo | Undo2 / Redo2 | +| Source only / Source + Model / Model only | CodeXml / Columns2 / Layers | +| New project / Open / Download | FilePlus2 / FolderOpen / Download | +| Apply / discard draft | Check / X | +| Appearance | Palette | +| New part / connection | SquarePlus / Cable | +| Source reveal / reviewed rename / new view | CodeXml / Pencil / Eye | +| Diagram zoom / fit / lock | ZoomIn / ZoomOut / Scan / LockKeyhole variants | +| Panel visibility | PanelLeft / PanelRight / PanelBottom | +| Panel options / reset layout | PanelsTopLeft / RotateCcw | Apply and Download retain visible labels; frequent compact actions retain precise names such as Undo source. CodeMirror draft undo/redo is distinct from accepted source transaction history. Standard editor/search shortcuts are documented in the README; Tab retains focus navigation. Existing kind labels remain visible alongside Explorer icons; those icons do not establish SysML notation support. @@ -75,9 +69,9 @@ Apply and Download retain visible labels; frequent compact actions retain precis Navigation follows the [WAI-ARIA tree pattern](https://www.w3.org/WAI/ARIA/apg/patterns/treeview/): arrows move through visible rows and fold/unfold branches, Home/End reach the visible extremes, typed prefixes find visible names, and Enter/Space select the focused declaration. Focus and selection are separate. One treeitem participates in Tab order; shared focus styling distinguishes it from the inspected row. -ExplorerSection owns independent session-only Files/Views/Model disclosure state. Section bodies stay mounted while hidden/inert, preserving tree expansion and focus state. New view and tree-wide actions are separate header targets. ActivityRail exposes only the implemented Explorer destination and delegates visibility to the existing panel controller; it owns no layout preferences. It replaces the adjacent collapsed Explorer rail, retaining the Inspector reopen control. Existing sidebar visibility preferences and `sysml-workbench-layout-v1` remain unchanged. +ExplorerSection owns independent session-only Files/Views/Documents/Model disclosure state. Section bodies stay mounted while hidden/inert, preserving tree expansion and focus state. New view and tree-wide actions are separate header targets. Header panel controls replace the separate activity rail. The source/model arrangement selector remains independent of representation. -Diagram selection opens the Model section and the selected declaration's owner chain without taking focus from the diagram. A UI request counter handles a second selection of the same symbol after its branch has been folded. These are reveal requests, not semantic revisions or identity reconciliation. Selecting a tree row retains the existing Inspector behavior; source-range reveal still requires diagram correspondence. Expansion is not portable project data or automatic work recovery. +Diagram selection opens the Model section and the selected declaration's owner chain without taking focus from the diagram. A UI request counter handles a second selection of the same symbol after its branch has been folded. These are reveal requests, not semantic revisions or identity reconciliation. Selecting a tree row updates inspection content without opening the bottom dock; source-range reveal still requires diagram correspondence. Expansion is not portable project data or automatic work recovery. ## Entry and session lifetime @@ -89,12 +83,18 @@ The public landing lives at `/`; `/app` starts with a project launcher. Source/d ## Responsive and accessibility integration -Pane-local controls use intrinsic wrapping; Model representation buttons can wrap their labels within narrow panes even beside Inspector. Existing 900 px vertical Split and below-600 mutually exclusive side tools are retained. Opening a collapsed tool first releases its reopen rail before requesting space, avoiding a narrow-panel constraint deadlock. Hidden panels and sections remain mounted/inert. Projects and Workspace layout have distinct Folders/PanelsTopLeft icons; forced-color representation/arrangement selection has a persistent border separate from the focus outline. Reduced-motion behavior remains the shared rule in `base.css`. +Controls wrap inside their panels; the app header gains a second row at phone widths. Inspection and content tabs support arrow/Home/End focus navigation. Hidden panels, sections and inactive bottom tabs remain inert. Focus and selection remain separate; forced-colour and reduced-motion behaviour retain shared theme rules. Bottom content scrolls when larger details do not fit the available height. When an explicit inspection request opens the dock at narrow widths, keyboard focus moves to its close control after panel resizing; this prevents focus remaining on a table row clipped by the smaller model pane. Desktop inspection preserves the calling control’s focus. -`workbench-chrome.spec.ts` checks actual pane extremes, viewport transitions, exact drafts/bundle/editor/camera preservation, minimum-height canvas control access and forced-color focus/selection. Targeted accessibility-tree and screen-reader observations are recorded in [verification](../verification.md); they do not establish comprehensive assistive-technology support. +`model-first-layout.spec.ts` exercises editor/draft/camera preservation, explicit inspection, keyboard tab navigation, source-file undo across tabs, workspace history, and light/dark desktop/narrow captures. The verification record distinguishes the full visual/critical gate from additional focused checks. These results are not a complete accessibility certification. ## Generated document integration -Documents is an independent Explorer section using the same mounted disclosure behavior. ModelPaneHeader conditionally offers Document when declarations exist; it hides diagram targets without changing arrangement or the active file/view. The document pane renders applied-source content and retains explicit guarded source reveal. Embedded diagrams use read-only previews with the same source-value validation context as named views; Open as named view is a separate action. +Documents is an independent Explorer section using the same mounted disclosure behavior. Documents open workspace tabs through Explorer or the shared content picker. ModelPaneHeader shows contextual actions and applied/draft status; it hides diagram targets for data/document tabs without changing arrangement or the active source file/view. The document pane renders applied-source content and retains explicit guarded source reveal. Embedded diagrams use read-only previews with the same source-value validation context as named views; Open as named view is a separate action. Source acceptance, undo and redo independently refresh the selected document even if the separate diagram refresh fails. Document progress and transport failures are visible, and newer actions suppress obsolete refresh work. Document data is derived session state and does not enter the portable project or layout preference schema. + +## Workspace navigation controls + +Explorer discovers named views and documents; the workspace has one strip for opened content. The adjacent **Open workspace tab** (+) popover provides project-wide Requirements/Traceability and lists named views/documents when Explorer is hidden. Activation uses the same revision-aware `activateTab` path as existing tabs. Choosing content focuses the active tab after it is registered; Escape closes the picker and returns focus to its trigger. The picker is disabled during model work. It does not author declarations or alter panel visibility. + +The persistent named-view dropdown, representation-button row and repeated visible workspace title are removed. A compact contextual toolbar retains model history, a Project overview home action, conditional Explore selection, pending-draft/update/rendering notices, Inspect and guarded structural editing actions. Exploration shows one wrapping, fully qualified scope breadcrumb with an on-demand chooser and one view-type selector. The scope summary, duplicate ownership-view caption, permanent Scope/Representation field labels and healthy Applied model notice are removed. Project data remains project-wide; table/matrix tabs do not claim to render the active named view. Changing representation within the same scope refreshes the current history descriptor without discarding forward entries, so Back restores the representation last visited. Temporary browsing state remains outside portable project data. diff --git a/docs/capabilities.md b/docs/capabilities.md index 0263960..1de85f4 100644 --- a/docs/capabilities.md +++ b/docs/capabilities.md @@ -35,7 +35,7 @@ The [visualization example library](../examples/README.md) records representativ The read-only requirements table inspects all applied requirement declarations, identifiers, owned documentation and declared satisfaction/verification links. It supports search, name sorting and CSV export. The traceability matrix uses requirements as rows and linked satisfiers/verifiers as columns, retaining exact declaration identities and negation. It does not infer missing relationships, compute verification verdicts or edit model content. Unknown/incomplete extraction is unavailable rather than an empty result. Source reveal requires that file's draft to match applied source. [Requirements data contract](architecture/requirements-data.md). -Workspace arrangement is independent of Model representation: **Source only**, **Source + Model** and **Model only** choose visible slots. Source history and Apply/Discard live in the Source header; the filename’s Draft badge is per-file while those transactions affect all project sources. The Model header combines visibly labeled representation, revision status and diagram-only target/authoring controls. Tables and matrices state their project-wide scope; canvas controls remain on the Diagram. A sparse Explorer activity rail toggles the sidebar. Files, Views and Model fold independently while preserving mounted navigation state. Representation labels wrap to actual Model pane width, with a separate persistent selection cue in forced colors. See the [product design](design/workbench-product-decisions.md) and [verification record](verification.md) for tested coverage and limits. +Workspace arrangement is independent of opened content: **Source only**, **Source + Model** and **Model only** choose visible slots, alongside independent Explorer/Source/inspection controls. Source history and Apply/Discard live in Source; filename Draft badges are per-file while transactions affect all project sources. A single workspace strip holds opened diagrams, project-wide Requirements/Traceability and generated documents. **Open workspace tab** (+) discovers content when Explorer is hidden. The contextual toolbar retains history, a scope breadcrumb with an on-demand chooser, one exploration view-type control, meaningful pending/update notices, Inspect and supported authoring actions. The separate activity rail, persistent named-view dropdown and representation-button row are removed. Files, Views, Documents and Model fold independently, preserving mounted navigation state. Selection remains distinct from keyboard focus in forced colours. See the [layout contract](architecture/workbench-layout.md) and [verification record](verification.md) for coverage and limits. The optional **Guide** in the project header introduces Explorer, layout, source application, model representations and project download for any open project. It can be dismissed and restarted, and does not alter project data. diff --git a/docs/design-system.md b/docs/design-system.md index 8cd82c9..d4c228e 100644 --- a/docs/design-system.md +++ b/docs/design-system.md @@ -64,7 +64,7 @@ This is a working foundation, not a claim of complete keyboard/screen-reader cer Resizable, Tooltip and Popover are owned official registry primitives. `react-resizable-panels` 4.14.8 supplies resizing; the existing Radix package supplies popover/tooltip behavior. `ui/IconButton.tsx` composes the shared Button and Tooltip rather than introducing a second button style. Icons use Lucide and decorative SVGs remain hidden from accessibility names. Apply and Download keep visible labels. -The global arrangement bar selects Source only, Source + Model or Model only with CodeXml/Columns2/Layers icons, explicit tooltips and mutually exclusive pressed states. It is separate from Model representation. Pane-local Source controls use the existing buttons and tokens, keep Apply/Discard labeled, and wrap based on actual pane width. The active filename’s draft badge is per-file; the adjacent transaction status and Apply/Discard remain workspace-scoped. The Model header uses Network/Table2/Grid3X3 with visible representation labels and retains separate applied/draft/busy status. Diagram target and authoring controls occur once; data representations state project scope. The sparse 48 px activity rail contains only Explorer, with a persistent active border distinct from keyboard focus. Files/Views/Model use Folder/Network/ListTree identities and independent disclosure buttons. Header actions remain separate. Representation buttons wrap to their actual pane width, and a bottom border marks selection in forced colors independently of the focus outline. Projects uses Folders, distinct from the PanelsTopLeft workspace-layout control. Existing 900/600 responsive behavior is retained; see the [product design](design/workbench-product-decisions.md) and [verification](verification.md) for observed coverage. +The global arrangement bar selects Source only, Source + Model or Model only with CodeXml/Columns2/Layers icons and mutually exclusive pressed states. Independent spatial panel toggles replace the activity rail. Source controls keep Apply/Discard labeled and wrap within their pane; the filename Draft badge is per-file and transaction status is workspace-scoped. One content strip selects opened diagrams, project-wide data and documents. Its adjacent plus button opens a grouped content picker with decorative Eye/Table2/Grid3X3/FileText icons. One scope breadcrumb and a view-type selector handle temporary exploration, with full qualified scope names wrapping inside the breadcrumb. Scope details open on demand; redundant scope summaries, form labels and healthy-state notices are removed. Pending drafts, model work and rendering problems remain visible. Selection has a persistent cue distinct from focus in forced colours. Files/Views/Documents/Model retain independent disclosures and muted category headings. Existing 900/600 responsive behaviour is retained; see the [layout contract](architecture/workbench-layout.md) and [verification](verification.md). Tool headers, dividers, collapse controls and preference handling live in the workbench, outside semantic workspace state. Focus transfer follows committed visibility, hidden tools are inert, and panel geometry is a browser preference. See [panel contracts](architecture/workbench-layout.md). @@ -74,7 +74,7 @@ The Model tree uses the shared Button through `asChild` for its rows and IconBut The OpenMBEE landing and project launcher use the existing ABeeZee/Lucide/shadcn foundation and appearance roles. `ui/entry.css` owns their responsive arrangements. A single `AppearanceProvider` owns theme/palette preferences and root tokens across landing, launcher and retained workbench; individual Appearance buttons own only their dialog visibility. Navigating between surfaces must not reset appearance or create competing preference stores. The product identity pairs the official OpenMBEE icon from `static/brand/` with the product name; no invented brand mark or copied predecessor license claims are introduced. -Entry screens remain useful at 390, 768 and 1440 px. The launcher is a full app surface, not an empty workbench behind a modal. Contextual source and diagram actions remain in their own workbench rows; the Named view selector exposes actual authored views and its supported representation, without implying automatic model exploration. +Entry screens remain useful at 390, 768 and 1440 px. The launcher is a full app surface, not an empty workbench behind a modal. Contextual source and model actions remain local to their panes. Explorer and the workspace content picker open actual authored views; scope browsing is a separate explicit action. ## Structural diagram cards @@ -82,4 +82,4 @@ Structural cards use a subtle palette-driven header, a small kind badge, a promi The styling retains renderer node dimensions and absolute saved positions. Leaf port rows share the existing body space; the real handles remain the source of connection endpoint coordinates. UI labels do not infer effective direction through conjugation. -Generated documents add a FileText identity in the existing Model representation group when the project declares documents. Their Explorer section uses the shared independent disclosure. Read-only content keeps native heading/table/link semantics; embedded diagram actions and long table values wrap within the pane. The activity rail remains Explorer-only. +Generated documents appear in Explorer and the content picker when declared, and open workspace tabs. Their Explorer section uses the shared independent disclosure. Read-only content keeps native heading/table/link semantics; embedded diagram actions and long table values wrap within the pane. Panel controls manage Explorer independently. diff --git a/docs/design/DESIGN.md b/docs/design/DESIGN.md new file mode 100644 index 0000000..24f4aa4 --- /dev/null +++ b/docs/design/DESIGN.md @@ -0,0 +1,151 @@ +# OpenMBEE View Editor design specification + +This is the design source for the OpenMBEE View Editor redesign in Stitch. Preserve the existing OpenMBEE identity. Layout and component recommendations below are proposed product design decisions, not additional official OpenMBEE brand rules. Existing theme tokens and assets are authoritative when this document and generated output disagree. + +## Purpose and character + +The product is primarily a visual aid for exploring and navigating SysML models, with occasional editing. The model is the main content. Use calm, readable, muted engineering UI: white surfaces, dark blue text, restrained cyan selection, subtle card grouping and thin dividers. Avoid both decorative dashboard styling and excessively tiny IDE controls. + +## Brand identity: required + +- Product name: **OpenMBEE View Editor**. Preserve capitalization. +- Brand dark blue: `#10052F`. This is a very dark blue with a purple appearance; do not replace it with electric violet. +- Brand light blue: `#64DDFA`. Use sparingly, primarily in small accents and pale selected surfaces. +- Brand grey: `#D6D6D6`. Use for light-theme borders and separators, not body text on white. +- Typeface: **ABeeZee Regular**, with a system sans-serif fallback. +- Official brand reference: https://www.openmbee.org/brand.html +- Brand terms: https://www.openmbee.org/licenses.html . The name and logo are excluded from the site's general Apache/CC BY licenses. Do not assert a CC BY grant for these marks. + +### Logo assets + +Use the existing SVG bytes. Do not redraw, generate, recolour, distort, or replace the mark with hexagons, cubes or another geometric icon. + +| Context | Repository asset | Absolute URL for Stitch | +| ---------------- | ------------------------------------- | ------------------------------------------------------------------- | +| Light background | `static/brand/openmbee-icon-dark.svg` | https://dsg-sysml-workspace.vercel.app/brand/openmbee-icon-dark.svg | +| Dark background | `static/brand/openmbee-icon.svg` | https://dsg-sysml-workspace.vercel.app/brand/openmbee-icon.svg | + +Display the icon around 24px high, preserve its aspect ratio and leave breathing room. Pair it with the existing OpenMBEE / View Editor text treatment. The header home link has an accessible product name; a decorative icon inside it has empty alternative text. If an asset cannot load, retain the product text and report the missing asset rather than inventing a logo. + +## Typography + +Use ABeeZee for all interface labels, tabs, buttons, cards, body text, headings and diagram labels. Do not substitute Plus Jakarta Sans, serif fonts or another design-system font. The application includes only ABeeZee Regular 400, Latin subset; browsers synthesize heavier emphasis. Do not claim that a native ABeeZee semibold/bold file is included. + +```css +@font-face { + font-family: 'ABeeZee'; + font-style: normal; + font-weight: 400; + font-display: swap; + src: url('https://dsg-sysml-workspace.vercel.app/fonts/abeezee/abeezee-latin-400-normal.woff2') + format('woff2'); +} +:root { + font-family: + 'ABeeZee', + system-ui, + -apple-system, + sans-serif; + font-synthesis: weight; + --sysml-font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace; +} +``` + +Use the monospace stack only for source, line numbers and technical strings that benefit from fixed spacing. Keep ordinary diagram names in ABeeZee. Proposed desktop scale: 16–18px project/element title, 14px controls and body, 12–13px metadata and compact tabs, 13px source. These are design targets, not a claim about current application sizes. Use weight, spacing and placement to establish hierarchy; do not make every heading oversized or bold. Essential information must remain readable. + +## Existing colour tokens + +These values are copied from `src/lib/ui/tokens.css` and `controls.css`. Use semantic roles instead of assigning colours independently to components. + +| Role | Light | Dark | +| ---------------------- | --------------------- | --------------------- | +| Surface | `#FFFFFF` | `#1B1139` | +| Subtle surface | `#F6F6F8` | `#251B45` | +| Canvas | `#FAFAFC` | `#10052F` | +| Text | `#10052F` | `#F1F1F4` | +| Secondary text | `#4E4764` | `#D6D6D6` | +| Border | `#D6D6D6` | `#5A5270` | +| Diagram stroke | `#10052F` | `#D6D6D6` | +| Primary accent | `#10052F` | `#64DDFA` | +| Text on primary accent | `#FFFFFF` | `#10052F` | +| Selected surface | `#E0F8FE` | `#1D3F5C` | +| Selected text | `#10052F` | `#C9F3FD` | +| Grid | `#D6D6D6` | `#3A3155` | +| Success | `#247254` | `#9BC8AC` | +| Information | `#0B6F8F` | `#64DDFA` | +| Error text / surface | `#B91C1C` / `#FEF2F2` | `#FCA5A5` / `#451E27` | +| Warning text / surface | `#92400E` / `#FFFBEB` | `#FDE68A` / `#3D301C` | +| Warning border | `#D97706` | `#D4A64B` | + +Light mode is the initial Stitch design target. Dark mode must use its complete token mapping, not an inverted light screenshot. Retain existing user-selectable palettes; this redesign does not remove them. + +### Colour discipline and cards + +- White header in light mode. No dark banner, gradients, neon purple, glow, or saturated cyan blocks. +- Neutral panel backgrounds with white cards. Use existing selected surface `#E0F8FE` for active navigation, with a small accent edge and a non-colour selection indicator. +- Card tint is quiet and local: a small icon tile, thin accent edge or faint header treatment. Do not colour the entire sidebar or every card differently. +- Model-kind colours identify kind, not validity. Existing light roles: source `#6D3AC6`, structure `#087C91`, behavior `#B65016`, states `#9B3590`, sequence `#3754BC`, requirements `#247254`, entities `#126F79`, parameters `#8B6110`. Use in small labelled badges or icons, not large text/background fields. +- A green requirement-kind badge does not mean the requirement is satisfied. Warning/error colours indicate actual corresponding states, never decoration. +- Existing muted diagram palette: package `#EDF1F5`, definition `#EAF1FC`, usage `#E9F4EF`, input port `#E3EFFF`, output port `#FFF3D6`, inout port `#E2F3F2`. Retain labels/shapes as well as colours. Do not make all ports cyan when direction is relevant. + +## Implemented hierarchy refinement + +The Explorer uses faint category-tinted headings and counts of files, view declarations, documents and indexed model elements. Model counts include collapsed descendants. Package icon tiles use a source-colour tint; definition and usage tiles use the existing palette surfaces. Labels and selection edges remain meaningful without colour. + +The active workspace tab names the content; the contextual toolbar shows status and actions. Pending drafts, updates and rendering issues receive subdued status text; healthy applied state adds no toolbar label. Inspection gives the selected element a larger title and a readable kind badge; technical identities remain available in the summary. Declared attribute expressions appear immediately in quiet value cards. Declaration/provider metadata is expandable within each card, and source navigation remains guarded by draft/source availability. These expressions are authored values, not evaluated results. + +### Navigation controls + +Explorer discovers named views and documents. One workspace strip holds opened diagrams, project-wide Requirements/Traceability and documents. **Open workspace tab** (+) lists available content when Explorer is hidden. The persistent named-view dropdown, representation-button row and repeated visible workspace title are removed. Model history, Inspect and guarded editing actions remain in the contextual toolbar. Exploration uses one scope breadcrumb that opens its chooser on demand, plus one view-type control. Remove repeated scope/representation summaries and healthy-state text. Fully qualified scope names wrap inside the breadcrumb rather than overflowing the pane. + +## Layout proposal: four available panels + +Default viewing shows a compact navigator and a generous model workspace. Four panels can be opened deliberately; four panels are not mandatory on every visit. + +1. **Left Explorer:** Files / Views / Documents / Model independently collapsible sections, retaining the existing ownership tree and separate navigation actions. No duplicate permanent activity rail. +2. **Main workspace:** document tabs for open diagrams, requirements tables, traceability matrices and documents. Breadcrumbs support navigation. The canvas receives the largest area. +3. **Right source:** the existing source editor with file tabs and explicit draft/applied status. Closed by default. Keep draft/history/language commands local to this panel. +4. **Bottom inspection:** Properties / Relationships / Issues tabs below the centre workspace only. Closed by default. Group identity, attributes and relationships compactly; selection updates content without forcing the panel open. + +Compact application header: official branding, project identity, existing file operations and independent panel controls. A consolidated project menu and model search remain future refinements; do not display nonfunctional controls. Do not add repository branch, commit, deployment or cloud collaboration chrome without an actual product requirement. + +### Panel controls and interaction + +- Three consistently positioned top-right toggles represent left Explorer, bottom inspection and right source. Their icons reflect placement; pressed state reflects visibility. +- Each supporting panel has Close and Maximize/Restore controls. Visible divider handles allow resizing. Remember widths, heights and open state. +- Focus mode hides supporting panels and restores the previous arrangement when exited. +- Tabs choose content; panel controls choose placement and visibility. Changing tabs must not discard source drafts, selections or document state. +- Opening/closing panels preserves canvas zoom and position; Fit remains an explicit action. Do not automatically recenter on every toggle. +- Below 900px, source stacks beneath the central workspace and Explorer yields space while source is open. Preserve mounted content and provide minimum editor space, scrolling and maximise controls. Restore focus to visible controls on close. Modal overlays, when present, contain keyboard focus. +- Icon-only actions require accessible names, tooltips and visible keyboard focus. Define shortcuts deliberately; do not invent labels for unimplemented shortcuts. + +## Component geometry and hierarchy + +Existing spacing scale: 4, 8, 12, 16 and 24px. Existing control radius: 6px. Existing focus width: 2px, with 2px outline offset. Use 1px separators and restrained shadows only for floating surfaces. Proposed panel widths are approximately 220–260px navigator and 280–400px source, subject to available space; these are not fixed requirements. Target 28–32px compact controls and 32–36px navigation rows while maintaining usable hit targets. + +Primary actions use the accent and on-accent token pair. Routine controls are quiet ghost/outline buttons. Disabled actions remain recognizable and must be disabled semantically, not merely faded. Active tabs use a clear line or shape in addition to colour. Cards group related information; do not wrap every individual property in its own decorative box. + +Diagram nodes use clear names, subdued type labels, consistent attribute rows, readable connectors and labelled port direction. Distinguish selection from hover, focus, warnings and pending edits. Preserve source-owned semantics and presentation-owned geometry. + +## Honest content and states + +Use the inspection rover as illustrative model content: battery : Battery, capacityWh 480, reservePercent 20, distribution, mobility, controller and lidar. Illustrative values are not evidence of execution. + +- Preserve explicit draft versus applied revision communication. +- Preserve the previous applied model and source drafts when application fails or times out. +- Distinguish declared satisfy/verify relationships from computed verification results. +- Never invent “Linked & Validated”, “constraints satisfied”, “PDR Approved”, engine success, approval, author, timestamps, branch/commit metadata or governance evidence. +- A badge reading Source applied is source-application status, not proof that all requirements are satisfied. +- Empty, loading and failure states must have useful text and an appropriate next action. Generated concepts must be marked Concept preview. + +## Stitch generation contract + +This document supersedes the auto-generated “OpenMBEE Engineering Workbench” style guide where it conflicts. Do not inherit its substituted logo, Plus Jakarta Sans, generated hexagon asset, additional activity rail, repository strip, extreme density or invented validation/governance claims. + +Use the official SVG and ABeeZee WOFF2 URL directly in generated HTML. If Stitch's structured font enum cannot represent ABeeZee, preserve `ABeeZee` in custom font-family/CSS and report the limitation; an unrelated enum is not approval to substitute the font. Do not silently regenerate the logo when URL loading fails. + +Before accepting a generated screen, check the logo asset, actual font CSS, exact palette, muted surfaces, panel/tab arrangement, visible controls, source state and absence of fabricated claims. A picture alone does not establish working resize/toggle behaviour or accessibility. + +## Provenance + +Existing brand and implementation evidence: `static/brand/README.md`, `static/fonts/abeezee/README.md`, `src/lib/ui/controls.css`, `src/lib/ui/tokens.css`, and `docs/research/openmbee-brand-review.md`. ABeeZee font distribution is Fontsource 5.3.0, SIL OFL 1.1; retained local license is `static/fonts/abeezee/LICENSE`. Layout proposals reflect the design discussion on 2026-11-23. No application implementation or deployment is implied by this specification. diff --git a/docs/design/redesign-implementation-plan.md b/docs/design/redesign-implementation-plan.md new file mode 100644 index 0000000..cde0f09 --- /dev/null +++ b/docs/design/redesign-implementation-plan.md @@ -0,0 +1,62 @@ +# Model-first workbench redesign: implementation assessment + +Status: implemented and locally verified on `feature/model-first-workbench`, 2026-11-23. All three delivery phases are complete within the boundaries below. See [verification](../verification.md#model-first-workbench-redesign-local-branch) for actual checks and remaining coverage limits. No commit, push or deployment is implied. Visual reference: Stitch project https://stitch.google.com/projects/2382469832338618642 , variants 04 and 05a/05b. Brand authority: [DESIGN.md](DESIGN.md). + +Use the mock for composition and styling, not its generated HTML or claims of working interactions. The reviewed 05b still contains thick dividers and “Workspace synced”; these are not requirements. Model shapes and connectors must remain derived from real engine artifacts, not the illustrative mock data. + +## Target and relationship to earlier decisions + +Preserve the existing Files / Views / Documents / Model Explorer. Default to Explorer plus model workspace. Independently open source on the right and inspection below the centre, with Properties / Relationships / Issues tabs. Add compact spatial toggles, focus mode, maximise/restore and browser-local layout preferences. Keep source-only access available for authoring and troubleshooting. + +This refines the [November 16 product decisions](workbench-product-decisions.md): retain navigation/representation/arrangement/operation separation, pane-local commands, existing panel infrastructure and preservation guarantees. Proposed changes are the removal of the redundant activity rail, right source placement, bottom inspection, independent visibility instead of the current three-mode arrangement, and later workspace tabs. The old document remains historical; the current branch implements the replacement described here; verification is recorded separately. + +## Baseline assessment before implementation + +| Area | Baseline evidence | Required change | Relative scope | +| -------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------- | +| Branding and appearance | `ui/tokens.css`, `controls.css`, official SVGs and ABeeZee | Reuse tokens; quieter chrome, card grouping and thinner visible separators | Small | +| Explorer | `explorer/Explorer.tsx`, `ExplorerSection.tsx`, `ModelTree.tsx` already provide four sections and selection reveal | Compact styling, remove duplicate rail, preserve keyboard tree and independent file/view selection | Small | +| Panel shell | `shell/WorkbenchPanels.tsx` already resizes/collapses mounted panels with inert hidden content and focus handling | Recompose centre+bottom inspection beside right source; independent toggles, focus/maximise restore and minimum sizes | Largest first-phase task | +| Layout preferences | `shell/layout.ts` validates strict version-1 browser-local preferences | New versioned layout schema with explicit migration/fallback; retain useful old sizes; distinguish temporary focus/maximise from saved normal layout | Medium | +| Selection and inspection | `Workbench.tsx` increments `inspectionRequest` on symbol/tree selection; panel shell opens Inspector | Separate selection from explicit Inspect; adapt row/relationship/requirement callers without losing details or source mapping | Medium | +| Inspection content | `properties/Properties.tsx` already handles structural, requirement, relationship and source-value detail | Split shared information into Properties/Relationships without hiding specialised details; responsive horizontal bottom layout | Medium | +| Source | `source/SourceEditor.tsx` uses CodeMirror and workspace drafts; source header owns Apply/Discard/history/language actions | Move the existing editor intact; keep mounted through visibility changes; later file tabs must preserve per-file editor state | Medium | +| Diagram camera | `Diagram.tsx` currently resets automatic fitting when `layoutMode` changes; divider movement has separate preservation guarantees | Decouple layout visibility from diagram identity and fitting; preserve camera through toggle/focus/maximise; keep explicit Fit/read actions | Medium, high regression sensitivity | +| Workspace tabs | `Workbench.tsx` has one active file, representation, named view/exploration and rendered document | Real tab identities, activation, close/fallback and revision-aware refresh; retain per-tab camera and per-file editor state; keep selection and table/document scroll shared | Large, separate phase | +| Exploration and navigation | Bounded `workspace.explore` and diagram/source correspondence exist | Breadcrumb/history UI over supported scopes; revision-aware navigation and recovery from failed/stale requests | Separate functional feature | + +No engine replacement, generic docking framework, new production dependency or portable project format change is needed for the first layout slice. Browser layout preferences are distinct from project bundles and recovery data. + +## Delivery sequence + +### 1. Working layout and controls + +Recompose existing Explorer, diagram, source editor, Properties and Issues in the target positions. Keep existing representation switching initially; do not fake document tabs. Provide navigator/source/inspection toggles, focus and maximise/restore, keyboard resizing, reasonable minimum dimensions and browser-local preference migration. Show source and inspection only on explicit actions, except that an application failure must still surface actionable issues. If Issues opens automatically on failure, show that tab in the shared bottom dock without discarding its previous tab state. + +Success: import/example opens a useful model; select updates current selection without opening inspection; Inspect opens bottom detail; file/Open source opens right source; errors remain visible and navigable. Preserve exact drafts, CodeMirror undo/selection/scroll, applied revision, source history, named-view geometry and camera through all panel transitions. Focus must return to a visible control when its previous panel closes. Hidden content must remain inert and mounted as appropriate. + +### 2. Visual and inspection refinement + +Compact header controls; quieter section headings, selected rows and type badges; short bottom identity/attributes layout with overflow for larger content; Properties/Relationships/Issues tabs. Keep all existing requirement, inherited-value, port, unsupported-case and guarded-source details available. Do not impose a fixed shallow height that clips large property sets. Make real source commands reachable at narrow widths. Keep authoring available through existing reviewed transactions. + +### 3. Workspace/source tabs and supported model navigation + +Define tab identity from existing file/view/document/representation identities; support activation, close, last-tab fallback and per-tab UI state. Start with lightweight descriptors and the existing single workspace session rather than evaluating a full separate model per tab. Inactive data can be stale: validate/recompute on activation using current model/revision. Keep draft text project-owned; closing a source tab does not silently discard drafts. Retaining editor undo/scroll per file needs explicit ownership and tests, not merely rendering tab buttons. Table/matrix tabs remain project-wide unless an actual scoped contract is added. + +#### Navigation improvements in phase 3 + +Breadcrumbs and back/forward for supported exploration scopes, selection reveal, connection endpoint navigation and explicit Explore/View source actions. Use real correspondence and usage context; repeated usages must not collapse onto a type definition. Unsupported unfolding remains explained. Failed, cancelled or superseded navigation retains current work. These behaviours go beyond moving panels and should be reviewed independently. + +Defer arbitrary drag/drop docking, persistent exploration in portable bundles, cross-project search, new renderer families and simulated verification. Keep the first redesign bounded. + +## Verification gates + +Before UI workflow edits, inspect the running application and relevant browser tests. Extend `shell/layout.test.ts` for new schema, migration, invalid storage and restore rules. Use existing `workbench-chrome`, `source-editor`, `explorer`, diagnostics, requirements, document, authoring and recovery scenarios as preservation coverage rather than replacing them with screenshot-only tests. + +Prove panel transitions preserve exact source/drafts, undo, editor selection/scroll, camera and saved positions. Cover explicit Inspect versus selection, issue reveal, focus restoration, source minimum size, storage denial, malformed/old preferences and narrow-window transitions. Tab work adds stale-revision, close/reopen and per-file undo tests; exploration work retains real-engine scenarios and repeated-usage fixtures. + +Run `npm run check`, `npm run build`, appropriate real-engine functional browser checks and the visual project under the documented workflow. Inspect intentional screenshot changes at desktop and narrow widths, light and dark, plus forced-colour/reduced-motion and keyboard behaviour. Update baselines only after inspecting the intended changes. See the verification record for actual passing and pending checks. + +## Review boundaries + +Phase 1: four-section Explorer, model centre, source right, inspection/issues bottom, independent panel controls and preserved state. Reuse existing source/diagram/property content. Phase 2 adds muted styling and compact inspection; phase 3 adds tabs and supported model navigation. Most risk lies in state lifetime and revision-safe navigation, not CSS. diff --git a/docs/design/workbench-product-decisions.md b/docs/design/workbench-product-decisions.md index 26d9dec..3128af5 100644 --- a/docs/design/workbench-product-decisions.md +++ b/docs/design/workbench-product-decisions.md @@ -1,5 +1,7 @@ # SysML View Editor — Product, Navigation, and Toolbar Design Decisions +The [model-first redesign](redesign-implementation-plan.md) supersedes the panel composition and activity-rail decisions below. This document retains their original rationale. + **Status:** Agreed target design; implementation tracked in the [Product Design Update milestone](https://github.com/Open-MBEE/sysml_view_editor/milestone/1) **Version:** 1.1 — repository baseline, refreshed against merged PR #38 diff --git a/docs/testing.md b/docs/testing.md index 78dded1..3bd19f1 100644 --- a/docs/testing.md +++ b/docs/testing.md @@ -148,3 +148,17 @@ The critical recovery restore scenario now writes distinguishable successive dra The inherited-member critical regression imports a positioned project captured with the previous real engine. It checks exact inherited declaration/context identities, legacy IDs and displayed positions, keyboard Properties/source navigation, independent inherited-node movement, both view layouts, rejected draft preservation and fresh-context portable reopen. Automatic layout alone does not write presentation positions; the test explicitly moves nodes before requiring saved geometry. `explorer-sections.spec.ts` covers independent disclosure and sidebar state, separate New view activation, preserved drafts/camera/bundle and diagram-to-tree reveal without focus transfer. `workbench-chrome.spec.ts` exercises width transitions and actual minimum pane widths rather than viewport width alone, plus vertical-minimum canvas access and forced colors. `chrome-accessibility.spec.ts` records role/name/state snapshots and keyboard operation; an optional `WORKBENCH_ORCA_LOG` enables checks against an isolated real Orca utterance log. An accessibility tree alone does not prove a screen reader announced it correctly. Retain exact AT/browser versions, setup limitations and observed output in verification records. + +## Representative visual suite + +The permanent visual suite contains **61 scenarios and 87 baselines**, reduced from 114 scenarios and 163 baselines by consolidating repeated theme/width combinations. Each surface generally keeps a light desktop case and a dark compact case. Entry surfaces retain desktop, tablet and phone breakpoints; dedicated narrow header, appearance, nested assembly and forced-colour coverage remains. All distinct visual workflows remain represented, including diagrams, requirements, tables/matrix, documents, authoring/recovery dialogs, source controls and the content picker. + +This intentionally gives up exhaustive theme-by-width combinations for every surface. It does not remove functional assertions, relax screenshot tolerances or skip failing tests. CI still runs the complete retained visual project under the existing selection policy. Add a new visual case for a distinct state or a demonstrated gap rather than expanding every surface into a Cartesian matrix. + +## Focused visual checks during development + +Use the smallest visual set that exercises the changed surface, usually two to four representative comparisons. Add theme or viewport variants when the change specifically risks their behavior. Prefer focused functional assertions for state, source identity, focus and preservation; those do not require repeating screenshot matrices. Do not rerun broad visual coverage after documentation edits or an unrelated passing check. The existing full CI/release visual gate remains separate from this local feedback loop. + +## Mac/Safari smoke check after workspace navigation changes + +Local Linux Chromium results do not establish Safari behavior. Before release, record the macOS and Safari versions and check the built-in rover at desktop and narrow window sizes: open Project overview and confirm its omission notice; inspect a part, maximise inspection and Open source; confirm focus and selected source text; close/reopen Source and confirm old reveal requests do not steal focus. Exercise the workspace picker with keyboard navigation and Escape, and confirm an unapplied draft survives panel changes. Retain console errors and the exact steps for any failure. This checklist is outstanding until a real Mac/Safari run is recorded. diff --git a/docs/verification.md b/docs/verification.md index b9ea9ff..d9fdcdb 100644 --- a/docs/verification.md +++ b/docs/verification.md @@ -1,5 +1,63 @@ # Verification record +## PR #56 history review follow-up + +Recorded 2026-11-24 after review of `94f1de9`. The same-tab guard retained an outdated exploration request in model history when the representation changed. The current history entry now receives the updated descriptor while preserving forward entries. The real-engine regression failed before the fix: Back restored `tree` instead of `interconnection` (`sandbox/history-review/red.log`, retained trace). After the fix, all three focused scenarios passed: representation/history updates including an existing forward entry, independent cameras/project preservation, and failed-navigation draft/focus recovery (`green.log`). The expanded scenario also checks unchanged portable project data. + +`npm run check` passed formatting, architecture, TypeScript, 188 Vitest tests and 12 Node script tests; a fresh build passed with the existing chunk-size warning (`check.log`, `build.log`). No visual comparisons were rerun because rendering/styles and baseline registration are unchanged. These are local Chromium results; CI results are tracked separately on the PR. Engine pins, dependencies and saved formats are unchanged. + +## Follow-up cleanup and reduced visual suite (local branch) + +Recorded 2026-11-24 after `4e84687`. Local `.vercel/` metadata/output is now ignored without deleting it. Rover project exploration previously returned eight native implicit typing/subsetting relationships without source origins. The existing correspondence validator correctly rejected them. Temporary exploration now omits unlocatable relationships and exposes the diagnostic count in its header; all 194 declarations and 134 source-backed relationships remain, with all seven project files unchanged. Authored-view normalization, source guards, engine pins and portable format are unchanged. A minimized requirement-subject Go case failed before the fix and passed afterwards. + +Explicit source reveal now observes a visible, non-inert, nonzero-size editor instead of relying on a fixed two-frame delay. The original source-focus scenario failed once in twelve repetitions and once in a subsequent ten-case probe; more detailed focus instrumentation perturbed the timing. A controlled layout delay independently demonstrated the old focus failure. The visibility-observer correction passed 24 normal/delayed repetitions, but a new cancellation scenario exposed a stale pending reveal stealing focus after reopening Source. New pointer/keyboard input now cancels pending focus, and selection/file/project cleanup disconnects it. The final normal, delayed and cancelled scenarios passed **18 repetitions**, with exact selected text and unchanged project data assertions retained. Probe instrumentation is absent from production/tests; retained evidence is under ignored `sandbox/followup-review/`. + +`npm run check` passed formatting, architecture, TypeScript, **188 Vitest tests and 12 Node script tests** (`reduced-check.log`). The fresh build passed with the existing chunk-size warning; engine preparation also passed both Go bridge packages (`build-final.log`, `build-complete.log`). The initial targeted functional run passed 21 cases. After the final focus cancellation and omission notice, 16 targeted cases passed (`final-functional.log`) and 12 normal visual comparisons passed without baseline updates (`final-visual.log`). Four rover overview captures were reviewed at desktop/phone widths in light/dark, including the visible omission notice. That temporary four-case rover matrix was then consolidated into one semantic regression, which passed (`consolidated-rover.log`). The original whole-source/geometry preservation checks remain. + +At the user's request, the permanent visual matrix is reduced from **114 to 61 scenarios** and **163 to 87 baselines**. Repeated light-compact/dark-desktop combinations were removed while retaining all visual workflow families and explicit entry/phone/forced-colour cases. Screenshot tolerances and retained assertions are unchanged; no failing tests were skipped. Registration listing confirms 61 scenarios, and a static audit of screenshot templates confirms all 87 required baselines exist with no orphans (`visual-reduced-list.log`, `reduced-baseline-audit.json`). The 76 retired baselines have ignored local copies for audit. The retained six cases from the final twelve-case visual run already passed; the entire reduced 61-case suite was **not rerun** after pruning. Future local work uses focused visual checks rather than repeating broad matrices. + +These are local Linux Chromium results. Real Mac/Safari remains unavailable and outstanding, with a smoke checklist in `docs/testing.md`. Hosted CI, Firefox/WebKit and a dependency audit were not run. No dependencies were installed, and publication/CI results are tracked separately in the PR; no deployment is part of this change. + +## Consolidated workspace controls (local branch) + +Recorded 2026-11-24 on `feature/model-first-workbench`, after checkpoint commits `3ee8408`, `7485bf6` and `9894e8a`. Opened content now uses one workspace tab strip. A plus picker opens named views, documents, the Requirements table and Traceability matrix. Exploration uses one scope breadcrumb with an on-demand chooser and one representation selector; repeated headings, scope summaries and healthy-state notices are removed. Changing representation reuses the current scope tab while retaining separate camera identities. Explorer discovery, source editing and independently controlled panels remain available. + +The controls also transfer keyboard focus to opened content after the picker closes, restore the trigger after a failed opening, and reveal focused inspection controls when the dock opens on a phone. Regression evidence demonstrates the former duplicate selectors, permanent scope form, reduced-motion focus loss and duplicate tabs for the same scope. The broad run also exposed clipped phone inspection focus; both themes passed after correction. Route/resize scenarios already passed before the extra popup lifecycle safeguards, so those safeguards have no claimed failing-before result. + +`npm run check` passed formatting, architecture, TypeScript, **188 Vitest tests and 12 Node script tests**. The fresh production build passed with the existing chunk-size warning. **160 unique functional scenarios** have passing results across batches, including a final 38-case pass after focus and picker corrections. Existing scenarios now use the real content picker and explicitly open inspection where needed; source, draft, camera and geometry assertions remain. A failure-path helper was corrected to permit the deliberately rejected scope request rather than assuming success. After the final scope-tab change, a 21-case follow-up passed 20 cases; source focus after leaving maximised inspection failed once and passed an isolated retry without code or assertion changes (`source-reveal-retry.log`). Its intermittent failure remains undiagnosed. These are batch results, not a single uninterrupted full-suite run. + +**114 unique visual scenarios**, producing 163 captures, have passing candidate-generation results across batches. All 16 before/after contact sheets were inspected, with additional full-size phone/desktop captures in light and dark. The final tab-identity change passed the scope regression and all eight affected visual cases. Those eight captures were reviewed again; **128 reviewed baselines changed and 35 were unchanged**, with names and hashes in `accepted-visuals.json`. All **12 normal visual comparisons** for the content picker, composed header and exploration then passed without snapshot updates (`normal-comparison.log`); all 163 baseline hashes match the reviewed inventory. + +Evidence is retained under ignored `sandbox/controls-review/`, including `coverage.json`, `release-check.log`, `release-build.log`, `functional-retry.log`, `visual-retry.log`, the failing-before traces and reviewed visual inventories. These local files may be absent in another checkout. A separate manual rover project-overview request hit the unchanged source-correspondence guard; package exploration worked. That guard was not diagnosed or changed in this controls pass. + +These are local Chromium checks, not hosted CI, Safari/Firefox/WebKit or manual assistive-technology verification. No dependency changes, engine-pin changes, portable-schema changes, audit, push or deployment are included. The controls checkpoint is commit `4e84687`. + +## Colour and information hierarchy refinement (local branch) + +Recorded 2026-11-24 on `feature/model-first-workbench`. Explorer section headings now use quiet semantic tints and real counts, model-kind icon tiles distinguish packages/definitions/usages, and the active workspace has a readable title. Inspection gives the selected element a larger title and kind badge. Authored expressions are visible in value cards; declaration/provider metadata expands separately. Existing OpenMBEE assets, ABeeZee, palette controls and source guards are retained. Technical identities remain visible in the inspection summary. The duplicated workspace tabs/view selector/representation navigation remains a known follow-up, especially at phone widths. + +`npm run check` passed formatting, architecture, TypeScript, **188 Vitest tests and 12 Node script tests** (`sandbox/ui-hierarchy-review/check.log`). All **16 focused functional scenarios** have passing results across batches covering model-first panels, ownership-tree navigation, exact source values, draft/undo/camera preservation, minimum panes and forced-colour selection. An older tree scenario now explicitly opens inspection after selecting while Issues is active, and identifies the selected source-file tab by role. Its original identity, draft, source-file and project-geometry assertions remain. `functional-green.log` retains the eight passing panel cases; `functional-final.log` retains seven other passing cases plus the obsolete source-file locator failure; `model-tree-green.log` records all three corrected tree cases passing. + +All **110 visual scenarios** have passing candidate-generation results across batches (`visual-coverage.json`). Candidates were written to ignored storage before review. All 16 before/after sheets were inspected, plus full-size desktop/phone inspection and light/dark captures. Of 159 captures, **127 reviewed baselines changed and 32 were unchanged**; `accepted-visuals.json` records names and hashes. The first long runs were interrupted, and three overlapping visual scenarios failed during trace teardown because shared output storage was cleared by another run. All three passed with isolated output in `visual-retry.log`; these were test-artifact collisions, not evidence of an app defect. After acceptance, all **eight normal visual comparisons** for inspection values and Explorer passed without snapshot updates (`normal-comparison.log`). Final lint/architecture and TypeScript checks also passed (`final-lint.log`, `final-typecheck.log`). The full 110-scenario candidate run is distinct from this focused eight-scenario normal comparison. + +These are local Chromium results. Hosted CI and Safari/Firefox/WebKit were not run for this refinement. Dependency manifests, engine pins and portable project schema are unchanged. The implementation checkpoint is local commit `7485bf6`. No push, deployment or installable-app support is included. + +## Model-first workbench redesign (local branch) + +Recorded 2026-11-23 on `feature/model-first-workbench`. The three phases implement independent model-first panels and version-2 layout preferences; muted Explorer/bottom inspection styling; and workspace/source tabs with supported model navigation. The official logo, ABeeZee, theme tokens, engine pins, package dependencies and portable project schema are retained. A consolidated project menu and model search remain deferred; existing operations stay available. + +The normal fresh-build gate passed **175 scenarios in 17.2 minutes**: 65 functional scenarios, including all 36 critical workflows, and all 110 visual scenarios. The command was `npm run test:e2e -- --grep '@critical|model-first-layout.spec.ts|editor-tour.spec.ts|source-editor.spec.ts|panels.spec.ts|workbench-chrome.spec.ts|documents.spec.ts|visual.spec.ts'`; `final-gate.log` records exit 0 without snapshot updates. The test-managed server ran the production build and pinned-engine preparation, retaining the existing large-chunk warning. After the final request-lifetime fix, all 12 targeted scenarios passed in 1.9 minutes (`project-boundary-green.log`): all eight model-first cases, both source-header cases, IndexedDB recovery and native document/source navigation. This includes the new project-replacement regression; it is additional coverage beyond the earlier 175-case gate. + +`npm run check` passed formatting, architecture, TypeScript, 188 Vitest tests and 12 Node script tests on the final implementation (`check-complete.log`). Dependency manifests are unchanged; a registry audit was not rerun for this UI change. + +Visual candidates were generated separately in ignored storage. All 18 before/candidate sheets were inspected, with full-size desktop/narrow captures in both themes and forced colours. The final six phone/Source-minimum changes were individually inspected at full size. Of 159 captures, 143 reviewed baselines changed and 16 remained unchanged. `visual-review-final.json` records exact accepted names/hashes; the normal gate above compared those baselines. The corrected actual-minimum gestures retain an 80px Source editor and keep document links, representation controls and canvas controls reachable. Wrapped inspection tabs keep maximise/close hit targets inside a 390px viewport with Explorer open. + +Important regressions have retained failing and passing real-engine evidence: explicit requirement Inspect; source focus after leaving maximised inspection; Explorer maximisation and Source-only sizing after resizable constraints register; per-file draft/undo/selection/scroll; actual vertical minima; and phone inspection hit targets. `state-probe.log`, `scroll-probe.log`, `minimum-probe.log`, `minimum-green.log`, `inspection-controls-red.log` and `inspection-controls-green.log` retain the diagnosis. Scroll is measured before clipboard verification focuses the editor, since that helper can itself move the viewport. Production debug instrumentation was removed. A project replacement must not replay reveal requests consumed by its predecessor; `project-boundary-red.log` and the retained `project-boundary-before-fix/` trace show the failing boundary; the subsequent green run proves the replacement stays closed and cannot revive the earlier editor history. + +Session tabs do not store separate model selection snapshots. Table filters and table/document scrolling can reset when their surface remounts; they are not cached per tab. Source files retain exact-text-matching EditorState and a native CodeMirror scroll snapshot. Changed external text starts fresh editor state; successful project replacement creates a new editor session. Cameras are keyed by project, applied model hash and diagram identity. Browser preferences and tab/history state do not become portable project data. Narrow layouts stack Source; very short model panes scroll their tabs/navigation/header together, retaining canvas-control space. Four open panels can still leave limited reading space. + +Artifact names above are under ignored `sandbox/model-first-verification/` and may be absent in another checkout. These are local Chromium results, not hosted CI, Mac/Safari, Firefox/WebKit or comprehensive assistive-technology verification. No commit, push or deployment is implied. + ## OpenMBEE brand-guide integration (#53) Recorded 2026-11-23 on `feature/openmbee-brand-guide`, merging `develop` `697736e` into original brand head `2968796`. See the [independent review findings, correction and scope](research/openmbee-brand-review.md). Source/model contracts, dependency manifests/lockfile, engine pins and saved formats are unchanged relative to develop. The unsupported CC BY assertion for brand marks is corrected to the official guidelines/license-page exclusion; the historical Geist fallback rationale is retained accurately. diff --git a/engine-bridge/README.md b/engine-bridge/README.md index 763e123..2792785 100644 --- a/engine-bridge/README.md +++ b/engine-bridge/README.md @@ -25,7 +25,7 @@ Native requirement graphs retain the engine's selected subjects and related cont Toolkit also supplies completion, hover, definition, references and formatting queries through a separate disposable language worker. Queries use the complete draft source set, negotiate UTF-16 positions and normalize only supported results. The workbench rejects stale replies; completion and formatting edits remain unapplied draft changes until the normal source transaction validates them. Engine pins, prepared assets and provenance are unchanged. See [source assistance](../docs/architecture/source-assistance-recovery.md). -Read-only `Explore` uses the same validated applied-source revision as named-view evaluation, selects project-owned roots or one exact project declaration, and calls native `RenderExposed`. Project/package scopes support trees; explicit part definitions/usages additionally support bounded structural rendering. Its separate envelope carries the request instead of an authored view identity; it does not write source or saved presentation keys. +Read-only `Explore` uses the same validated applied-source revision as named-view evaluation, selects project-owned roots or one exact project declaration, and calls native `RenderExposed`. Project/package scopes support trees; explicit part definitions/usages additionally support bounded structural rendering. Its separate envelope carries the request instead of an authored view identity; it does not write source or saved presentation keys. Temporary trees omit native relationships without exact source locations and report the count in diagnostics; declarations and source-backed relationships retain their correspondence. This avoids inventing navigation targets for implicit typing/subsetting edges. Authored-view normalization is unchanged. Structural attribute compartments retain exact source slices for effective non-library attribute members through the pinned semantic model's `MembersOf` contract. They expose declarations rather than evaluated values. Native action/state artifacts are rendered by the workbench with existing correspondence and bounded graph validation; this adds no execution API or upstream pin change. diff --git a/engine-bridge/opensysml/evaluate_view.go b/engine-bridge/opensysml/evaluate_view.go index 01acccc..77a0046 100644 --- a/engine-bridge/opensysml/evaluate_view.go +++ b/engine-bridge/opensysml/evaluate_view.go @@ -205,7 +205,15 @@ func (cached *cachedModel) normalizedRendering(out EvaluatedView, selected []*sy } data.Nodes = nodes edges := data.Edges[:0] + omitted := 0 for _, edge := range data.Edges { + // Temporary exploration only publishes relationships with exact + // source correspondence. Native implicit typing/subsetting can + // have no origin; never invent a declaration for those edges. + if !authored && !edge.Origin.Located() { + omitted++ + continue + } if data.Kind == view.KindInterconnection { // Keep connectors declared in a visible occurrence, or explicitly // exposed. Do not leak a type's inherited internal connections. @@ -238,6 +246,9 @@ func (cached *cachedModel) normalizedRendering(out EvaluatedView, selected []*sy } } data.Edges = edges + if omitted > 0 { + out.Diagnostics = append(out.Diagnostics, fmt.Sprintf("Exploration omitted %d relationships without exact source locations.", omitted)) + } } // Keep version-1 IDs for every occurrence the legacy projection retained. // Allocate newly visible occurrences after them without reordering the native diff --git a/engine-bridge/opensysml/exploration_test.go b/engine-bridge/opensysml/exploration_test.go index c8aef47..cb53b52 100644 --- a/engine-bridge/opensysml/exploration_test.go +++ b/engine-bridge/opensysml/exploration_test.go @@ -74,3 +74,37 @@ func TestStudioExploration(t *testing.T) { t.Fatalf("%v", rejected) } } + +// Requirement subjects create native implicit typing/subsetting edges without +// declaration origins. Exploration must retain source-backed content without +// publishing those edges as navigable source relationships. +func TestStudioExplorationRequirementSubjects(t *testing.T) { + server, err := New("v0.12.0") + if err != nil { + t.Fatal(err) + } + call := func(method string, params any) map[string]any { + t.Helper() + raw, _ := json.Marshal(params) + body, err := server.Call(context.Background(), method, raw) + if err != nil { + t.Fatal(err) + } + var out map[string]any + if err := json.Unmarshal(body, &out); err != nil { + t.Fatal(err) + } + return out + } + parsed := call("ParseSources", map[string]any{"documents": []any{map[string]any{"name": "requirements.sysml", "content": "package P { part def Battery; part battery : Battery; requirement def Reserve { subject unit : Battery; } requirement reserve : Reserve { subject unit = battery; } }"}}, "strictConformance": true}) + result := call("Explore", map[string]any{"modelHash": parsed["modelHash"], "request": map[string]any{"scope": map[string]any{"kind": "project"}, "representation": "tree"}}) + if result["status"] != "complete" || result["renderStatus"] != "available" { + t.Fatalf("%v", result) + } + for _, raw := range result["correspondence"].([]any) { + item := raw.(map[string]any) + if item["subject"].(map[string]any)["origin"] == nil { + t.Fatalf("Missing exact source origin: %v", item) + } + } +} diff --git a/src/lib/ui/diagram.css b/src/lib/ui/diagram.css index 00580a6..39b9f82 100644 --- a/src/lib/ui/diagram.css +++ b/src/lib/ui/diagram.css @@ -321,11 +321,6 @@ width: 170px; max-width: 100%; } -.diagram-exploration - .exploration-scope-field - [data-slot='native-select-wrapper'] { - width: 270px; -} .diagram-exploration .exploration-field select { max-width: none; } @@ -333,30 +328,6 @@ align-items: end; width: 100%; } -.exploration-current { - flex-basis: 100%; - display: flex; - align-items: baseline; - gap: 5px 10px; - flex-wrap: wrap; - min-width: 0; - padding-top: 3px; - font-size: 12px; -} -.exploration-current > span { - color: var(--sysml-muted); - font-size: 11px; -} -.exploration-current strong { - overflow-wrap: anywhere; - min-width: 0; -} -.diagram-exploration .diagram-context-meta { - max-width: none; - flex-direction: row; - flex-wrap: wrap; - gap: 6px 12px; -} .exploration-leaf .structure-heading { border-bottom: 0; diff --git a/src/lib/ui/requirements-data.css b/src/lib/ui/requirements-data.css index a6c40df..dfa4f8e 100644 --- a/src/lib/ui/requirements-data.css +++ b/src/lib/ui/requirements-data.css @@ -5,20 +5,6 @@ min-width: 0; min-height: 0; } -.model-data-tabs { - display: flex; - gap: 4px; - align-items: center; - flex-wrap: wrap; - min-width: 0; - max-width: 100%; -} -.model-data-tabs button { - max-width: 100%; - height: auto; - min-height: 24px; - white-space: normal; -} .model-data-diagram { display: flex; flex: 1; @@ -136,10 +122,6 @@ align-items: center; gap: 6px 10px; } -.model-data-tabs > strong { - font-size: 12px; -} -.model-representation-label, .model-header-status, .model-header-scope { font-size: 11px; diff --git a/src/lib/ui/tools.css b/src/lib/ui/tools.css index 2f764a0..593cbad 100644 --- a/src/lib/ui/tools.css +++ b/src/lib/ui/tools.css @@ -358,3 +358,223 @@ min-height: 32px; text-align: left; } + +/* Compact Explorer and horizontally grouped inspection use existing brand tokens. */ +.explorer { + padding: 8px; + border-right: 0; +} +.explorer section + section { + margin-top: 10px; + padding-top: 8px; + border-top: 1px solid var(--sysml-border); +} +.explorer button { + min-height: 28px; + padding: 5px 8px; +} +.explorer .section-heading { + padding-bottom: 4px; +} +.explorer .active { + box-shadow: inset 2px 0 var(--sysml-accent); +} +.inspection-dock { + container-type: inline-size; +} +.inspection-dock .properties { + display: grid; + grid-template-columns: minmax(220px, 1fr) minmax(260px, 1fr); + align-items: start; + gap: 16px; + padding: 12px 16px; + border-left: 0; +} +.inspection-dock .properties > .inspection-summary:only-child { + grid-column: 1 / -1; +} +.inspection-summary { + min-width: 0; +} +.inspection-dock .properties h2 { + margin: 0 0 6px; +} +.inspection-dock .properties h3 { + font-size: 15px; +} +.inspection-dock .properties dl { + display: grid; + grid-template-columns: auto minmax(0, 1fr); + gap: 4px 12px; + margin: 8px 0; +} +.inspection-dock .properties dt, +.inspection-dock .properties dd { + margin: 0; +} +.inspection-dock .properties dl > [role='group'] { + grid-column: 1 / -1; +} +.inspection-dock .properties p { + margin: 4px 0 8px; +} +.inspection-dock .properties button { + width: auto; + margin: 2px 6px 2px 0; + min-height: 28px; +} +.inspection-dock .properties form { + margin: 8px 0; + padding-top: 8px; +} +.inspection-edit summary { + font-size: 12px; + cursor: pointer; + margin: 6px 0; +} +.inspection-relationships { + padding: 12px 16px; + font-size: 12px; +} +.inspection-relationships > p { + color: var(--sysml-muted); + margin: 0 0 8px; +} +.inspection-relationships ul { + list-style: none; + margin: 0; + padding: 0; + display: grid; + grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); + gap: 8px; +} +.inspection-relationships li { + border: 1px solid var(--sysml-border); + border-radius: var(--sysml-control-radius); + padding: 8px; + background: var(--sysml-surface); + min-width: 0; +} +.inspection-relationships li > div { + display: flex; + align-items: center; + flex-wrap: wrap; +} +.inspection-relationships button { + height: auto; + white-space: normal; + overflow-wrap: anywhere; + text-align: left; +} +@container (max-width: 560px) { + .inspection-dock .properties { + grid-template-columns: minmax(0, 1fr); + } +} + +/* Quiet category colour; cyan remains the selection signal. */ +.explorer-section { + --section-tone: var(--sysml-source); +} +.explorer-section[data-section='views'] { + --section-tone: var(--sysml-structure); +} +.explorer-section[data-section='documents'] { + --section-tone: var(--sysml-parameters); +} +.explorer-section[data-section='model'] { + --section-tone: var(--sysml-entities); +} +.explorer .section-heading { + background: color-mix(in srgb, var(--section-tone) 7%, var(--sysml-surface)); + border-radius: 6px; + padding: 3px 5px 3px 0; + margin-bottom: 5px; +} +.explorer .section-heading h2 > button > svg:nth-child(2) { + color: var(--section-tone); +} +.section-count { + font-size: 11px; + color: var(--sysml-muted); + background: var(--sysml-surface); + border: 1px solid var(--sysml-border); + border-radius: 5px; + padding: 1px 5px; + font-variant-numeric: tabular-nums; +} +.model-tree-kind { + border-radius: 4px; + background: var(--sysml-subtle); + padding: 3px; + flex-shrink: 0; +} +.model-tree-kind[data-kind='package'] { + background: color-mix(in srgb, var(--sysml-source) 12%, var(--sysml-surface)); +} +.model-tree-kind[data-kind$='Def'] { + background: var(--sysml-definition-bg); + color: var(--sysml-sequence); +} +.model-tree-kind[data-kind$='Usage'] { + background: var(--sysml-usage-bg); + color: var(--sysml-entities); +} +.model-tree-detail { + color: var(--sysml-muted); + font-size: 11px; +} +.inspection-dock .inspection-summary > h3 { + font-size: 20px; + margin: 4px 0 8px; +} +.inspection-dock .inspection-summary > .kind { + display: inline-block; + padding: 3px 7px; + border-radius: 5px; + background: var(--sysml-usage-bg); + border: 1px solid var(--sysml-border); + text-transform: capitalize; + font-size: 11px; +} +.inspection-summary > dl { + font-size: 11px; + color: var(--sysml-muted); +} +.inspection-dock .source-values { + margin-top: 0; + padding-top: 0; + border-top: 0; +} +.source-value-card { + padding: 10px 12px; + margin: 10px 0; + border: 1px solid var(--sysml-border); + border-left: 3px solid + color-mix(in srgb, var(--sysml-entities) 45%, var(--sysml-border)); + border-radius: 6px; + background: color-mix( + in srgb, + var(--sysml-usage-bg) 40%, + var(--sysml-surface) + ); +} +.source-value-card h4 { + font-size: 13px; + margin: 0 0 6px; + overflow-wrap: anywhere; +} +.source-value-label { + font-size: 11px; + color: var(--sysml-muted); +} +.source-value-card > pre { + font-size: 16px; + margin: 5px 0 10px; + color: var(--sysml-text); +} +.source-value-card details { + border-bottom: 0; + padding: 4px 0; + font-size: 11px; +} diff --git a/src/lib/ui/workbench.css b/src/lib/ui/workbench.css index 127c1b3..924555c 100644 --- a/src/lib/ui/workbench.css +++ b/src/lib/ui/workbench.css @@ -29,12 +29,12 @@ min-height: 600px; } .topbar { - height: 62px; + height: 54px; flex-shrink: 0; display: flex; align-items: center; - gap: 14px; - padding: 0 22px; + gap: 10px; + padding: 0 14px; border-bottom: 1px solid var(--sysml-border); background: var(--sysml-surface); } @@ -52,7 +52,7 @@ grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; flex-shrink: 0; - min-height: 48px; + min-height: 38px; padding: 4px 8px; border-bottom: 1px solid var(--sysml-border); background: var(--sysml-surface); @@ -117,30 +117,6 @@ .source-action-balance { min-width: 0; } -.panel-rail { - display: flex; - flex: 0 0 32px; - width: 32px; - align-items: center; - flex-direction: column; - padding-top: 4px; - background: var(--sysml-surface); -} -.activity-rail { - display: flex; - flex: 0 0 48px; - width: 48px; - align-items: center; - flex-direction: column; - padding-top: 4px; - background: var(--sysml-surface); - border-right: 1px solid var(--sysml-border); -} -.activity-rail button[aria-pressed='true'] { - background: var(--sysml-active-bg); - color: var(--sysml-active-text); - border-left: 3px solid currentColor; -} @container (max-width: 410px) { .source-command-grid { display: flex; @@ -353,3 +329,268 @@ outline: 2px solid Highlight; } } + +/* Model-first shell: source right, contextual inspection below the canvas. */ +.panel-controls { + display: flex; + align-items: center; + gap: 4px; +} +.panel-controls button[aria-pressed='true'] { + background: var(--sysml-active-bg); + color: var(--sysml-active-text); +} +.inspection-dock > [role='tabpanel'] { + flex: 1; + min-height: 0; + overflow: auto; +} +.inspection-dock > [role='tabpanel'][hidden] { + display: none; +} +.panel-header [role='tablist'] { + display: flex; + flex: 1; + flex-wrap: wrap; + min-width: 0; + gap: 4px; +} +.panel-header [role='tab'] { + max-width: 100%; + min-height: 24px; + height: auto; + white-space: normal; +} +.panel-header-actions { + flex-shrink: 0; +} +.panel-header [role='tab'][aria-selected='true'] { + box-shadow: inset 0 -2px var(--sysml-accent); +} +[data-slot='resizable-handle'].workbench-resizer { + flex-basis: 1px; + min-width: 1px; +} +[data-slot='resizable-handle'].workbench-resizer[aria-orientation='horizontal'] { + min-height: 1px; + height: 1px; + flex-basis: 1px; +} +[data-slot='resizable-handle'].workbench-resizer { + width: 1px; + background: var(--sysml-border); +} +@media (max-width: 600px) { + .topbar { + height: auto; + min-height: 54px; + flex-wrap: wrap; + padding: 8px 10px; + } + .topbar nav { + flex-basis: 100%; + justify-content: flex-end; + } +} +.content-tabs { + display: flex; + flex-shrink: 0; + min-height: 34px; + overflow-x: auto; + border-bottom: 1px solid var(--sysml-border); + background: var(--sysml-subtle); +} +.content-tab { + display: flex; + align-items: center; + flex-shrink: 0; + max-width: 260px; + border-right: 1px solid var(--sysml-border); +} +.content-tab > [role='tab'] { + max-width: 220px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} +.content-tab[data-active='true'] { + background: var(--sysml-surface); + box-shadow: inset 0 -2px var(--sysml-accent); +} +.content-tab > button:last-child { + flex-shrink: 0; +} +.model-navigation { + display: flex; + align-items: center; + gap: 4px; + flex-shrink: 0; + flex-wrap: wrap; + padding: 4px 8px; + border-bottom: 1px solid var(--sysml-border); + color: var(--sysml-muted); + font-size: 12px; +} +.model-navigation > span { + overflow-wrap: anywhere; +} + +@media (max-width: 600px) { + .workspace-toolbar { + display: flex; + justify-content: space-between; + gap: 8px; + } + .workspace-toolbar > span { + display: none; + } +} + +@media (forced-colors: active) { + .content-tab[data-active='true'], + .panel-header [role='tab'][aria-selected='true'], + .panel-controls button[aria-pressed='true'] { + border-bottom: 3px solid Highlight; + } +} + +/* Keep navigation and model commands scrollable together in very short panes. */ +.model-workspace-chrome { + flex-shrink: 0; + min-height: 0; + max-height: 60%; + overflow: auto; +} +.model-workspace-chrome .model-pane-header { + max-height: none; + overflow: visible; +} + +/* One content strip and a compact, contextual action toolbar. */ +.workspace-tabbar { + display: flex; + align-items: center; + min-width: 0; + background: var(--sysml-subtle); + border-bottom: 1px solid var(--sysml-border); + padding-right: 6px; +} +.workspace-tabbar > .content-tabs { + flex: 0 1 auto; + min-width: 0; + border-bottom: 0; +} +.workspace-tabbar > button { + flex-shrink: 0; +} +.model-pane-header .model-navigation { + padding: 0; + border: 0; + background: transparent; +} +.model-pane-header .model-header-status, +.model-pane-header .model-header-scope { + margin: 0; +} +.model-pane-context:not([hidden]) { + display: contents; +} +.model-pane-context .diagram-target-controls:not(.diagram-exploration) { + flex: 1; + min-width: 0; +} +.model-pane-context .diagram-context { + display: flex; + flex-wrap: wrap; + align-items: center; + gap: 8px; +} +.model-pane-context .diagram-context-meta { + margin: 0; + font-size: 11px; + color: var(--sysml-muted); +} +.workspace-opener { + max-height: min(70vh, 540px); + overflow: auto; + background: var(--sysml-surface); + color: var(--sysml-text); + border-color: var(--sysml-border); +} +.workspace-opener h2 { + font-size: 14px; + margin: 0 0 12px; +} +.workspace-opener h3 { + font-size: 11px; + color: var(--sysml-muted); + margin: 12px 0 4px; +} +.workspace-opener button { + display: flex; + width: 100%; + justify-content: flex-start; + height: auto; + min-height: 30px; + white-space: normal; + text-align: left; + overflow-wrap: anywhere; +} +.workspace-opener p { + font-size: 12px; + color: var(--sysml-muted); +} + +/* Exploration uses a single scope breadcrumb and one view-type control. */ +.model-pane-context .diagram-target-controls { + min-width: 0; + max-width: 100%; +} +.model-pane-context .diagram-exploration .diagram-context { + align-items: center; + width: auto; +} +.exploration-scope-picker { + min-width: 0; + max-width: min(380px, 100%); +} +.exploration-scope-picker .scope-trigger { + display: flex; + align-items: baseline; + max-width: 100%; + height: auto; + min-height: 28px; + white-space: normal; + text-align: left; + gap: 6px; +} +.scope-trigger strong { + min-width: 0; + overflow-wrap: anywhere; + font-weight: 400; +} +.scope-trigger .scope-kind { + color: var(--sysml-muted); + font-size: 10px; + flex-shrink: 0; +} +.scope-trigger > svg { + align-self: center; + flex-shrink: 0; + width: 12px; + height: 12px; +} +.scope-picker-content { + max-width: calc(100vw - 16px); + background: var(--sysml-surface); + color: var(--sysml-text); + border-color: var(--sysml-border); +} +.scope-picker-content label { + display: block; + font-size: 12px; + margin-bottom: 8px; +} +.scope-picker-content [data-slot='native-select-wrapper'] { + width: 100%; +} diff --git a/src/lib/workbench/diagrams/Diagram.tsx b/src/lib/workbench/diagrams/Diagram.tsx index 0dbce68..98e259a 100644 --- a/src/lib/workbench/diagrams/Diagram.tsx +++ b/src/lib/workbench/diagrams/Diagram.tsx @@ -20,6 +20,7 @@ import { type Node, type Edge, type Rect, + type Viewport, } from '@xyflow/react'; import '@xyflow/react/dist/style.css'; import ELK from 'elkjs/lib/elk.bundled.js'; @@ -35,23 +36,20 @@ function FitAvailableSpace({ layoutMode, bounds, readableEntry, + restored = false, }: { padding: number; layoutMode: string; bounds?: Rect; readableEntry: boolean; + restored?: boolean; }) { const width = useStore((state) => state.width); const height = useStore((state) => state.height); const initialized = useNodesInitialized(); const fit = useDiagramFit(padding, bounds, readableEntry); - const fitted = useRef(false); - const previousMode = useRef(layoutMode); + const fitted = useRef(restored); useEffect(() => { - if (previousMode.current !== layoutMode) { - previousMode.current = layoutMode; - fitted.current = false; - } if ( fitted.current || layoutMode === 'code' || @@ -93,12 +91,14 @@ interface Props { busy: boolean; presentation?: ViewPresentation; disabled: boolean; - onSelect: (symbol: string) => void; + onSelect: (symbol: string, inspect?: boolean) => void; selectedSymbol?: string; onMove: (positions: Record+ {view.diagnostics.join(' ')} +
+ )} {!exploration && view?.artifact?.kind === 'interconnection' && (