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.

- The editor showing the Inspection rover architecture, with files and named views on the left and an Inspector on the right + The editor showing the Inspection rover architecture, with files and named views in the left Explorer and the model in the central workspace

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) => void; layoutMode: 'code' | 'split' | 'diagram'; /** Read-only rendering inside another surface: no view selector, actions or geometry edits. */ embedded?: boolean; + initialViewport?: Viewport; + onCamera?: (viewport: Viewport) => void; } export function Diagram({ exploration, @@ -113,6 +113,8 @@ export function Diagram({ onMove, layoutMode, embedded = false, + initialViewport, + onCamera, }: Props) { const [nodes, setNodes] = useState([]), [edges, setEdges] = useState([]), @@ -393,7 +395,9 @@ export function Diagram({ ) onSelect(edge.id); }} - fitView + defaultViewport={initialViewport} + onMoveEnd={(_event, viewport) => onCamera?.(viewport)} + fitView={!initialViewport} fitViewOptions={{ padding: exploration || view?.artifact?.kind === 'requirement' @@ -423,6 +427,7 @@ export function Diagram({ }} > void; view: EvaluatedView | null; - views: readonly { id: string; name: string }[]; busy: boolean; disabled: boolean; - onOpenView: (id: string) => void; onCreatePart: () => void; onConnectPorts: () => void; } export function DiagramTargetControls({ + active, exploration, explorationFocus, elements, onExplore, view, - views, busy, disabled, - onOpenView, onCreatePart, onConnectPorts, }: Props) { - const scopeControl = useRef(null); const representationControl = useRef(null); useLayoutEffect(() => { - if (!busy && explorationFocus) - (explorationFocus === 'scope' - ? scopeControl - : representationControl - ).current?.focus({ preventScroll: true }); + if (!busy && explorationFocus === 'representation') + representationControl.current?.focus({ preventScroll: true }); }, [busy, explorationFocus]); - const explorationSubject = - exploration?.scope.kind !== 'project' - ? exploration?.scope.subject - : undefined; - const viewNames = new Map(); - for (const item of views) - viewNames.set(item.name, (viewNames.get(item.name) ?? 0) + 1); return (
- - event.target.value - ? onOpenView(event.target.value) - : onExplore?.({ - scope: { kind: 'project' }, - representation: 'tree', - }) - } - > - Explore model - {views.map((item) => ( - - {viewNames.get(item.name) === 1 ? item.name : item.id} - - ))} - {exploration && ( <> -
- - { - const subject = event.target.value; - const item = elements.find((item) => item.id === subject); - onExplore?.( - !subject - ? { scope: { kind: 'project' }, representation: 'tree' } - : item?.kind === 'package' - ? { - scope: { kind: 'package', subject }, - representation: 'tree', - } - : { - scope: { kind: 'element', subject }, - representation: 'tree', - }, - 'scope', - ); - }} - > - - Project overview - - {elements - .filter((item) => - ['package', 'partDef', 'partUsage'].includes(item.kind), - ) - .map((item) => ( - - {item.id} · {explorationKindLabel(item.kind)} - - ))} - -
+ { + const item = elements.find((item) => item.id === subject); + onExplore( + !subject + ? { scope: { kind: 'project' }, representation: 'tree' } + : item?.kind === 'package' + ? { + scope: { kind: 'package', subject }, + representation: 'tree', + } + : { + scope: { kind: 'element', subject }, + representation: 'tree', + }, + 'scope', + ); + }} + />
-
-
- - {exploration.scope.kind === 'project' - ? 'Project' - : explorationKindLabel( - elements.find((item) => item.id === explorationSubject) - ?.kind ?? exploration.scope.kind, - )} - - - {exploration.scope.kind === 'project' - ? 'Project overview' - : exploration.scope.subject} - -
)} -
- {view?.artifact && ( - - {view.artifact.kind === 'interconnection' - ? 'Structure' - : view.artifact.kind === 'requirement' - ? 'Requirements' - : view.artifact.kind === 'action' - ? 'Mission flow' - : view.artifact.kind === 'state' - ? 'Operating states' - : view.artifact.kind === 'tree' - ? exploration - ? 'Ownership overview' - : 'Overview tree' - : 'Named view'} - - )} -
+ {!exploration && ( +
+ {view?.artifact && ( + + {view.artifact.kind === 'interconnection' + ? 'Structure' + : view.artifact.kind === 'requirement' + ? 'Requirements' + : view.artifact.kind === 'action' + ? 'Mission flow' + : view.artifact.kind === 'state' + ? 'Operating states' + : view.artifact.kind === 'tree' + ? exploration + ? 'Ownership overview' + : 'Overview tree' + : 'Named view'} + + )} +
+ )}
+ {exploration && !!view?.diagnostics.length && ( +

+ {view.diagnostics.join(' ')} +

+ )} {!exploration && view?.artifact?.kind === 'interconnection' && (
+ + + + { + setOpen(false); + onSelect(event.target.value); + }} + > + Project overview + {elements + .filter((item) => + ['package', 'partDef', 'partUsage'].includes(item.kind), + ) + .map((item) => ( + + {item.id} · {explorationKindLabel(item.kind)} + + ))} + + + +
+ ); +} diff --git a/src/lib/workbench/diagrams/RequirementNode.tsx b/src/lib/workbench/diagrams/RequirementNode.tsx index b304cf2..fe45833 100644 --- a/src/lib/workbench/diagrams/RequirementNode.tsx +++ b/src/lib/workbench/diagrams/RequirementNode.tsx @@ -60,7 +60,7 @@ export function RequirementNode({ data }: NodeProps) { aria-label={`Inspect ${item.shortName ? item.shortName + ' ' : ''}${item.name}`} onClick={(event) => { event.stopPropagation(); - select(item.id); + select(item.id, true); }} > Inspect details diff --git a/src/lib/workbench/diagrams/StructureNode.tsx b/src/lib/workbench/diagrams/StructureNode.tsx index d7d347b..02c4c2d 100644 --- a/src/lib/workbench/diagrams/StructureNode.tsx +++ b/src/lib/workbench/diagrams/StructureNode.tsx @@ -12,9 +12,9 @@ import { type StructureNode as StructureNodeType, } from './structure'; -export const SelectDiagramSymbol = createContext<(symbol: string) => void>( - () => {}, -); +export const SelectDiagramSymbol = createContext< + (symbol: string, inspect?: boolean) => void +>(() => {}); export function StructureNode({ data }: NodeProps) { const select = useContext(SelectDiagramSymbol); diff --git a/src/lib/workbench/explorer/Explorer.tsx b/src/lib/workbench/explorer/Explorer.tsx index 1422e21..8e43aa1 100644 --- a/src/lib/workbench/explorer/Explorer.tsx +++ b/src/lib/workbench/explorer/Explorer.tsx @@ -31,7 +31,11 @@ export function Explorer({ const documents = documentEntries(state.model?.documents); return (
{artifactNode && ( void; +}) { + const node = view?.artifact?.nodes.find( + (item) => + item.id === symbol || item.ports?.some((port) => port.id === symbol), + ); + const symbols = new Set([ + symbol, + ...(node && node.id === symbol + ? (node.ports?.map((port) => port.id) ?? []) + : []), + ]); + const edges = + view?.artifact?.edges.filter( + (edge) => + symbols.has(edge.from) || + symbols.has(edge.to) || + (!!edge.fromPort && symbols.has(edge.fromPort)) || + (!!edge.toPort && symbols.has(edge.toPort)), + ) ?? []; + function name(id: string) { + return ( + view?.correspondence.find((item) => item.symbol === id)?.subject + .qualifiedName ?? + view?.artifact?.nodes.find((item) => item.id === id)?.name ?? + view?.artifact?.nodes + .flatMap((item) => item.ports ?? []) + .find((item) => item.id === id)?.name ?? + id + ); + } + return ( +
+

+ Declared relationships shown in the current view. No execution results + are reported. +

+ {!symbol ? ( +

Select an element to browse its relationships.

+ ) : !edges.length ? ( +

+ No relationships for this selection are exposed in the current view. +

+ ) : ( +
    + {edges.map((edge, index) => ( +
  • + + {edge.kind} + {edge.label ? ` · ${edge.label}` : ''} + +
    + + + +
    +
  • + ))} +
+ )} +
+ ); +} diff --git a/src/lib/workbench/properties/SourceValues.tsx b/src/lib/workbench/properties/SourceValues.tsx index 1dd5e8e..7c38a92 100644 --- a/src/lib/workbench/properties/SourceValues.tsx +++ b/src/lib/workbench/properties/SourceValues.tsx @@ -26,34 +26,39 @@ export function SourceValues({ ? value.provider.origin : row.subject.origin; return ( -
- {row.name || 'Unnamed attribute'} -
-
Declaration
-
{row.subject.qualifiedName ?? row.subject.id}
- {row.type && ( - <> -
Type
-
{row.type}
- - )} - {value.status === 'available' && ( - <> -
- {value.isInitial - ? 'Initial expression' - : value.isDefault - ? 'Default expression' - : 'Authored expression'} -
-
-
{value.expression}
-
-
Value declared by
-
{value.provider.qualifiedName ?? value.provider.id}
- - )} -
+
+

{row.name || 'Unnamed attribute'}

+ {value.status === 'available' && ( + <> + + {value.isInitial + ? 'Initial expression' + : value.isDefault + ? 'Default expression' + : 'Authored expression'} + +
{value.expression}
+ + )} +
+ Declaration details +
+
Declaration
+
{row.subject.qualifiedName ?? row.subject.id}
+ {row.type && ( + <> +
Type
+
{row.type}
+ + )} + {value.status === 'available' && ( + <> +
Value declared by
+
{value.provider.qualifiedName ?? value.provider.id}
+ + )} +
+
{value.status === 'absent' && (

No declared expression found. Bindings and evaluated values are @@ -73,7 +78,7 @@ export function SourceValues({ : 'Open attribute source'}{' '} for {row.name || 'unnamed attribute'} -

+ ); })} diff --git a/src/lib/workbench/shell/ActivityRail.tsx b/src/lib/workbench/shell/ActivityRail.tsx deleted file mode 100644 index 9d3502a..0000000 --- a/src/lib/workbench/shell/ActivityRail.tsx +++ /dev/null @@ -1,29 +0,0 @@ -import type { Ref } from 'react'; -import { Folder } from 'lucide-react'; -import { IconButton } from '$lib/ui/IconButton'; - -export function ActivityRail({ - expanded, - onToggle, - buttonRef, -}: { - expanded: boolean; - onToggle: () => void; - buttonRef: Ref; -}) { - return ( - - ); -} diff --git a/src/lib/workbench/shell/ContentTabs.tsx b/src/lib/workbench/shell/ContentTabs.tsx new file mode 100644 index 0000000..4300d06 --- /dev/null +++ b/src/lib/workbench/shell/ContentTabs.tsx @@ -0,0 +1,114 @@ +import { useLayoutEffect, useRef } from 'react'; +import { X } from 'lucide-react'; +import { Button } from '$lib/ui/primitives/button'; +import { IconButton } from '$lib/ui/IconButton'; +export interface ContentTab { + id: string; + label: string; +} +export function ContentTabs({ + label, + tabs, + active, + disabled, + focusRequest, + onSelect, + onClose, +}: { + label: string; + tabs: readonly ContentTab[]; + active?: string; + disabled?: boolean; + focusRequest?: number; + onSelect: (id: string) => void; + onClose: (id: string) => void; +}) { + const list = useRef(null); + const focusedRequest = useRef(focusRequest); + useLayoutEffect(() => { + if (focusRequest === focusedRequest.current) return; + const selected = list.current?.querySelector( + '[role="tab"][aria-selected="true"]', + ); + if (selected) { + selected.focus(); + focusedRequest.current = focusRequest; + } + }, [focusRequest, tabs, active]); + const closing = useRef(null); + useLayoutEffect(() => { + if (!closing.current || tabs.some((tab) => tab.id === closing.current)) + return; + closing.current = null; + list.current + ?.querySelector('[role="tab"][aria-selected="true"]') + ?.focus(); + }, [tabs, active]); + return ( +
{ + if (!['ArrowLeft', 'ArrowRight', 'Home', 'End'].includes(event.key)) + return; + const buttons = [ + ...event.currentTarget.querySelectorAll( + '[role="tab"]:not(:disabled)', + ), + ]; + const index = buttons.indexOf( + document.activeElement as HTMLButtonElement, + ); + if (index < 0 || !buttons.length) return; + const next = + event.key === 'Home' + ? 0 + : event.key === 'End' + ? buttons.length - 1 + : (index + + (event.key === 'ArrowRight' ? 1 : -1) + + buttons.length) % + buttons.length; + event.preventDefault(); + buttons[next]?.click(); + buttons[next]?.focus(); + }} + > + {tabs.map((tab) => ( +
+ + { + closing.current = tab.id; + onClose(tab.id); + }} + /> +
+ ))} +
+ ); +} diff --git a/src/lib/workbench/shell/EditorTour.tsx b/src/lib/workbench/shell/EditorTour.tsx index 9421cc5..ba67d07 100644 --- a/src/lib/workbench/shell/EditorTour.tsx +++ b/src/lib/workbench/shell/EditorTour.tsx @@ -11,7 +11,7 @@ import { const steps = [ { title: 'Find your files and views', - text: 'Use the Explorer activity button to show or hide the sidebar. Its Files, Views and Model sections fold independently; their actions stay separate.', + text: 'Use the header Explorer toggle to show or hide the sidebar. Files, Views, Documents and Model fold independently; their actions stay separate.', target: '[data-tour-explorer]', hidden: 'Choose Show Explorer to reopen the panel.', }, diff --git a/src/lib/workbench/shell/ModelPaneHeader.tsx b/src/lib/workbench/shell/ModelPaneHeader.tsx index c0bd9f9..0bca28b 100644 --- a/src/lib/workbench/shell/ModelPaneHeader.tsx +++ b/src/lib/workbench/shell/ModelPaneHeader.tsx @@ -1,27 +1,27 @@ import { supportsDiagram } from '../diagrams/supports-diagram'; import type { ReactNode } from 'react'; -import { Network, Table2, Grid3X3, FileText } from 'lucide-react'; -import { Button } from '$lib/ui/primitives/button'; import type { WorkspaceState } from '$lib/workspace/createWorkspace'; import type { EvaluatedView } from '$lib/workspace/views'; export function ModelPaneHeader({ + title, representation, - onRepresentation, + navigation, state, view, - exploring, children, + actions, }: { + title?: string; representation: 'diagram' | 'table' | 'matrix' | 'document'; - onRepresentation: (mode: 'diagram' | 'table' | 'matrix' | 'document') => void; + navigation?: ReactNode; state: Pick< WorkspaceState, 'busy' | 'unapplied' | 'model' | 'renderedDocument' >; view: EvaluatedView | null; - exploring: boolean; children: ReactNode; + actions?: ReactNode; }) { return (
+

{title || 'Model'}

+ {navigation} + {(!state.model || + state.busy || + state.unapplied || + (representation === 'diagram' && view && !supportsDiagram(view))) && ( +

+ {state.busy + ? state.model + ? 'Updating model… · showing applied revision' + : 'Updating model…' + : !state.model + ? 'No applied model' + : state.unapplied + ? 'Applied revision · draft pending' + : 'Applied model'} + {representation === 'diagram' && + view && + !supportsDiagram(view) && + ' · Rendering unavailable'} +

+ )} + {actions} + {(representation === 'table' || representation === 'matrix') && ( +

Project-wide requirements

+ )}
-

- {state.busy - ? state.model - ? 'Updating model… · showing applied revision' - : 'Updating model…' - : !state.model - ? 'No applied model' - : state.unapplied - ? 'Applied revision · draft pending' - : 'Applied model'} - {representation === 'diagram' && - exploring && - ' · Temporary exploration'} - {representation === 'diagram' && - view && - !supportsDiagram(view) && - ' · Rendering unavailable'} -

- - {(representation === 'table' || representation === 'matrix') && ( -

Project-wide requirements

- )}
); } diff --git a/src/lib/workbench/shell/Workbench.tsx b/src/lib/workbench/shell/Workbench.tsx index 3ea5069..ca9ab36 100644 --- a/src/lib/workbench/shell/Workbench.tsx +++ b/src/lib/workbench/shell/Workbench.tsx @@ -1,3 +1,8 @@ +import type { ExplorationRequest } from '$lib/workspace/exploration'; +import { Button } from '$lib/ui/primitives/button'; +import { ArrowLeft, ArrowRight, House } from 'lucide-react'; +import { ContentTabs } from './ContentTabs'; +import { openTab, type WorkspaceTab } from './workspace-tabs'; import { RequirementsPanel } from '../requirements/RequirementsPanel'; import { inspectionSource } from '../properties/inspection-source'; import type { @@ -8,6 +13,7 @@ import { WorkbenchLayout, WorkbenchPanels, IssuesToggle, + InspectButton, } from './WorkbenchPanels'; import { useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react'; import { createBrowserSession } from './session'; @@ -23,6 +29,7 @@ import type { import { Explorer } from '../explorer/Explorer'; import { SourceEditor } from '../source/SourceEditor'; import { Diagram } from '../diagrams/Diagram'; +import { Relationships } from '../properties/Relationships'; import { Properties } from '../properties/Properties'; import { diagramRelationshipSelection } from '../properties/diagram-selection'; import { Issues } from '../issues/Issues'; @@ -36,8 +43,10 @@ import { import type { RecoveryEntry } from '../recovery/envelope'; import { ProjectLauncher } from '../entry/ProjectLauncher'; import { ProjectHeader } from './ProjectHeader'; +import { loadLayout } from './layout'; import { WorkspaceToolbar } from './WorkspaceToolbar'; import { SourcePaneHeader } from './SourcePaneHeader'; +import { WorkspaceOpener } from './WorkspaceOpener'; import { ModelPaneHeader } from './ModelPaneHeader'; import { DiagramTargetControls } from '../diagrams/DiagramTargetControls'; import { @@ -82,6 +91,20 @@ export function Workbench({ null, ); const [documentFailure, setDocumentFailure] = useState(null); + const [projectGeneration, setProjectGeneration] = useState(0); + const [workspaceFocusRequest, setWorkspaceFocusRequest] = useState(0); + const [workspaceTabs, setWorkspaceTabs] = useState([]); + const [sourceTabs, setSourceTabs] = useState<{ id: string; label: string }[]>( + [], + ); + + const cameras = useRef( + new Map(), + ); + const [navigation, setNavigation] = useState<{ + entries: WorkspaceTab[]; + index: number; + }>({ entries: [], index: -1 }); const [dataMode, setDataMode] = useState< 'diagram' | 'table' | 'matrix' | 'document' >('diagram'); @@ -105,6 +128,7 @@ export function Workbench({ [selected, setSelected] = useState(''), [treeSelectionRequest, setTreeSelectionRequest] = useState(0), [inspectionRequest, setInspectionRequest] = useState(0), + [sourceRequest, setSourceRequest] = useState(0), [error, setError] = useState(''), [message, setMessage] = useState('Choose a project to begin.'); const [inspectionTarget, setInspectionTarget] = useState<{ @@ -124,7 +148,15 @@ export function Workbench({ const [explorationFocus, setExplorationFocus] = useState< 'scope' | 'representation' >(); - const [mode, setMode] = useState('diagram'), + const [mode, setMode] = useState(() => { + try { + return loadLayout(window.localStorage, false).sourceClosed + ? 'diagram' + : 'split'; + } catch { + return 'diagram'; + } + }), [dialog, setDialog] = useState< 'project' | 'view' | 'part' | 'connection' | 'proposal' | null >(null); @@ -146,6 +178,11 @@ export function Workbench({ await session.open(entry.project, { unsaved: true }); setDataMode('diagram'); const restored = session.snapshot(); + setProjectGeneration((value) => value + 1); + setWorkspaceTabs([]); + setSourceTabs([]); + cameras.current.clear(); + setNavigation({ entries: [], index: -1 }); recovery.acceptRestored({ project: restored.project!, activeFile: entry.activeFile, @@ -193,6 +230,149 @@ export function Workbench({ const diagramIdentity = state.exploration ? JSON.stringify(state.exploration.request) : state.view?.view; + const currentTab: WorkspaceTab | undefined = + dataMode === 'table' || dataMode === 'matrix' + ? { + id: dataMode, + kind: dataMode, + label: + dataMode === 'table' ? 'Requirements table' : 'Traceability matrix', + } + : dataMode === 'document' && state.renderedDocument + ? { + id: 'document:' + state.renderedDocument.document, + kind: 'document', + target: state.renderedDocument.document, + label: + state.model?.documents?.find( + (item) => + item.qualifiedName === state.renderedDocument?.document, + )?.name ?? 'Document', + } + : dataMode === 'document' + ? undefined + : state.exploration + ? { + id: + 'exploration:' + + JSON.stringify(state.exploration.request.scope), + kind: 'exploration', + request: state.exploration.request, + label: + state.exploration.request.scope.kind === 'project' + ? 'Project overview' + : (state.exploration.request.scope.subject + .split('::') + .at(-1) ?? 'Exploration'), + } + : state.view + ? { + id: 'view:' + state.view.view, + kind: 'view', + target: state.view.view, + label: + state.model?.elements.find( + (item) => item.id === state.view?.view, + )?.name ?? + state.view.view.split('::').at(-1) ?? + 'Diagram', + } + : undefined; + const cameraKey = `${projectGeneration}:${displayedView?.modelHash ?? ''}:${diagramIdentity ?? ''}`; + const currentTabKey = currentTab ? JSON.stringify(currentTab) : ''; + useEffect(() => { + if (currentTab) setWorkspaceTabs((tabs) => openTab(tabs, currentTab)); + }, [currentTabKey, projectGeneration]); + useEffect(() => { + if (state.project?.drafts.some((item) => item.name === file)) + setSourceTabs((tabs) => openTab(tabs, { id: file, label: file })); + }, [file, projectGeneration]); + useEffect(() => { + if (!currentTab) return; + setNavigation((before) => + before.entries[before.index]?.id === currentTab.id + ? { + ...before, + entries: before.entries.map((entry, index) => + index === before.index ? currentTab : entry, + ), + } + : { + entries: [...before.entries.slice(0, before.index + 1), currentTab], + index: before.index + 1, + }, + ); + }, [currentTabKey, projectGeneration]); + async function navigateHistory(delta: number) { + const index = navigation.index + delta; + const tab = navigation.entries[index]; + if (tab && (await activateTab(tab))) + setNavigation((before) => ({ ...before, index })); + } + function exploreScope(subject?: ModelElement) { + const request: ExplorationRequest = !subject + ? { scope: { kind: 'project' }, representation: 'tree' } + : subject.kind === 'package' + ? { + scope: { kind: 'package', subject: subject.id }, + representation: 'tree', + } + : { + scope: { kind: 'element', subject: subject.id }, + representation: 'interconnection', + }; + void run(async () => { + await workspace().explore(request); + setDataMode('diagram'); + }); + } + const breadcrumbScope = state.exploration?.request.scope; + async function activateTab(tab: WorkspaceTab) { + let success = false; + await run(async () => { + if (tab.kind === 'view') { + if ( + state.view?.view !== tab.target || + state.view.modelHash !== state.model?.modelHash + ) + await workspace().openView(tab.target); + setDataMode('diagram'); + } else if (tab.kind === 'exploration') { + if ( + JSON.stringify(state.exploration?.request) !== + JSON.stringify(tab.request) || + state.exploration?.modelHash !== state.model?.modelHash + ) + await workspace().explore(tab.request); + setDataMode('diagram'); + } else if (tab.kind === 'document') { + if ( + state.renderedDocument?.document !== tab.target || + state.renderedDocument.modelHash !== state.model?.modelHash + ) + await workspace().openDocument(tab.target); + setDataMode('document'); + } else setDataMode(tab.kind); + success = true; + }); + return success; + } + async function closeWorkspaceTab(id: string) { + const remaining = workspaceTabs.filter((tab) => tab.id !== id); + if (!remaining.length) return; + if (id === currentTab?.id && !(await activateTab(remaining.at(-1)!))) + return; + setWorkspaceTabs(remaining); + } + function closeSourceTab(id: string) { + const remaining = sourceTabs.filter((tab) => tab.id !== id); + if (!remaining.length) return; + if (file === id) { + setFocusRange(undefined); + setFile(remaining.at(-1)!.id); + } + setSourceTabs(remaining); + } const selectedCorrespondence = symbolSelection?.view === diagramIdentity && symbolSelection?.modelHash === displayedView?.modelHash @@ -330,7 +510,6 @@ export function Workbench({ origin: 'Built-in example', preferred: exampleView, }); - setMode('diagram'); } async function run(action: () => unknown | Promise) { const generation = ++actionGeneration.current; @@ -353,6 +532,11 @@ export function Workbench({ ) { const session = workspace(); await session.open(project, { unsaved: options.unsaved }); + setProjectGeneration((value) => value + 1); + setWorkspaceTabs([]); + setSourceTabs([]); + cameras.current.clear(); + setNavigation({ entries: [], index: -1 }); setDataMode('diagram'); setSelected(''); setInspectionTarget(undefined); @@ -487,7 +671,7 @@ export function Workbench({ ); if (command.kind === 'createView') setDataMode('diagram'); } - function selectSymbol(symbol: string) { + function selectSymbol(symbol: string, inspect = false) { setRequirementSelection(undefined); const correspondence = displayedView?.correspondence.find( (item) => item.symbol === symbol, @@ -512,7 +696,7 @@ export function Workbench({ : undefined, }); setFocusRange(undefined); - if (correspondence) setInspectionRequest((request) => request + 1); + if (inspect && correspondence) setInspectionRequest((value) => value + 1); } function selectElement(item: ModelElement) { setRequirementSelection(undefined); @@ -560,7 +744,10 @@ export function Workbench({ : undefined, }); setFocusRange(undefined); - setInspectionRequest((request) => request + 1); + } + function showSourcePanel() { + setSourceRequest((value) => value + 1); + if (mode === 'diagram') setMode('split'); } function navigateIssue(issue: Diagnostic) { const current = workspace().snapshot(); @@ -580,7 +767,7 @@ export function Workbench({ return; } setFile(location.target.file); - if (mode === 'diagram') setMode('split'); + showSourcePanel(); setFocusRange(location.target); } function inspectRequirement( @@ -625,13 +812,13 @@ export function Workbench({ setSelected(location.qualifiedName ?? ''); setSymbolSelection(undefined); setFile(location.target.file); - setMode('split'); + showSourcePanel(); setFocusRange({ ...location.target, focus: true }); } function revealSource() { if (inspectionRange) { setFile(inspectionRange.file); - setMode('split'); + showSourcePanel(); // Repeat the reveal even when the same file and layout are already open. setFocusRange({ ...inspectionRange, focus: true }); } else @@ -646,7 +833,7 @@ export function Workbench({ setError(''); } return ( - + { + setFocusRange(undefined); setFile(name); - if (mode === 'diagram') setMode('split'); + showSourcePanel(); }} onView={(id) => void run(async () => { + await workspace().openView(id); setDataMode('diagram'); - try { - await workspace().openView(id); - } catch (error) { - setDataMode(dataMode); - throw error; - } }) } onDocument={(id) => void run(async () => { - const previous = dataMode; setDocumentFailure(null); + await workspace().openDocument(id); setDataMode('document'); - try { - await workspace().openDocument(id); - } catch (error) { - setDataMode(previous); - throw error; - } }) } onSelect={selectElement} @@ -772,53 +950,66 @@ export function Workbench({ source={ source ? ( ( - document.name === source.name, - )?.text - } - tools={tools} - onUndo={() => - void run(async () => { - const session = workspace(), - id = session.snapshot().view?.view, - document = - session.snapshot().renderedDocument?.document; - session.undo(); - await refreshView(session, id, document); - }) - } - onRedo={() => - void run(async () => { - const session = workspace(), - id = session.snapshot().view?.view, - document = - session.snapshot().renderedDocument?.document; - session.redo(); - await refreshView(session, id, document); - }) - } - onDiscard={() => - void run(() => workspace().discardDrafts()) - } - onApply={() => - void run(async () => { - const session = workspace(), - id = session.snapshot().view?.view, - document = - session.snapshot().renderedDocument?.document; - await session.apply(); - setMessage('Source applied.'); + <> + { setFocusRange(undefined); - await refreshView(session, id, document); - }) - } - /> + setFile(id); + }} + onClose={closeSourceTab} + /> + document.name === source.name, + )?.text + } + tools={tools} + onUndo={() => + void run(async () => { + const session = workspace(), + id = session.snapshot().view?.view, + document = + session.snapshot().renderedDocument?.document; + session.undo(); + await refreshView(session, id, document); + }) + } + onRedo={() => + void run(async () => { + const session = workspace(), + id = session.snapshot().view?.view, + document = + session.snapshot().renderedDocument?.document; + session.redo(); + await refreshView(session, id, document); + }) + } + onDiscard={() => + void run(() => workspace().discardDrafts()) + } + onApply={() => + void run(async () => { + const session = workspace(), + id = session.snapshot().view?.view, + document = + session.snapshot().renderedDocument?.document; + await session.apply(); + setMessage('Source applied.'); + setFocusRange(undefined); + await refreshView(session, id, document); + }) + } + /> + )} file={source} disabled={state.busy} @@ -845,7 +1036,7 @@ export function Workbench({ }} onDefinition={(target) => { setFile(target.file); - if (mode === 'diagram') setMode('split'); + showSourcePanel(); setFocusRange({ file: target.file, start: target.from, @@ -867,36 +1058,119 @@ export function Workbench({ } diagram={
- - item.kind === 'viewUsage', - ) ?? [] - } - busy={state.busy} - onOpenView={(id) => - void run(() => workspace().openView(id)) +
+
+ { + const tab = workspaceTabs.find( + (item) => item.id === id, + ); + if (tab) void activateTab(tab); + }} + onClose={(id) => void closeWorkspaceTab(id)} + /> + { + const success = await activateTab(tab); + if (success) + setWorkspaceFocusRequest((value) => value + 1); + return success; + }} + /> +
+ + } + representation={dataMode} + navigation={ + } + state={state} view={displayedView} - exploration={state.exploration?.request} - elements={state.model?.elements ?? []} - explorationFocus={explorationFocus} - onExplore={(request, focus) => { - setExplorationFocus(focus); - void run(() => workspace().explore(request)); - }} - disabled={state.busy || state.unapplied} - onCreatePart={newPart} - onConnectPorts={newConnection} - /> - + > + { + setExplorationFocus(focus); + void run(() => workspace().explore(request)); + }} + disabled={state.busy || state.unapplied} + onCreatePart={newPart} + onConnectPorts={newConnection} + /> + +
{(dataMode === 'table' || dataMode === 'matrix') && readySession && ( void run(async () => { - setDataMode('diagram'); await workspace().openView(id); + setDataMode('diagram'); }) } /> @@ -928,6 +1202,10 @@ export function Workbench({ } > + cameras.current.set(cameraKey, viewport) + } selectedSymbol={selectedCorrespondence?.symbol} busy={state.busy} layoutMode={mode} @@ -988,13 +1266,20 @@ export function Workbench({ return; } setFile(target.file); - setMode('split'); + showSourcePanel(); setFocusRange({ ...target, focus: true }); }} onCreatePart={newPart} onConnectPorts={newConnection} /> } + relationships={ + + } issues={ window.matchMedia('(max-width: 900px)').matches, - ); - useEffect(() => { - const media = window.matchMedia('(max-width: 900px)'); - const changed = () => setNarrow(media.matches); - media.addEventListener('change', changed); - return () => media.removeEventListener('change', changed); - }, []); - return narrow; -} -function useLayoutController(mode: Mode) { - const narrow = useNarrow(); +type Tool = 'explorer' | 'source' | 'inspection'; +type Expanded = Tool | 'canvas' | null; +function useLayoutController(mode: Mode, onMode: (mode: Mode) => void) { const [initial] = useState(() => { try { - return { value: loadLayout(window.localStorage, narrow), failed: false }; + return { value: loadLayout(window.localStorage, false), failed: false }; } catch { - return { - value: { ...defaultLayout, inspectorClosed: narrow }, - failed: true, - }; + return { value: { ...defaultLayout }, failed: true }; } }); - const [splitSize, setSplitSize] = useState(initial.value.split); - function observeSplit(value: number) { - setSplitSize((before) => - Math.abs(before - value) < 0.01 ? before : value, - ); - } - const preferences = useRef(initial.value); - const [closed, setClosed] = useState>({ - explorer: initial.value.explorerClosed, - inspector: initial.value.inspectorClosed, - issues: initial.value.issuesClosed, - }); + const [preferences, setPreferences] = useState(initial.value); + const saved = useRef(initial.value); const [storageFailed, setStorageFailed] = useState(initial.failed); - const explorer = useRef(null), - inspector = useRef(null), - issues = useRef(null); - const source = useRef(null), - diagram = useRef(null); - const outerGroup = useRef(null), - editorGroup = useRef(null), - verticalGroup = useRef(null); - const explorerToggle = useRef(null), - inspectorToggle = useRef(null), - issuesToggle = useRef(null); - const explorerCollapse = useRef(null), - inspectorCollapse = useRef(null), - issuesCollapse = useRef(null); - const panels = { explorer, inspector, issues }; - const toggles = { - explorer: explorerToggle, - inspector: inspectorToggle, - issues: issuesToggle, + const [expanded, setExpanded] = useState(null); + const [narrow, setNarrow] = useState(() => window.innerWidth <= 900); + const outer = useRef(null); + const editors = useRef(null); + const vertical = useRef(null); + const toggleExplorer = useRef(null); + const toggleSource = useRef(null); + const toggleInspection = useRef(null); + const toggleFocus = useRef(null); + const triggers = { + explorer: toggleExplorer, + source: toggleSource, + inspection: toggleInspection, }; - const collapseButtons = { - explorer: explorerCollapse, - inspector: inspectorCollapse, - issues: issuesCollapse, - }; - function remember(patch: Partial) { - const next = { ...preferences.current, ...patch }; - if (JSON.stringify(next) === JSON.stringify(preferences.current)) return; - preferences.current = next; + const focusTarget = useRef(null); + function remember(patch: Partial) { + const next = { ...saved.current, ...patch }; + saved.current = next; + setPreferences(next); try { setStorageFailed(!saveLayout(window.localStorage, next)); } catch { setStorageFailed(true); } } - const [focusRequest, setFocusRequest] = useState<{ - id: Side; - collapsed: boolean; - } | null>(null); - const [opening, setOpening] = useState(null); - useLayoutEffect(() => { - if ( - opening || - !focusRequest || - closed[focusRequest.id] !== focusRequest.collapsed - ) - return; - const target = focusRequest.collapsed - ? toggles[focusRequest.id] - : collapseButtons[focusRequest.id]; - target.current?.focus({ preventScroll: true }); - setFocusRequest(null); - }, [focusRequest, closed, opening]); - useLayoutEffect(() => { - if (!opening) return; - // Release the collapsed tool's reopen rail before allocating its width. - // Otherwise the rail + activity bar + minimum editors can prevent expansion. - const minimum = opening === 'inspector' ? 190 : 145; - panels[opening].current?.resize( - opening !== 'issues' && - (window.innerWidth * preferences.current[opening]) / 100 < minimum - ? `${minimum}px` - : `${preferences.current[opening]}%`, - ); - setOpening(null); - }, [opening]); - function show(id: Side, transferFocus = true) { - const panel = panels[id].current; - if (!panel) return; - // On small screens a side tool must leave room for the editor. - if (window.innerWidth < 600 && id !== 'issues') { - const other = id === 'explorer' ? 'inspector' : 'explorer'; - panels[other].current?.collapse(); - remember({ [closedKey[other]]: true }); + useEffect(() => { + const media = window.matchMedia('(max-width: 900px)'); + const changed = () => setNarrow(media.matches); + media.addEventListener('change', changed); + return () => media.removeEventListener('change', changed); + }, []); + const visible = { + explorer: expanded + ? expanded === 'explorer' + : !preferences.explorerClosed && (!narrow || mode === 'diagram'), + source: expanded ? expanded === 'source' : mode !== 'diagram', + inspection: expanded + ? expanded === 'inspection' + : mode !== 'code' && !preferences.inspectionClosed, + canvas: expanded ? expanded === 'canvas' : mode !== 'code', + }; + useEffect(() => { + const closed = mode === 'diagram'; + if (saved.current.sourceClosed !== closed) + remember({ sourceClosed: closed }); + }, [mode]); + // Apply after the panel library registers changed size constraints. Normal + // preferences remain independent of temporary focus/maximise layouts. + useEffect(() => { + const apply = () => { + outer.current?.setLayout({ + explorer: + expanded === 'explorer' + ? 100 + : visible.explorer + ? preferences.explorer + : 0, + editors: + expanded === 'explorer' + ? 0 + : visible.explorer + ? 100 - preferences.explorer + : 100, + }); + editors.current?.setLayout({ + centre: visible.source + ? visible.canvas || visible.inspection + ? 100 - preferences.source + : 0 + : 100, + source: visible.source + ? visible.canvas || visible.inspection + ? preferences.source + : 100 + : 0, + }); + vertical.current?.setLayout({ + diagram: visible.canvas + ? visible.inspection + ? 100 - preferences.inspection + : 100 + : 0, + inspection: visible.inspection + ? visible.canvas + ? preferences.inspection + : 100 + : 0, + }); + }; + const frame = requestAnimationFrame(apply); + focusTarget.current?.focus({ preventScroll: true }); + focusTarget.current = null; + return () => cancelAnimationFrame(frame); + }, [ + expanded, + visible.explorer, + visible.source, + visible.inspection, + visible.canvas, + preferences.explorer, + preferences.source, + preferences.inspection, + narrow, + ]); + function show(id: Tool, focus = false) { + setExpanded(null); + if (id === 'source') { + if (mode === 'diagram') onMode('split'); + } else if (id === 'explorer') { + remember({ explorerClosed: false }); + if (narrow) onMode('diagram'); + } else { + remember({ inspectionClosed: false }); + if (mode === 'code') onMode('split'); } - // A remembered desktop percentage can fall below a side tool's pixel - // minimum on a phone; the panel library may then keep it collapsed. - setClosed((before) => ({ ...before, [id]: false })); - setOpening(id); - remember({ [closedKey[id]]: false }); - if (transferFocus) setFocusRequest({ id, collapsed: false }); + if (focus) focusTarget.current = triggers[id].current; + } + function hide(id: Tool) { + setExpanded(null); + if (id === 'source') onMode('diagram'); + else + remember( + id === 'explorer' + ? { explorerClosed: true } + : { inspectionClosed: true }, + ); + triggers[id].current?.focus({ preventScroll: true }); + } + function toggle(id: Tool) { + if (visible[id]) hide(id); + else show(id); } - function hide(id: Side) { - panels[id].current?.collapse(); - remember({ [closedKey[id]]: true }); - setFocusRequest({ id, collapsed: true }); + function inspect(tab: Preferences['inspectionTab'], focus = false) { + remember({ inspectionClosed: false, inspectionTab: tab }); + if (mode === 'code') onMode('split'); + setExpanded(null); + if (focus) focusTarget.current = toggleInspection.current; } - function resize(id: Side, delta: number) { - const panel = panels[id].current; - if (!panel) return; - const value = Math.max( - id === 'issues' ? 12 : 5, - Math.min(id === 'issues' ? 60 : 45, panel.getSize().asPercentage + delta), - ); - panel.resize(`${value}%`); - remember({ [id]: value, [closedKey[id]]: false }); + function maximize(id: Tool) { + setExpanded((before) => (before === id ? null : id)); + focusTarget.current = triggers[id].current; } - function resizeSplit(delta: number) { - const value = Math.max(10, Math.min(90, preferences.current.split + delta)); - editorGroup.current?.setLayout({ source: value, diagram: 100 - value }); - remember({ split: value }); + function focus() { + setExpanded((before) => (before === 'canvas' ? null : 'canvas')); + focusTarget.current = toggleFocus.current; } function changed( - kind: 'outer' | 'editors' | 'vertical', - layout: Layout, + group: 'outer' | 'editors' | 'vertical', + value: Layout, meta: LayoutChangedMeta, ) { - if (!meta.isUserInteraction) return; - const wanted = meta.requestedLayout ?? layout; - if (kind === 'editors') { - if (mode === 'split' && wanted.source! >= 10 && wanted.source! <= 90) - remember({ split: wanted.source }); - return; + if (!meta.isUserInteraction || expanded) return; + const wanted = meta.requestedLayout ?? value; + if (group === 'outer') + remember({ + explorerClosed: value.explorer === 0, + ...(wanted.explorer! >= 5 && wanted.explorer! <= 45 + ? { explorer: wanted.explorer } + : {}), + }); + if (group === 'editors' && mode === 'split') { + if (value.source === 0) onMode('diagram'); + else if (wanted.source! >= 10 && wanted.source! <= 65) + remember({ source: wanted.source }); } - const ids: Side[] = - kind === 'outer' ? ['explorer', 'inspector'] : ['issues']; - const patch: Partial = {}; - for (const id of ids) { - const collapsed = layout[id] === 0; - patch[closedKey[id]] = collapsed; - if (!collapsed) - patch[id] = Math.max( - id === 'issues' ? 12 : 5, - Math.min(id === 'issues' ? 60 : 45, wanted[id]!), - ); - if ( - collapsed && - document.activeElement?.getAttribute('aria-label') === - `Resize ${titles[id]}` - ) - setFocusRequest({ id, collapsed: true }); - } - remember(patch); - } - function observe(id: Side, size: number) { - const value = size === 0; - setClosed((before) => - before[id] === value ? before : { ...before, [id]: value }, - ); + if (group === 'vertical') + remember({ + inspectionClosed: value.inspection === 0, + ...(wanted.inspection! >= 12 && wanted.inspection! <= 60 + ? { inspection: wanted.inspection } + : {}), + }); } function reset() { - const next = { ...defaultLayout, inspectorClosed: narrow }; - preferences.current = next; - outerGroup.current?.setLayout({ - explorer: next.explorer, - editors: - 100 - next.explorer - (next.inspectorClosed ? 0 : next.inspector), - inspector: next.inspectorClosed ? 0 : next.inspector, - }); - editorGroup.current?.setLayout( - mode === 'split' - ? { source: next.split, diagram: 100 - next.split } - : { - source: mode === 'code' ? 100 : 0, - diagram: mode === 'diagram' ? 100 : 0, - }, - ); - verticalGroup.current?.setLayout({ workspace: 100, issues: 0 }); - try { - setStorageFailed(!saveLayout(window.localStorage, next)); - } catch { - setStorageFailed(true); - } + remember({ ...defaultLayout }); + setExpanded(null); + onMode('diagram'); } - useEffect(() => { - const ratio = preferences.current.split; - editorGroup.current?.setLayout({ - source: mode === 'diagram' ? 0 : mode === 'code' ? 100 : ratio, - diagram: mode === 'code' ? 0 : mode === 'diagram' ? 100 : 100 - ratio, - }); - }, [mode, narrow]); - useEffect(() => { - // Panel constraint registration may finish after the mode effect. Reapply - // a single-pane layout when the resize callback reports leftover space. - if (mode === 'code' && splitSize !== 100) - editorGroup.current?.setLayout({ source: 100, diagram: 0 }); - else if (mode === 'diagram' && splitSize !== 0) - editorGroup.current?.setLayout({ source: 0, diagram: 100 }); - }, [mode, splitSize]); return { - observeSplit, mode, - narrow, + onMode, + preferences, + visible, initial: initial.value, - closed, storageFailed, - panels, - source, - diagram, - outerGroup, - editorGroup, - verticalGroup, - toggles, - collapseButtons, + expanded, + narrow, + outer, + editors, + vertical, + triggers, + toggleFocus, + remember, show, hide, - resize, - resizeSplit, + toggle, + inspect, + maximize, + focus, changed, - observe, reset, }; } type Controller = ReturnType; const PanelContext = createContext(null); function usePanels() { - const layout = useContext(PanelContext); - if (!layout) throw new Error('Workspace panel provider is missing.'); - return layout; + const value = useContext(PanelContext); + if (!value) throw new Error('Workspace panel provider is missing.'); + return value; } export function WorkbenchLayout({ mode, + onMode, children, }: { mode: Mode; + onMode: (mode: Mode) => void; children: ReactNode; }) { return ( - {children} + + {children} + ); } export function PanelControls() { - const layout = usePanels(); + const c = usePanels(); return ( -
+
+ {(['explorer', 'inspection', 'source'] as const).map((id) => ( + c.toggle(id)} + /> + ))} + - - - {layout.storageFailed && ( + {c.storageFailed && (

Layout preferences cannot be saved. Changes remain available for this visit. @@ -361,99 +338,56 @@ export function PanelControls() {

); } -function CollapsedRail({ id }: { id: 'inspector' }) { - const layout = usePanels(); - if (!layout.closed[id]) return null; +export function InspectButton() { + const c = usePanels(); return ( -
- layout.show(id)} - /> -
+ ); } export function IssuesToggle({ count }: { count: number }) { - const layout = usePanels(); + const c = usePanels(); + const open = c.visible.inspection && c.preferences.inspectionTab === 'issues'; return ( ); } -function SideHeader({ id }: { id: Side }) { - const layout = usePanels(); +function ToolActions({ + id, + closeRef, +}: { + id: Tool; + closeRef?: Ref; +}) { + const c = usePanels(); + const name = + id === 'inspection' ? 'Inspector' : id === 'source' ? 'Source' : 'Explorer'; return ( -
-

- {titles[id]} -

-
- - - - - - - - - - layout.hide(id)} - /> -
-
+
+ c.maximize(id)} + /> + c.hide(id)} + /> +
); } const hitTarget = { coarse: 24, fine: 10 }; @@ -462,205 +396,314 @@ export function WorkbenchPanels({ source, diagram, inspector, + relationships, issues, issueKey, inspectionRequest, + sourceRequest, }: { explorer: ReactNode; source: ReactNode; diagram: ReactNode; inspector: ReactNode; + relationships: ReactNode; issues: ReactNode; issueKey: string; inspectionRequest: number; + sourceRequest: number; }) { - const layout = usePanels(); - const initial = layout.initial; + const c = usePanels(); const lastIssue = useRef(''); + const inspectionClose = useRef(null); + // Explicit reveal requests belong to this project surface. Mounting its + // replacement must not replay requests consumed by the previous project. + const requests = useRef({ + source: sourceRequest, + inspection: inspectionRequest, + }); + useEffect(() => { + if ( + sourceRequest !== requests.current.source && + sourceRequest && + !c.visible.source + ) + c.show('source'); + requests.current.source = sourceRequest; + }, [sourceRequest]); const sourceContent = useRef(null); - const [sourceMinimum, setSourceMinimum] = useState(100); + const [sourceMinimum, setSourceMinimum] = useState(240); useLayoutEffect(() => { - const header = sourceContent.current?.querySelector('.source-pane-header'); - if (!header) return; + const content = sourceContent.current; + if (!content) return; + const headers = [ + ...content.querySelectorAll( + '.panel-header, .content-tabs, .source-pane-header', + ), + ]; const measure = () => { - const height = header.getBoundingClientRect().height; - // A hidden Source pane has no box; retain its last visible minimum. + const height = headers.reduce( + (sum, item) => sum + item.getBoundingClientRect().height, + 0, + ); if (height > 0) setSourceMinimum(Math.ceil(height) + 80); }; - measure(); const observer = new ResizeObserver(measure); - observer.observe(header); + headers.forEach((item) => observer.observe(item)); + measure(); return () => observer.disconnect(); }, [source]); + useEffect(() => { - if (inspectionRequest) layout.show('inspector', window.innerWidth < 600); + let frame = 0; + let settled = 0; + if ( + inspectionRequest !== requests.current.inspection && + inspectionRequest + ) { + const focusOpenedTool = c.narrow && !c.visible.inspection; + c.inspect('properties'); + // The newly opened bottom dock can clip the table row that requested it. + // Transfer phone keyboard focus after the resized panels have committed. + if (focusOpenedTool) + frame = requestAnimationFrame(() => { + settled = requestAnimationFrame(() => { + if (inspectionClose.current?.getClientRects().length) + inspectionClose.current.focus({ preventScroll: true }); + }); + }); + } + requests.current.inspection = inspectionRequest; + return () => { + cancelAnimationFrame(frame); + cancelAnimationFrame(settled); + }; }, [inspectionRequest]); useEffect(() => { - if (issueKey && issueKey !== lastIssue.current) - layout.show('issues', false); + if (issueKey && issueKey !== lastIssue.current) c.inspect('issues'); lastIssue.current = issueKey; }, [issueKey]); - const side = (id: 'explorer' | 'inspector', content: ReactNode) => ( - { - layout.observe(id, size.asPercentage); - }} - > - - - ); + const inspectionTab = c.preferences.inspectionTab; return ( layout.changed('vertical', value, meta)} + onLayoutChanged={(v, m) => c.changed('outer', v, m)} > + + + + - layout.changed('outer', value, meta) - } + onLayoutChanged={(v, m) => c.changed('editors', v, m)} > - - layout.closed.explorer - ? layout.show('explorer') - : layout.hide('explorer') - } - /> - {side('explorer', explorer)} - - layout.changed('editors', value, meta) - } + onLayoutChanged={(v, m) => c.changed('vertical', v, m)} > layout.observeSplit(size.asPercentage)} + id="diagram" defaultSize={ - layout.mode === 'diagram' - ? '0%' - : layout.mode === 'code' - ? '100%' - : `${initial.split}%` + c.initial.inspectionClosed + ? '100%' + : `${100 - c.initial.inspection}%` } - minSize={layout.narrow ? `${sourceMinimum}px` : '160px'} - collapsible={layout.mode !== 'split'} + minSize="100px" + collapsible collapsedSize="0%" > - - {side('inspector', inspector)} + + + - - layout.observe('issues', size.asPercentage)} - > - - ); } diff --git a/src/lib/workbench/shell/WorkspaceOpener.tsx b/src/lib/workbench/shell/WorkspaceOpener.tsx new file mode 100644 index 0000000..410b842 --- /dev/null +++ b/src/lib/workbench/shell/WorkspaceOpener.tsx @@ -0,0 +1,138 @@ +import { useEffect, useRef, useState } from 'react'; +import { Plus, Eye, Table2, Grid3X3, FileText } from 'lucide-react'; +import { Button } from '$lib/ui/primitives/button'; +import { + Popover, + PopoverTrigger, + PopoverContent, +} from '$lib/ui/primitives/popover'; +import { documentEntries } from '$lib/workspace/documents'; +import type { WorkspaceState } from '$lib/workspace/createWorkspace'; +import type { WorkspaceTab } from './workspace-tabs'; + +/** Discover content once; opened content is navigated with workspace tabs. */ +export function WorkspaceOpener({ + state, + active, + onOpen, +}: { + active: boolean; + state: Pick; + onOpen: (tab: WorkspaceTab) => Promise; +}) { + const [open, setOpen] = useState(false); + const trigger = useRef(null); + const choosing = useRef(false); + useEffect(() => { + if (!active) setOpen(false); + }, [active]); + const views = + state.model?.elements.filter((item) => item.kind === 'viewUsage') ?? []; + const documents = documentEntries(state.model?.documents); + async function choose(tab: WorkspaceTab) { + choosing.current = true; + setOpen(false); + if (!(await onOpen(tab))) + requestAnimationFrame(() => { + if (trigger.current?.getClientRects().length) + trigger.current.focus({ preventScroll: true }); + }); + } + return ( + { + if (next) choosing.current = false; + setOpen(next); + }} + > + + + + { + // Selection transfers focus to content; Escape retains normal trigger focus. + if (choosing.current) event.preventDefault(); + }} + > +

Open workspace tab

+

Project data

+ + +

Views

+ {views.map((view) => ( + + ))} + {!views.length && ( +

No named views. Use Project overview to explore.

+ )} + {!!documents.length &&

Documents

} + {documents.map((doc) => ( + + ))} +
+
+ ); +} diff --git a/src/lib/workbench/shell/layout.test.ts b/src/lib/workbench/shell/layout.test.ts index be4bf68..c6a1fb6 100644 --- a/src/lib/workbench/shell/layout.test.ts +++ b/src/lib/workbench/shell/layout.test.ts @@ -1,16 +1,22 @@ import { expect, it } from 'vitest'; -import { defaultLayout, loadLayout, parseLayout, saveLayout } from './layout'; +import { + defaultLayout, + layoutStorageKey, + loadLayout, + parseLayout, + saveLayout, +} from './layout'; -it('rejects incompatible, unbounded and source-bearing layout preferences', () => { +it('rejects incompatible, unbounded and source-bearing preferences', () => { for (const raw of [ null, '', '{', 'x'.repeat(2049), - JSON.stringify({ ...defaultLayout, version: 2 }), - JSON.stringify({ ...defaultLayout, split: -1 }), + JSON.stringify({ ...defaultLayout, version: 3 }), + JSON.stringify({ ...defaultLayout, source: -1 }), JSON.stringify({ ...defaultLayout, explorer: 90 }), - JSON.stringify({ ...defaultLayout, issues: 100 }), + JSON.stringify({ ...defaultLayout, inspection: 100 }), JSON.stringify({ ...defaultLayout, documents: [{ text: 'unsaved source' }], @@ -18,37 +24,61 @@ it('rejects incompatible, unbounded and source-bearing layout preferences', () = ]) expect(parseLayout(raw)).toBeUndefined(); }); -it('restores supported layout preferences independently of responsive defaults', () => { +it('restores validated preferences with model-first defaults', () => { const saved = { ...defaultLayout, explorer: 25, - split: 65, - inspectorClosed: false, + source: 45, + inspectionClosed: false, }; - const storage = { getItem: () => JSON.stringify(saved) }; - expect(loadLayout(storage, true)).toEqual(saved); - expect(loadLayout({ getItem: () => '{' }, true).inspectorClosed).toBe(true); - expect(loadLayout({ getItem: () => null }, false)).toEqual(defaultLayout); -}); -it('does not hide failed writes or persist invalid layout data', () => { expect( - saveLayout( + loadLayout( { - setItem() { - throw new Error('denied'); - }, + getItem: (key) => + key === layoutStorageKey ? JSON.stringify(saved) : null, }, - defaultLayout, + true, ), - ).toBe(false); + ).toEqual(saved); + expect(loadLayout({ getItem: () => '{' }, true)).toEqual(defaultLayout); + expect(loadLayout({ getItem: () => null }, false)).toEqual(defaultLayout); +}); +it('migrates supported legacy sizes and issues visibility without changing portable data', () => { + const legacy = { + version: 1, + explorer: 23, + inspector: 19, + split: 80, + issues: 30, + explorerClosed: true, + inspectorClosed: false, + issuesClosed: false, + }; expect( - saveLayout( + loadLayout( { - setItem() { - throw new Error('invalid data must not reach storage'); - }, + getItem: (key) => (key.endsWith('v1') ? JSON.stringify(legacy) : null), }, - { ...defaultLayout, split: Number.NaN }, + false, ), - ).toBe(false); + ).toEqual({ + ...defaultLayout, + explorer: 23, + explorerClosed: true, + source: 65, + inspection: 30, + inspectionClosed: false, + inspectionTab: 'issues', + }); +}); +it('does not hide failed writes or persist invalid data', () => { + const denied = { + setItem() { + throw new Error('denied'); + }, + }; + expect(saveLayout(denied, defaultLayout)).toBe(false); + expect(saveLayout(denied, { ...defaultLayout, source: Number.NaN })).toBe( + false, + ); }); diff --git a/src/lib/workbench/shell/layout.ts b/src/lib/workbench/shell/layout.ts index 8a85b10..6f29dae 100644 --- a/src/lib/workbench/shell/layout.ts +++ b/src/lib/workbench/shell/layout.ts @@ -1,32 +1,36 @@ import Type from 'typebox'; import { validator } from '$lib/contracts/validation'; -export const layoutStorageKey = 'sysml-workbench-layout-v1'; +export const layoutStorageKey = 'sysml-workbench-layout-v2'; const percentage = (minimum: number, maximum: number) => Type.Number({ minimum, maximum }); export const WorkbenchLayoutSchema = Type.Object( { - version: Type.Literal(1), + version: Type.Literal(2), explorer: percentage(5, 45), - inspector: percentage(5, 45), - split: percentage(10, 90), - issues: percentage(12, 60), + source: percentage(10, 65), + inspection: percentage(12, 60), explorerClosed: Type.Boolean(), - inspectorClosed: Type.Boolean(), - issuesClosed: Type.Boolean(), + sourceClosed: Type.Boolean(), + inspectionClosed: Type.Boolean(), + inspectionTab: Type.Union([ + Type.Literal('properties'), + Type.Literal('relationships'), + Type.Literal('issues'), + ]), }, { additionalProperties: false }, ); export type WorkbenchLayout = Type.Static; export const defaultLayout: WorkbenchLayout = { - version: 1, - explorer: 17, - inspector: 19, - split: 50, - issues: 24, + version: 2, + explorer: 18, + source: 32, + inspection: 25, explorerClosed: false, - inspectorClosed: false, - issuesClosed: true, + sourceClosed: true, + inspectionClosed: true, + inspectionTab: 'properties', }; const readLayout = validator(WorkbenchLayoutSchema, 'Invalid workspace layout'); export function parseLayout(raw: string | null): WorkbenchLayout | undefined { @@ -37,16 +41,44 @@ export function parseLayout(raw: string | null): WorkbenchLayout | undefined { return; } } +const legacySchema = Type.Object( + { + version: Type.Literal(1), + explorer: percentage(5, 45), + inspector: percentage(5, 45), + split: percentage(10, 90), + issues: percentage(12, 60), + explorerClosed: Type.Boolean(), + inspectorClosed: Type.Boolean(), + issuesClosed: Type.Boolean(), + }, + { additionalProperties: false }, +); +const readLegacy = validator(legacySchema, 'Invalid legacy workspace layout'); export function loadLayout( storage: Pick, - narrow: boolean, + _narrow: boolean, ): WorkbenchLayout { - return ( - parseLayout(storage.getItem(layoutStorageKey)) ?? { - ...defaultLayout, - inspectorClosed: narrow, + const current = parseLayout(storage.getItem(layoutStorageKey)); + if (current) return current; + const raw = storage.getItem('sysml-workbench-layout-v1'); + if (raw && raw.length <= 2048) { + try { + const old = readLegacy(JSON.parse(raw)); + return { + ...defaultLayout, + explorer: old.explorer, + explorerClosed: old.explorerClosed, + source: Math.max(10, Math.min(65, old.split)), + inspection: old.issues, + inspectionClosed: old.inspectorClosed && old.issuesClosed, + inspectionTab: old.issuesClosed ? 'properties' : 'issues', + }; + } catch { + /* Invalid preferences never prevent opening a project. */ } - ); + } + return { ...defaultLayout }; } export function saveLayout( storage: Pick, diff --git a/src/lib/workbench/shell/workspace-tabs.ts b/src/lib/workbench/shell/workspace-tabs.ts new file mode 100644 index 0000000..6ec9e13 --- /dev/null +++ b/src/lib/workbench/shell/workspace-tabs.ts @@ -0,0 +1,19 @@ +import type { ExplorationRequest } from '$lib/workspace/exploration'; +export type WorkspaceTab = + | { id: string; label: string; kind: 'view' | 'document'; target: string } + | { + id: string; + label: string; + kind: 'exploration'; + request: ExplorationRequest; + } + | { id: string; label: string; kind: 'table' | 'matrix' }; +/** Revisit a tab without duplicating its identity; refresh its current label. */ +export function openTab( + tabs: readonly T[], + tab: T, +): T[] { + return tabs.some((item) => item.id === tab.id) + ? tabs.map((item) => (item.id === tab.id ? tab : item)) + : [...tabs, tab]; +} diff --git a/src/lib/workbench/source/SourceEditor.tsx b/src/lib/workbench/source/SourceEditor.tsx index 1d4adc9..d79069c 100644 --- a/src/lib/workbench/source/SourceEditor.tsx +++ b/src/lib/workbench/source/SourceEditor.tsx @@ -53,6 +53,16 @@ export function SourceEditor({ isCurrent: () => boolean; }>(); const host = useRef(null); + const fileStates = useRef( + new Map< + string, + { + state: EditorState; + text: string; + scroll: ReturnType; + } + >(), + ); const editor = useRef<{ view: EditorView; name: string; @@ -126,11 +136,24 @@ export function SourceEditor({ useLayoutEffect(() => { const current = editor.current!; if (current.name !== file.name || current.text !== file.text) { - // External replacements start a fresh local history: undo cannot revive a - // discarded draft, another file, or an earlier accepted model revision. + // File tabs retain matching state. External replacements start fresh + // history so undo cannot revive a discarded draft or accepted revision. + if (current.name !== file.name) { + fileStates.current.set(current.name, { + state: current.view.state, + text: current.text, + scroll: current.view.scrollSnapshot(), + }); + } else fileStates.current.delete(file.name); + const cached = fileStates.current.get(file.name); current.name = file.name; current.text = file.text; - current.view.setState(current.state(file)); + current.view.setState( + cached?.text === file.text ? cached.state : current.state(file), + ); + if (cached?.text === file.text) { + current.view.dispatch({ effects: cached.scroll }); + } else current.view.scrollDOM.scrollTop = 0; current.disabled = undefined; } if (current.disabled !== disabled) { @@ -157,7 +180,42 @@ export function SourceEditor({ }, scrollIntoView: true, }); - if (selection.focus !== false) view.focus(); + if (selection.focus === false) return; + // A reveal can restore hidden/inert panels before their size constraints + // settle. Observe actual visibility instead of assuming two frames suffice. + const container = host.current!; + const owner = container.ownerDocument; + let completed = false; + const observer = new ResizeObserver(focusWhenVisible); + function focusWhenVisible() { + if (completed) return; + const rect = container.getBoundingClientRect(); + if ( + container.closest('[hidden], [inert]') || + rect.width <= 0 || + rect.height <= 0 + ) + return; + view.focus(); + if (view.hasFocus) stop(); + } + function stop() { + completed = true; + observer.disconnect(); + owner.removeEventListener('pointerdown', stop, true); + owner.removeEventListener('keydown', stop, true); + } + // New user input supersedes a delayed reveal. Reopening a panel later must + // not revive the older request and steal focus from its toggle. + owner.addEventListener('pointerdown', stop, true); + owner.addEventListener('keydown', stop, true); + observer.observe(container); + const frame = requestAnimationFrame(focusWhenVisible); + focusWhenVisible(); + return () => { + cancelAnimationFrame(frame); + stop(); + }; }, [selection, file.name]); const tools = (
diff --git a/tests/e2e/chrome-accessibility.spec.ts b/tests/e2e/chrome-accessibility.spec.ts index cd5bda7..e3b1c7a 100644 --- a/tests/e2e/chrome-accessibility.spec.ts +++ b/tests/e2e/chrome-accessibility.spec.ts @@ -1,3 +1,4 @@ +import { activeWorkspaceTab } from './support'; import { readFile, writeFile } from 'node:fs/promises'; import { test, expect, importWorkshop } from './support'; @@ -21,8 +22,8 @@ test('@critical exposes navigation disclosures and independent representation st ) .toBe(true); } - const rail = page.getByRole('navigation', { - name: 'Workspace activities', + const rail = page.getByRole('group', { + name: 'Workspace panels', exact: true, }); const hide = rail.getByRole('button', { name: 'Hide Explorer', exact: true }); @@ -54,21 +55,31 @@ test('@critical exposes navigation disclosures and independent representation st await expect( nav.getByRole('tree', { name: 'Model', exact: true }), ).toBeVisible(); - const table = page.getByRole('button', { - name: 'Requirements table', - exact: true, - }); + await page + .getByRole('button', { name: 'Open workspace tab', exact: true }) + .click(); + const table = page + .getByRole('dialog', { name: 'Open workspace tab', exact: true }) + .getByRole('button', { + name: 'Requirements table', + exact: true, + }); await table.focus(); await heard('Requirements table'); await table.press('Enter'); - await expect(table).toHaveAttribute('aria-pressed', 'true'); + await expect(activeWorkspaceTab(page)).toHaveText('Requirements table'); + await expect(activeWorkspaceTab(page)).toBeFocused(); await expect( page.getByRole('group', { name: 'Model header', exact: true }), ).toContainText('Project-wide requirements'); const header = await page .getByRole('group', { name: 'Model header', exact: true }) .ariaSnapshot(); - expect(header).toContain('button "Requirements table" [pressed]'); + expect( + await page + .getByRole('tablist', { name: 'Workspace documents', exact: true }) + .ariaSnapshot(), + ).toContain('tab "Requirements table" [selected]'); expect(header).not.toContain('Named view'); await page .getByRole('button', { name: 'Show source only', exact: true }) diff --git a/tests/e2e/default-example.spec.ts b/tests/e2e/default-example.spec.ts index 8680fbd..879863a 100644 --- a/tests/e2e/default-example.spec.ts +++ b/tests/e2e/default-example.spec.ts @@ -1,3 +1,4 @@ +import { activeWorkspaceTab } from './support'; import { readFile } from 'node:fs/promises'; import { test, @@ -15,9 +16,11 @@ test('imports the complete legacy Smart air workshop fixture in its workshop ove const evaluations = await observeEvaluations(page); await page.goto('/app'); await startExample(page, { split: false }); - await expect( - page.getByRole('combobox', { name: 'Named view', exact: true }), - ).toHaveValue('CompressorViews::overview', { timeout: 3000 }); + await expect(activeWorkspaceTab(page)).toHaveAttribute( + 'title', + 'view:' + 'CompressorViews::overview', + { timeout: 3000 }, + ); await waitForStartup(page, { split: false }); await expect( page.getByRole('banner').getByText('Smart air workshop', { exact: true }), diff --git a/tests/e2e/diagnostics.spec.ts b/tests/e2e/diagnostics.spec.ts index 943c4a0..c0d1248 100644 --- a/tests/e2e/diagnostics.spec.ts +++ b/tests/e2e/diagnostics.spec.ts @@ -11,7 +11,7 @@ import { diagramCamera, observeEvaluations, semanticPositions, - selectModelElement, + inspectModelElement, panDiagram, startExample, } from './support'; @@ -216,7 +216,8 @@ test('refuses navigation into a rejected semantic candidate that differs from th (window as typeof window & { diagnosticFault?: string }).diagnosticFault = 'candidate'; }); - await selectModelElement(page, 'Workshop::Motor'); + await inspectModelElement(page, 'Workshop::Motor'); + await page.getByText('Edit properties', { exact: true }).click(); await page.getByRole('textbox', { name: 'Name', exact: true }).fill('Drive'); await page .getByRole('button', { name: 'Review rename', exact: true }) diff --git a/tests/e2e/document-support.ts b/tests/e2e/document-support.ts index c6750f0..6bf15ef 100644 --- a/tests/e2e/document-support.ts +++ b/tests/e2e/document-support.ts @@ -1,3 +1,4 @@ +import { activeWorkspaceTab } from './support'; import type { Page } from '@playwright/test'; import { expect } from './support'; @@ -5,9 +6,10 @@ import { expect } from './support'; export async function openRoverReport(page: Page) { await page.goto('/app'); await page.getByRole('button', { name: 'Load example', exact: true }).click(); - await expect( - page.getByRole('combobox', { name: 'Named view', exact: true }), - ).toHaveValue('RoverViews::architecture'); + await expect(activeWorkspaceTab(page)).toHaveAttribute( + 'title', + 'view:' + 'RoverViews::architecture', + ); const show = page.getByRole('button', { name: 'Show Explorer', exact: true }); if (await show.isVisible()) await show.click(); const explorer = page.getByRole('complementary', { diff --git a/tests/e2e/documents.spec.ts b/tests/e2e/documents.spec.ts index 8da2278..199c811 100644 --- a/tests/e2e/documents.spec.ts +++ b/tests/e2e/documents.spec.ts @@ -1,3 +1,4 @@ +import { activeWorkspaceTab } from './support'; import { test, expect, @@ -16,9 +17,10 @@ test('@critical renders the rover report from the engine, reveals clicked declar page, }) => { const { pane } = await openRoverReport(page); - await expect( - page.getByRole('button', { name: 'Document', exact: true }), - ).toHaveAttribute('aria-pressed', 'true'); + await expect(activeWorkspaceTab(page)).toHaveAttribute( + 'title', + 'document:RoverReport::InspectionReport', + ); // Engine HTML keeps its semantic classes and model facts. const body = pane.locator('.document-body'); await expect(body.locator('article.sysml-document')).toHaveAttribute( @@ -103,12 +105,14 @@ test('@critical renders the rover report from the engine, reveals clicked declar await embedded .getByRole('button', { name: 'Open as named view', exact: true }) .click(); - await expect( - page.getByRole('button', { name: 'Diagram view', exact: true }), - ).toHaveAttribute('aria-pressed', 'true'); - await expect( - page.getByRole('combobox', { name: 'Named view', exact: true }), - ).toHaveValue('RoverViews::architecture'); + await expect(activeWorkspaceTab(page)).toHaveAttribute( + 'title', + 'view:RoverViews::architecture', + ); + await expect(activeWorkspaceTab(page)).toHaveAttribute( + 'title', + 'view:' + 'RoverViews::architecture', + ); }); test('keeps document source links reachable at the vertical pane minimum', async ({ @@ -121,7 +125,7 @@ test('keeps document source links reachable at the vertical pane minimum', async .click(); await hideExplorer(page); const before = (await downloadProject(page)).bundle; - await dragSeparator(page, 'Resize Source and Diagram', 'y', 2000); + await dragSeparator(page, 'Resize Source and Diagram', 'y', -2000); const reference = pane.getByRole('link', { name: 'rover', exact: true }); await reference.focus(); await expect.poll(() => controlReachable(reference)).toBe(true); @@ -358,9 +362,10 @@ test('preserves the document, draft and pane lifetime across narrow arrangement ).toHaveAttribute('aria-pressed', 'true'); expect(await body!.evaluate((element) => element.isConnected)).toBe(true); } - await expect( - page.getByRole('button', { name: 'Document', exact: true }), - ).toHaveAttribute('aria-pressed', 'true'); + await expect(activeWorkspaceTab(page)).toHaveAttribute( + 'title', + 'document:RoverReport::InspectionReport', + ); await expect(source).toHaveSource(draft); expect((await downloadProject(page)).bundle).toEqual(before); const embedded = pane.getByRole('group', { diff --git a/tests/e2e/editor-tour.spec.ts b/tests/e2e/editor-tour.spec.ts index a6ad69b..9d2b294 100644 --- a/tests/e2e/editor-tour.spec.ts +++ b/tests/e2e/editor-tour.spec.ts @@ -23,7 +23,7 @@ test('editor guide is optional, keyboard accessible and preserves the project', await expect(guide).toContainText('Find your files and views'); await expect(guide).toContainText('1 of 5'); await expect(guide).toHaveAccessibleDescription( - /1 of 5.*Find your files and views.*Explorer activity button/, + /1 of 5.*Find your files and views.*header Explorer toggle/, ); await expect(guide.locator('[aria-live="polite"]')).toHaveAttribute( 'aria-atomic', diff --git a/tests/e2e/exploration-support.ts b/tests/e2e/exploration-support.ts index b18f87d..59aae4b 100644 --- a/tests/e2e/exploration-support.ts +++ b/tests/e2e/exploration-support.ts @@ -21,7 +21,7 @@ export async function noViews(page: Page) { })), ); await expect( - page.getByRole('combobox', { name: 'Exploration scope', exact: true }), + page.getByRole('button', { name: 'Change exploration scope', exact: true }), ).toBeEnabled(); await expect( page @@ -47,7 +47,7 @@ export async function assemblyExploration(page: Page) { page.getByRole('group', { name: 'package Assembly', exact: true }), ).toBeVisible(); await expect( - page.getByRole('combobox', { name: 'Exploration scope', exact: true }), + page.getByRole('button', { name: 'Change exploration scope', exact: true }), ).toBeEnabled(); return [{ name: 'assembly.sysml', text }]; } diff --git a/tests/e2e/exploration.spec.ts b/tests/e2e/exploration.spec.ts index b930a2b..80bbd7a 100644 --- a/tests/e2e/exploration.spec.ts +++ b/tests/e2e/exploration.spec.ts @@ -1,3 +1,5 @@ +import { selectExplorationScope } from './support'; +import { activeWorkspaceTab, openNamedView } from './support'; import { test, expect, @@ -116,15 +118,15 @@ test('@critical opens a no-view multi-file model as an overview and distinguishe expect(before.documents).toEqual(documents); expect(before.drafts).toEqual(documents); expect(before.presentations).toEqual({}); - const scope = page.getByRole('combobox', { - name: 'Exploration scope', + const scope = page.getByRole('button', { + name: 'Change exploration scope', exact: true, }); const representation = page.getByRole('combobox', { name: 'Exploration representation', exact: true, }); - await scope.selectOption('P'); + await selectExplorationScope(page, 'P'); await expect(scope).toBeEnabled(); await expect(scope).toBeFocused(); await expect @@ -133,7 +135,7 @@ test('@critical opens a no-view multi-file model as an overview and distinguishe await expect( representation.getByRole('option', { name: 'Structure', exact: true }), ).toBeDisabled(); - await scope.selectOption('P::System'); + await selectExplorationScope(page, 'P::System'); await expect(scope).toBeEnabled(); await representation.selectOption('interconnection'); await expect(representation).toBeEnabled(); @@ -183,7 +185,7 @@ test('@critical opens a no-view multi-file model as an overview and distinguishe await expect .poll(() => copySourceSelection(source)) .toBe('part primary : Q::Motor;'); - await scope.selectOption('P::system'); + await selectExplorationScope(page, 'P::system'); await expect(scope).toBeEnabled(); await representation.selectOption('interconnection'); await expect(representation).toBeEnabled(); @@ -198,7 +200,7 @@ test('@critical opens a no-view multi-file model as an overview and distinguishe ).toBeVisible(); await page.getByRole('button', { name: 'other.sysml', exact: true }).click(); await expect(source).toHaveSource(documents[1]!.text); - await expect(scope).toHaveValue('P::system'); + await expect(scope).toHaveAttribute('title', 'P::system'); await expect(representation).toHaveValue('interconnection'); await expect( page.getByRole('button', { name: 'New part', exact: true }), @@ -223,18 +225,18 @@ test('exploration preserves invalid drafts and independent named-view geometry a (await readSource(source)) + '\n// preserved while browsing\npart'; await fillSource(source, draft); const expected = await downloadProject(page); - const named = page.getByRole('combobox', { name: 'Named view', exact: true }); - await named.selectOption(''); - const scope = page.getByRole('combobox', { - name: 'Exploration scope', + const named = activeWorkspaceTab(page); + await openNamedView(page, ''); + const scope = page.getByRole('button', { + name: 'Change exploration scope', exact: true, }); await expect(scope).toBeEnabled(); - await scope.selectOption('Workshop'); + await selectExplorationScope(page, 'Workshop'); await expect(scope).toBeEnabled(); await expect(source).toHaveSource(draft); expect((await downloadProject(page)).bundle).toEqual(expected.bundle); - await named.selectOption('WorkshopViews::overview'); + await openNamedView(page, 'WorkshopViews::overview'); await expect(scope).not.toBeVisible(); await expectRenderedPositions(page, before, 'WorkshopViews::overview'); expect((await downloadProject(page)).bundle).toEqual(expected.bundle); @@ -259,8 +261,8 @@ test('an actual exploration engine asset failure preserves the old scope, diagra }) => { await noViews(page); const before = (await downloadProject(page)).bundle; - const scope = page.getByRole('combobox', { - name: 'Exploration scope', + const scope = page.getByRole('button', { + name: 'Change exploration scope', exact: true, }); let failures = 0; @@ -272,19 +274,19 @@ test('an actual exploration engine asset failure preserves the old scope, diagra body: 'Controlled exploration failure', }); }); - await scope.selectOption('P'); + await selectExplorationScope(page, 'P'); await expect.poll(() => failures).toBeGreaterThan(0); await expect( page.getByText('OpenSysML browser assets are unavailable.', { exact: true, }), ).toBeVisible(); - await expect(scope).toHaveValue(''); + await expect(scope).toHaveAttribute('title', 'Project overview'); expect((await downloadProject(page)).bundle).toEqual(before); await page.unroute(asset); - await scope.selectOption('P'); + await selectExplorationScope(page, 'P'); await expect(scope).toBeEnabled(); - await expect(scope).toHaveValue('P'); + await expect(scope).toHaveAttribute('title', 'P'); expect((await downloadProject(page)).bundle).toEqual(before); }); @@ -309,8 +311,8 @@ test('shows the entire qualified scope and its definition/usage kind at narrow w buffer: Buffer.from(file.text), })), ); - const scope = page.getByRole('combobox', { - name: 'Exploration scope', + const scope = page.getByRole('button', { + name: 'Change exploration scope', exact: true, }); await expect(scope).toBeEnabled(); @@ -328,7 +330,7 @@ test('shows the entire qualified scope and its definition/usage kind at narrow w await expect( page.getByRole('button', { name: 'Show Explorer', exact: true }), ).toBeVisible(); - await scope.selectOption(target); + await selectExplorationScope(page, target); await expect(scope).toBeEnabled(); const caption = page.getByRole('group', { name: 'Current exploration scope', @@ -337,7 +339,7 @@ test('shows the entire qualified scope and its definition/usage kind at narrow w await expect(caption).toContainText(target); await expect(caption).toContainText('Part definition'); await expect.poll(() => explorationScopeFits(page)).toBe(true); - await scope.selectOption(prefix + '::installedDrive'); + await selectExplorationScope(page, prefix + '::installedDrive'); await expect(scope).toBeEnabled(); await expect(caption).toContainText(prefix + '::installedDrive'); await expect(caption).toContainText('Part usage'); @@ -375,7 +377,7 @@ test('retries an initial exploration asset failure without reopening or changing const before = (await downloadProject(page)).bundle; expect(before.documents).toEqual(documents); await expect( - page.getByRole('combobox', { name: 'Exploration scope', exact: true }), + page.getByRole('button', { name: 'Change exploration scope', exact: true }), ).not.toBeVisible(); const retry = page.getByRole('button', { name: 'Explore model', @@ -386,14 +388,14 @@ test('retries an initial exploration asset failure without reopening or changing await retry.focus(); await retry.press('Enter'); await expect( - page.getByRole('combobox', { name: 'Exploration scope', exact: true }), + page.getByRole('button', { name: 'Change exploration scope', exact: true }), ).toBeEnabled(); await expect( page.getByRole('group', { name: 'part def System', exact: true }), ).toBeVisible(); await expect(retry).not.toBeVisible(); await expect( - page.getByRole('combobox', { name: 'Exploration scope', exact: true }), + page.getByRole('button', { name: 'Change exploration scope', exact: true }), ).toBeFocused(); await page .getByRole('button', { name: 'Show source and model', exact: true }) diff --git a/tests/e2e/explorer-sections.spec.ts b/tests/e2e/explorer-sections.spec.ts index 8039072..fb5289a 100644 --- a/tests/e2e/explorer-sections.spec.ts +++ b/tests/e2e/explorer-sections.spec.ts @@ -10,7 +10,7 @@ import { namedViewButton, } from './support'; -test('@critical preserves independent Explorer sections and navigation across activity rail toggles', async ({ +test('@critical preserves independent Explorer sections and navigation across header panel toggles', async ({ page, }) => { await ready(page); @@ -18,11 +18,16 @@ test('@critical preserves independent Explorer sections and navigation across ac name: 'Project navigation', exact: true, }); - const rail = page.getByRole('navigation', { - name: 'Workspace activities', + const rail = page.getByRole('group', { + name: 'Workspace panels', exact: true, }); - await expect(rail.getByRole('button')).toHaveCount(1); + await expect( + rail.getByRole('button', { name: 'Hide Explorer', exact: true }), + ).toHaveCount(1); + await expect( + page.getByRole('navigation', { name: 'Workspace activities', exact: true }), + ).toHaveCount(0); const files = nav.getByRole('button', { name: 'Files', exact: true }); const views = nav.getByRole('button', { name: 'Views', exact: true }); const model = nav.getByRole('button', { name: 'Model', exact: true }); @@ -96,8 +101,8 @@ test('keeps New view separate from the collapsed Views toggle and keeps phone fo }) => { await ready(page, { split: false }); await page.setViewportSize({ width: 390, height: 900 }); - const rail = page.getByRole('navigation', { - name: 'Workspace activities', + const rail = page.getByRole('group', { + name: 'Workspace panels', exact: true, }); const show = rail.getByRole('button', { name: 'Show Explorer', exact: true }); @@ -123,7 +128,7 @@ test('keeps New view separate from the collapsed Views toggle and keeps phone fo await expect(show).toBeFocused(); await show.press('Enter'); await expect( - page.getByRole('button', { name: 'Collapse Explorer', exact: true }), + page.getByRole('button', { name: 'Hide Explorer', exact: true }), ).toBeFocused(); await expect(views).toHaveAttribute('aria-expanded', 'false'); expect((await downloadProject(page)).bundle).toEqual(before); diff --git a/tests/e2e/inherited-members.spec.ts b/tests/e2e/inherited-members.spec.ts index a693438..a0da16b 100644 --- a/tests/e2e/inherited-members.spec.ts +++ b/tests/e2e/inherited-members.spec.ts @@ -1,3 +1,4 @@ +import { activeWorkspaceTab } from './support'; import { readFile } from 'node:fs/promises'; import type { Page } from '@playwright/test'; import type { EvaluatedView } from '../../src/lib/workspace/views'; @@ -41,9 +42,10 @@ async function importProject(page: Page, buffer: Buffer) { mimeType: 'application/json', buffer, }); - await expect( - page.getByRole('combobox', { name: 'Named view', exact: true }), - ).toHaveValue(both); + await expect(activeWorkspaceTab(page)).toHaveAttribute( + 'title', + 'view:' + both, + ); await expect( page.getByRole('button', { name: 'Download project', exact: true }), ).toBeEnabled(); @@ -119,6 +121,9 @@ async function inspect( await expect(node).toBeVisible(); await node.focus(); await page.keyboard.press('Enter'); + await page + .getByRole('button', { name: 'Inspect selection', exact: true }) + .click(); const properties = page.getByRole('complementary', { name: 'Properties', exact: true, diff --git a/tests/e2e/inspection.spec.ts b/tests/e2e/inspection.spec.ts index 3d6a82a..2e31def 100644 --- a/tests/e2e/inspection.spec.ts +++ b/tests/e2e/inspection.spec.ts @@ -1,3 +1,5 @@ +import { openProjectData } from './support'; +import { activeWorkspaceTab } from './support'; import { readFile } from 'node:fs/promises'; import { test, @@ -11,7 +13,7 @@ import { loadRequirementsTraceability, } from './requirements-support'; -test('@critical tree selection reveals hidden details while retaining the current draft and view', async ({ +test('@critical explicit inspection reveals selected details while retaining the current draft and view', async ({ page, }) => { await page.goto('/app'); @@ -34,12 +36,9 @@ test('@critical tree selection reveals hidden details while retaining the curren }); await fillSource(source, draft); const before = (await downloadProject(page)).bundle; - await page - .getByRole('button', { name: 'Collapse Inspector', exact: true }) - .click(); await expect( page.getByRole('button', { name: 'Show Inspector', exact: true }), - ).toBeFocused(); + ).toBeVisible(); const reading = modelTreeItem(page, 'Reading'); await reading.focus(); await expect(reading).toBeFocused(); @@ -47,17 +46,27 @@ test('@critical tree selection reveals hidden details while retaining the curren const selected = modelTreeItem(page, 'Reading::small'); await selected.focus(); await page.keyboard.press('Enter'); + await expect(selected).toBeFocused(); + await expect( + page.getByRole('complementary', { name: 'Properties', exact: true }), + ).toBeHidden(); + await page + .getByRole('button', { name: 'Inspect selection', exact: true }) + .click(); const properties = page.getByRole('complementary', { name: 'Properties', exact: true, }); await expect(properties).toBeVisible({ timeout: 1500 }); await expect(properties).toContainText('Reading::small'); - await expect(selected).toBeFocused(); - await expect(source).toHaveSource(draft); await expect( - page.getByRole('combobox', { name: 'Named view', exact: true }), - ).toHaveValue('ReadingViews::configurations'); + page.getByRole('button', { name: 'Inspect selection', exact: true }), + ).toBeFocused(); + await expect(source).toHaveSource(draft); + await expect(activeWorkspaceTab(page)).toHaveAttribute( + 'title', + 'view:' + 'ReadingViews::configurations', + ); expect((await downloadProject(page)).bundle).toEqual(before); }); @@ -69,12 +78,7 @@ test('@critical table selection opens details without automatically navigating t await page .getByRole('button', { name: 'Show model only', exact: true }) .click(); - await page - .getByRole('button', { name: 'Collapse Inspector', exact: true }) - .click(); - await page - .getByRole('button', { name: 'Requirements table', exact: true }) - .click(); + await openProjectData(page, 'Requirements table'); const table = page.getByRole('region', { name: 'Requirements table', exact: true, @@ -120,9 +124,10 @@ for (const theme of ['light', 'dark']) { buffer: Buffer.from(document.text), })), ); - await expect( - page.getByRole('combobox', { name: 'Named view', exact: true }), - ).toHaveValue('TraceViews::requirements'); + await expect(activeWorkspaceTab(page)).toHaveAttribute( + 'title', + 'view:' + 'TraceViews::requirements', + ); await expect( page.getByRole('button', { name: 'Download project', exact: true }), ).toBeEnabled(); @@ -133,9 +138,7 @@ for (const theme of ['light', 'dark']) { }); await appearance.getByLabel('Theme', { exact: true }).selectOption(theme); await appearance.getByRole('button', { name: 'Done', exact: true }).click(); - await page - .getByRole('button', { name: 'Requirements table', exact: true }) - .click(); + await openProjectData(page, 'Requirements table'); const before = (await downloadProject(page)).bundle; const table = page.getByRole('region', { name: 'Requirements table', @@ -183,9 +186,7 @@ test('@critical anonymous requirement inspection retains extracted documentation await expect( page.getByRole('button', { name: 'Download project', exact: true }), ).toBeEnabled(); - await page - .getByRole('button', { name: 'Requirements table', exact: true }) - .click(); + await openProjectData(page, 'Requirements table'); const table = page.getByRole('region', { name: 'Requirements table', exact: true, diff --git a/tests/e2e/model-first-layout.spec.ts b/tests/e2e/model-first-layout.spec.ts new file mode 100644 index 0000000..efc16df --- /dev/null +++ b/tests/e2e/model-first-layout.spec.ts @@ -0,0 +1,354 @@ +import { + test, + expect, + ready, + readSource, + fillSource, + downloadProject, + diagramCamera, + importWorkshop, + copySourceSelection, + sourceScroll, + controlReachable, +} from './support'; + +test('@critical model-first panels preserve the editor, draft, camera and project through focus and maximise', async ({ + page, +}) => { + await ready(page, { split: false, inspection: false }); + await expect( + page.getByRole('complementary', { name: 'Properties', exact: true }), + ).toBeHidden(); + await page.getByRole('button', { name: 'Show Source', exact: true }).click(); + const source = page.getByRole('textbox', { + name: 'SysML source', + exact: true, + }); + await expect(source).toBeVisible(); + const draft = (await readSource(source)) + '\n// retained panel draft'; + await fillSource(source, draft); + const editor = await source.elementHandle(); + const bundle = (await downloadProject(page)).bundle; + const camera = await diagramCamera(page); + await page + .getByRole('button', { name: 'Inspect selection', exact: true }) + .click(); + await expect( + page.getByRole('complementary', { name: 'Properties', exact: true }), + ).toBeVisible(); + for (const name of [ + 'Focus model', + 'Restore workspace', + 'Maximize Source', + 'Restore Source', + 'Maximize Explorer', + 'Restore Explorer', + 'Hide Source', + 'Show Source', + ]) { + await page.getByRole('button', { name, exact: true }).click(); + expect(await editor!.evaluate((node) => node.isConnected)).toBe(true); + if (name === 'Maximize Explorer') { + await expect + .poll(async () => { + const navigation = await page + .getByRole('complementary', { + name: 'Project navigation', + exact: true, + }) + .boundingBox(); + const workspace = await page + .getByRole('main', { name: 'Model workspace', exact: true }) + .boundingBox(); + return workspace!.width - navigation!.width; + }) + .toBeLessThan(4); + } + if ( + await page + .getByRole('region', { name: 'Diagram', exact: true }) + .isVisible() + ) { + expect(await diagramCamera(page)).toEqual(camera); + } + } + await expect(source).toHaveSource(draft); + expect((await downloadProject(page)).bundle).toEqual(bundle); + await source.press('Control+z'); + await expect(source).not.toHaveSource(draft); +}); + +test('selection does not force inspection and explicit inspection can be closed with focus return', async ({ + page, +}) => { + await ready(page, { split: false, inspection: false }); + await page + .getByRole('group', { name: 'part pump : Pump', exact: true }) + .getByText('pump', { exact: true }) + .click(); + await expect( + page.getByRole('complementary', { name: 'Properties', exact: true }), + ).toBeHidden(); + await page + .getByRole('button', { name: 'Inspect selection', exact: true }) + .click(); + await expect( + page.getByRole('complementary', { name: 'Properties', exact: true }), + ).toContainText('pump'); + const propertiesTab = page.getByRole('tab', { + name: 'Properties', + exact: true, + }); + await propertiesTab.focus(); + await propertiesTab.press('ArrowRight'); + await expect( + page.getByRole('tab', { name: 'Relationships', exact: true }), + ).toBeFocused(); + await expect( + page.getByRole('region', { + name: 'Relationships in current view', + exact: true, + }), + ).toContainText('pump'); + await page.setViewportSize({ width: 390, height: 900 }); + for (const name of ['Maximize Inspector', 'Collapse Inspector']) { + const control = page.getByRole('button', { name, exact: true }); + await expect + .poll(() => controlReachable(control), { timeout: 5000 }) + .toBe(true); + } + await page + .getByRole('button', { name: 'Collapse Inspector', exact: true }) + .click(); + await expect( + page.getByRole('button', { name: 'Show Inspector', exact: true }), + ).toBeFocused(); +}); + +for (const theme of ['light', 'dark']) { + test(`keeps model-first panels usable at desktop and narrow widths in ${theme}`, async ({ + page, + }, info) => { + await ready(page, { split: false, inspection: false }); + await page.getByRole('button', { name: 'Appearance', exact: true }).click(); + const dialog = page.getByRole('dialog', { + name: 'Appearance', + exact: true, + }); + await dialog.getByLabel('Theme', { exact: true }).selectOption(theme); + await dialog.getByRole('button', { name: 'Close', exact: true }).click(); + await page + .getByRole('button', { name: 'Show Source', exact: true }) + .click(); + await page + .getByRole('group', { name: 'part pump : Pump', exact: true }) + .getByText('pump', { exact: true }) + .click(); + await page + .getByRole('button', { name: 'Inspect selection', exact: true }) + .click(); + for (const width of [1440, 768, 390, 1440]) { + await page.setViewportSize({ width, height: 900 }); + await expect( + page.getByRole('textbox', { name: 'SysML source', exact: true }), + ).toBeVisible(); + const apply = page.getByRole('button', { + name: 'Apply source', + exact: true, + }); + await expect(apply).toBeVisible(); + expect( + await apply.evaluate((node) => { + const b = node.getBoundingClientRect(); + return ( + b.width > 0 && + b.x >= 0 && + b.right <= window.innerWidth && + b.y >= 0 && + b.bottom <= window.innerHeight + ); + }), + ).toBe(true); + await page.screenshot({ path: info.outputPath(`${theme}-${width}.png`) }); + } + }); +} + +test('source tabs retain each draft and undo history without changing applied sources', async ({ + page, +}) => { + await ready(page, { inspection: false }); + const source = page.getByRole('textbox', { + name: 'SysML source', + exact: true, + }); + const bundle = (await downloadProject(page)).bundle; + const original = await readSource(source); + const first = original + '\n// first file draft'; + await fillSource(source, first); + await source.press('Shift+Home'); + const selection = await copySourceSelection(source); + const scroll = await sourceScroll(source); + expect(scroll).toBeGreaterThan(0); + await page + .getByRole('button', { name: 'components.sysml', exact: true }) + .click(); + const components = await readSource(source); + const second = components + '\n// second file draft'; + await fillSource(source, second); + const tabs = page.getByRole('tablist', { name: 'Source files', exact: true }); + await tabs.getByRole('tab', { name: 'system.sysml', exact: true }).click(); + // Observe restored scroll before clipboard verification focuses the editor. + await expect.poll(() => sourceScroll(source)).toBeCloseTo(scroll, 0); + expect(await copySourceSelection(source)).toBe(selection); + await expect(source).toHaveSource(first); + await source.press('Control+z'); + await expect(source).toHaveSource(original); + await tabs + .getByRole('tab', { name: 'components.sysml', exact: true }) + .click(); + await expect(source).toHaveSource(second); + await tabs + .getByRole('button', { name: 'Close components.sysml tab', exact: true }) + .click(); + await expect( + tabs.getByRole('tab', { name: 'system.sysml', exact: true }), + ).toHaveAttribute('aria-selected', 'true'); + await page + .getByRole('button', { name: 'components.sysml', exact: true }) + .click(); + await expect(source).toHaveSource(second); + await source.press('Control+z'); + await expect(source).toHaveSource(components); + expect((await downloadProject(page)).bundle).toEqual(bundle); +}); + +test('workspace tabs and model history restore the camera and preserve project data', async ({ + page, +}) => { + await page.goto('/app'); + await importWorkshop(page); + const before = (await downloadProject(page)).bundle; + await page.getByRole('button', { name: 'Read at 100%', exact: true }).click(); + await expect(page.getByLabel('Current zoom', { exact: true })).toHaveText( + '100%', + ); + const camera = await diagramCamera(page); + await page.getByRole('button', { name: 'compressor', exact: true }).click(); + const tabs = page.getByRole('tablist', { + name: 'Workspace documents', + exact: true, + }); + await expect( + tabs.getByRole('tab', { name: 'compressor', exact: true }), + ).toHaveAttribute('aria-selected', 'true'); + await tabs.getByRole('tab', { name: 'overview', exact: true }).click(); + await expect.poll(() => diagramCamera(page)).toEqual(camera); + await page + .getByRole('button', { name: 'Project overview', exact: true }) + .click(); + await expect( + tabs.getByRole('tab', { name: 'Project overview', exact: true }), + ).toHaveAttribute('aria-selected', 'true'); + await page + .getByRole('button', { name: 'Back in model', exact: true }) + .click(); + await expect( + tabs.getByRole('tab', { name: 'overview', exact: true }), + ).toHaveAttribute('aria-selected', 'true'); + await expect.poll(() => diagramCamera(page)).toEqual(camera); + await page + .getByRole('button', { name: 'Forward in model', exact: true }) + .click(); + await expect( + tabs.getByRole('tab', { name: 'Project overview', exact: true }), + ).toHaveAttribute('aria-selected', 'true'); + await tabs + .getByRole('button', { name: 'Close Project overview tab', exact: true }) + .click(); + await expect( + tabs.getByRole('tab', { name: 'Project overview', exact: true }), + ).toHaveCount(0); + expect((await downloadProject(page)).bundle).toEqual(before); +}); + +for (const delayed of [false, true]) { + test(`explicit source reveal leaves a maximised inspection panel${delayed ? ' after delayed layout' : ''}`, async ({ + page, + }) => { + await ready(page, { split: false, inspection: false }); + await page + .getByRole('group', { name: 'part pump : Pump', exact: true }) + .getByText('pump', { exact: true }) + .click(); + await page + .getByRole('button', { name: 'Inspect selection', exact: true }) + .click(); + const before = (await downloadProject(page)).bundle; + await page + .getByRole('button', { name: 'Maximize Inspector', exact: true }) + .click(); + const source = page.getByRole('textbox', { + name: 'SysML source', + exact: true, + }); + await expect(source).toBeHidden(); + // Controlled layout delay: keep the mounted editor unmeasurable beyond the + // former two-frame focus budget, then permit the real panel to settle. + const delay = delayed + ? await page.addStyleTag({ + content: '.source-editor { display: none !important; }', + }) + : null; + await page + .getByRole('complementary', { name: 'Properties', exact: true }) + .getByRole('button', { name: 'Open source', exact: true }) + .click(); + if (delay) { + await expect(page.locator('#workspace-source')).not.toHaveAttribute( + 'hidden', + ); + await page.evaluate( + () => + new Promise((resolve) => { + let remaining = 4; + const next = () => + --remaining ? requestAnimationFrame(next) : resolve(); + requestAnimationFrame(next); + }), + ); + await delay.evaluate((element) => + element.parentNode?.removeChild(element), + ); + } + await expect(source).toBeVisible(); + await expect(source).toBeFocused(); + expect(await copySourceSelection(source)).toContain('pump'); + expect((await downloadProject(page)).bundle).toEqual(before); + }); +} + +test('project replacement does not replay old panel reveal requests or editor history', async ({ + page, +}) => { + await ready(page, { split: false, inspection: false }); + await downloadProject(page); + const source = page.getByRole('textbox', { + name: 'SysML source', + exact: true, + }); + await page + .getByRole('button', { name: 'components.sysml', exact: true }) + .click(); + await expect(source).toBeVisible(); + await page.getByRole('button', { name: 'Hide Source', exact: true }).click(); + await expect(source).toBeHidden(); + await importWorkshop(page); + await expect(source).toBeHidden({ timeout: 5000 }); + const replacement = (await downloadProject(page)).bundle; + await page.getByRole('button', { name: 'Show Source', exact: true }).click(); + await expect(source).toHaveSource(replacement.drafts[0]!.text); + await source.press('Control+z'); + await expect(source).toHaveSource(replacement.drafts[0]!.text); + expect((await downloadProject(page)).bundle).toEqual(replacement); +}); diff --git a/tests/e2e/model-header.spec.ts b/tests/e2e/model-header.spec.ts index c0f475a..b475bd5 100644 --- a/tests/e2e/model-header.spec.ts +++ b/tests/e2e/model-header.spec.ts @@ -1,3 +1,4 @@ +import { activeWorkspaceTab, selectExplorationScope } from './support'; import { ready, dragSeparator, @@ -10,11 +11,14 @@ import { downloadProject, observeEvaluations, namedViewButton, + openProjectData, + openNamedView, } from './support'; -test('@critical keeps one Model header and preserves independent representation, arrangement and drafts', async ({ +test('@critical opens project data as workspace tabs without duplicate view controls and preserves drafts and mounted panes', async ({ page, }) => { + await page.emulateMedia({ reducedMotion: 'reduce' }); const evaluations = await observeEvaluations(page); await page.goto('/app'); await importWorkshop(page); @@ -23,15 +27,16 @@ test('@critical keeps one Model header and preserves independent representation, .click(); const header = page.getByRole('group', { name: 'Model header', exact: true }); await expect(header).toBeVisible(); - await expect( - header.getByText('Representation', { exact: true }), - ).toBeVisible(); - await expect( - header.getByRole('combobox', { name: 'Named view', exact: true }), - ).toHaveValue('WorkshopViews::overview'); await expect( page.getByRole('combobox', { name: 'Named view', exact: true }), - ).toHaveCount(1); + ).toHaveCount(0); + await expect( + page.getByRole('group', { name: 'Model representation', exact: true }), + ).toHaveCount(0); + await expect(activeWorkspaceTab(page)).toHaveAttribute( + 'title', + 'view:WorkshopViews::overview', + ); const source = page.getByRole('textbox', { name: 'SysML source', exact: true, @@ -48,21 +53,11 @@ test('@critical keeps one Model header and preserves independent representation, const saved = (await downloadProject(page)).bundle; const evaluationCount = evaluations.length; for (const representation of ['Requirements table', 'Traceability matrix']) { - const button = header.getByRole('button', { - name: representation, - exact: true, - }); - await button.focus(); - await button.press('Enter'); - await expect(button).toBeFocused(); - await expect(button).toHaveAttribute('aria-pressed', 'true'); + await openProjectData(page, representation); await expect( header.getByText('Project-wide requirements', { exact: true }), ).toBeVisible(); await expect(header).toContainText('Applied revision · draft pending'); - await expect( - page.getByRole('combobox', { name: 'Named view', exact: true }), - ).toHaveCount(0); await expect( page.getByRole('button', { name: 'Fit view', exact: true }), ).toHaveCount(0); @@ -74,13 +69,14 @@ test('@critical keeps one Model header and preserves independent representation, expect((await downloadProject(page)).bundle).toEqual(saved); expect(evaluations).toHaveLength(evaluationCount); } - await namedViewButton(page, 'WorkshopViews::overview').click(); - await expect( - header.getByRole('button', { name: 'Diagram view', exact: true }), - ).toHaveAttribute('aria-pressed', 'true'); - await expect( - header.getByRole('combobox', { name: 'Named view', exact: true }), - ).toHaveValue('WorkshopViews::overview'); + await page + .getByRole('tablist', { name: 'Workspace documents', exact: true }) + .getByRole('tab', { name: 'overview', exact: true }) + .click(); + await expect(activeWorkspaceTab(page)).toHaveAttribute( + 'title', + 'view:WorkshopViews::overview', + ); await expect(source).toHaveSource(draft); expect((await downloadProject(page)).bundle).toEqual(saved); }); @@ -131,7 +127,7 @@ test('reports current model work and unavailable rendering without duplicating d 'Updating model… · showing applied revision', ); await expect( - header.getByRole('button', { name: 'Requirements table', exact: true }), + page.getByRole('button', { name: 'Open workspace tab', exact: true }), ).toBeDisabled(); } finally { release(); @@ -139,12 +135,12 @@ test('reports current model work and unavailable rendering without duplicating d await expect( page.getByRole('button', { name: 'Apply source', exact: true }), ).toBeDisabled(); - await expect(header).toContainText('Applied model'); + await expect(header).not.toContainText('draft pending'); await expect(header).not.toContainText('Updating model…'); await page.unroute(asset); }); -test('@critical keeps Model representation and target controls keyboard reachable at the vertical minimum', async ({ +test('@critical keeps the content picker and contextual actions keyboard reachable at the vertical minimum', async ({ page, }) => { await page.setViewportSize({ width: 390, height: 900 }); @@ -154,24 +150,231 @@ test('@critical keeps Model representation and target controls keyboard reachabl .getByRole('button', { name: 'Show source and model', exact: true }) .click(); const saved = (await downloadProject(page)).bundle; - await dragSeparator(page, 'Resize Source and Diagram', 'y', 2000); - const header = page.getByRole('group', { name: 'Model header', exact: true }); - for (const name of [ - 'Requirements table', - 'Traceability matrix', - 'Diagram view', - ]) { - const button = header.getByRole('button', { name, exact: true }); - await button.focus(); - await expect.poll(() => controlReachable(button)).toBe(true); - await button.press('Enter'); - await expect(button).toBeFocused(); - } - const target = header.getByRole('combobox', { - name: 'Named view', + await dragSeparator(page, 'Resize Source and Diagram', 'y', -2000); + const opener = page.getByRole('button', { + name: 'Open workspace tab', + exact: true, + }); + await opener.focus(); + await expect.poll(() => controlReachable(opener)).toBe(true); + await opener.press('Enter'); + const picker = page.getByRole('dialog', { + name: 'Open workspace tab', exact: true, }); - await target.focus(); - await expect.poll(() => controlReachable(target)).toBe(true); + await expect(picker).toBeVisible(); + const requirements = picker.getByRole('button', { + name: 'Requirements table', + exact: true, + }); + await requirements.focus(); + await expect.poll(() => controlReachable(requirements)).toBe(true); + await requirements.press('Escape'); + await expect(picker).not.toBeVisible(); + await expect(opener).toBeFocused(); + for (const name of ['Requirements table', 'Traceability matrix']) + await openProjectData(page, name); + await openNamedView(page, 'WorkshopViews::overview'); + await activeWorkspaceTab(page).focus(); + await expect + .poll(() => controlReachable(activeWorkspaceTab(page))) + .toBe(true); expect((await downloadProject(page)).bundle).toEqual(saved); }); + +test('closes the content picker across browser route changes while preserving the live project and draft', async ({ + page, +}) => { + await ready(page); + const source = page.getByRole('textbox', { + name: 'SysML source', + exact: true, + }); + const draft = + (await readSource(source)) + + '\n// retained while leaving the content picker\n'; + await fillSource(source, draft); + const editor = await source.elementHandle(); + const before = (await downloadProject(page)).bundle; + await page + .getByRole('link', { name: 'OpenMBEE View Editor home', exact: true }) + .click(); + await expect(page).toHaveURL(/\/$/); + await page.goBack(); + await expect(page).toHaveURL(/\/app$/); + await page + .getByRole('button', { name: 'Open workspace tab', exact: true }) + .click(); + const picker = page.getByRole('dialog', { + name: 'Open workspace tab', + exact: true, + }); + await expect(picker).toBeVisible(); + await page.goForward(); + await expect(page).toHaveURL(/\/$/); + await expect(picker).not.toBeVisible(); + await page.goBack(); + await expect(page).toHaveURL(/\/app$/); + await expect(picker).not.toBeVisible(); + await expect(source).toHaveSource(draft); + expect(await editor!.evaluate((node) => node.isConnected)).toBe(true); + expect((await downloadProject(page)).bundle).toEqual(before); +}); + +test('dismisses the picker without blocking panel controls after a viewport change', async ({ + page, +}) => { + await ready(page, { split: false, inspection: false }); + const trigger = page.getByRole('button', { + name: 'Open workspace tab', + exact: true, + }); + await trigger.focus(); + await trigger.press('Enter'); + const picker = page.getByRole('dialog', { + name: 'Open workspace tab', + exact: true, + }); + await expect(picker).toBeVisible(); + await page.keyboard.press('Escape'); + await expect(picker).not.toBeVisible(); + await expect(trigger).toBeFocused(); + await page.setViewportSize({ width: 390, height: 900 }); + await page + .getByRole('button', { name: 'Hide Explorer', exact: true }) + .click(); + await expect( + page.getByRole('complementary', { + name: 'Project navigation', + exact: true, + }), + ).not.toBeVisible(); + await expect( + page.getByRole('button', { name: 'Show Explorer', exact: true }), + ).toBeVisible(); +}); + +test('shows exploration scope once with an on-demand chooser and one view-type control', async ({ + page, +}) => { + await page.goto('/app'); + await page.locator('input[type=file]').setInputFiles({ + name: 'scope.sysml', + mimeType: 'text/plain', + buffer: Buffer.from('package P { part def System { part child; } }'), + }); + await expect( + page + .getByRole('region', { name: 'Diagram', exact: true }) + .getByRole('group', { name: 'part def System', exact: true }), + ).toBeVisible(); + const header = page.getByRole('group', { name: 'Model header', exact: true }); + await expect(header.getByText('Scope', { exact: true })).toHaveCount(0); + await expect(header.getByText('Representation', { exact: true })).toHaveCount( + 0, + ); + await expect( + header.getByRole('combobox', { name: 'Exploration scope', exact: true }), + ).toHaveCount(0); + await expect( + header.getByText('Ownership overview', { exact: true }), + ).toHaveCount(1); + await expect( + header.getByText('Applied model · Temporary exploration', { exact: true }), + ).toHaveCount(0); + await selectExplorationScope(page, 'P::System'); + await expect(header.getByText('P::System', { exact: true })).toHaveCount(1); + await expect( + header.getByRole('group', { + name: 'Current exploration scope', + exact: true, + }), + ).toHaveText('Part definitionP::System'); + await expect( + page.getByRole('button', { name: 'Change exploration scope', exact: true }), + ).toBeFocused(); + const viewType = header.getByRole('combobox', { + name: 'Exploration representation', + exact: true, + }); + await viewType.selectOption('interconnection'); + await expect(viewType).toHaveValue('interconnection'); + await expect(activeWorkspaceTab(page)).toHaveText('System'); + await expect( + page + .getByRole('tablist', { name: 'Workspace documents', exact: true }) + .getByRole('tab', { name: 'System', exact: true }), + ).toHaveCount(1); + const before = (await downloadProject(page)).bundle; + await openProjectData(page, 'Requirements table'); + await page + .getByRole('button', { name: 'Back in model', exact: true }) + .click(); + await expect(activeWorkspaceTab(page)).toHaveText('System'); + await expect(viewType).toHaveValue('interconnection'); + await page + .getByRole('button', { name: 'Forward in model', exact: true }) + .click(); + await expect(activeWorkspaceTab(page)).toHaveText('Requirements table'); + await page + .getByRole('button', { name: 'Back in model', exact: true }) + .click(); + await expect(viewType).toHaveValue('interconnection'); + // Updating the current history entry must also retain an existing forward entry. + await viewType.selectOption('tree'); + await expect(viewType).toHaveValue('tree'); + await page + .getByRole('button', { name: 'Forward in model', exact: true }) + .click(); + await expect(activeWorkspaceTab(page)).toHaveText('Requirements table'); + await page + .getByRole('button', { name: 'Back in model', exact: true }) + .click(); + await expect(viewType).toHaveValue('tree'); + expect((await downloadProject(page)).bundle).toEqual(before); +}); + +test('a failed content choice retains the active view and draft, restores picker focus, and permits retry', async ({ + page, +}) => { + await ready(page, { inspection: false }); + const source = page.getByRole('textbox', { + name: 'SysML source', + exact: true, + }); + const draft = + (await readSource(source)) + '\n// content choice must retain this draft\n'; + await fillSource(source, draft); + const before = (await downloadProject(page)).bundle; + const asset = '**/vendor/opensysml/sysml-wasm.wasm'; + await page.route(asset, (route) => + route.fulfill({ status: 503, body: 'Controlled view failure' }), + ); + const trigger = page.getByRole('button', { + name: 'Open workspace tab', + exact: true, + }); + await trigger.click(); + const picker = page.getByRole('dialog', { + name: 'Open workspace tab', + exact: true, + }); + await picker.getByTitle('CompressorViews::overview', { exact: true }).click(); + await expect(picker).toHaveCount(0); + await expect( + page.getByText('OpenSysML browser assets are unavailable.', { + exact: true, + }), + ).toBeVisible(); + await expect(activeWorkspaceTab(page)).toHaveAttribute( + 'title', + 'view:CompressorViews::pneumatics', + ); + await expect(trigger).toBeFocused(); + await expect(source).toHaveSource(draft); + expect((await downloadProject(page)).bundle).toEqual(before); + await page.unroute(asset); + await openNamedView(page, 'CompressorViews::overview'); + await expect(source).toHaveSource(draft); + expect((await downloadProject(page)).bundle).toEqual(before); +}); diff --git a/tests/e2e/model-tree.spec.ts b/tests/e2e/model-tree.spec.ts index 4332868..6e701bd 100644 --- a/tests/e2e/model-tree.spec.ts +++ b/tests/e2e/model-tree.spec.ts @@ -59,6 +59,9 @@ test('nests actual action parameters by owner and retains an invalid draft, sour await reading.focus(); await page.keyboard.press('Enter'); await expect(reading).toHaveAttribute('aria-selected', 'true'); + await page + .getByRole('button', { name: 'Inspect selection', exact: true }) + .click(); const inspector = page.getByRole('complementary', { name: 'Properties', exact: true, @@ -84,7 +87,7 @@ test('nests actual action parameters by owner and retains an invalid draft, sour await expect( page .getByRole('region', { name: 'Source editor', exact: true }) - .getByText('system.sysml', { exact: true }), + .getByRole('tab', { name: 'system.sysml', exact: true, selected: true }), ).toBeVisible(); await expect( namedViewButton(page, 'CompressorViews::pneumatics'), diff --git a/tests/e2e/overview-routing.spec.ts b/tests/e2e/overview-routing.spec.ts index 65e0bd0..b821ee8 100644 --- a/tests/e2e/overview-routing.spec.ts +++ b/tests/e2e/overview-routing.spec.ts @@ -1,3 +1,4 @@ +import { selectExplorationScope } from './support'; import { test, expect, @@ -82,11 +83,11 @@ test('routes the real assembly overview clear of cards and labels while preservi ); } expect((await downloadProject(page)).bundle).toEqual(before); - const scope = page.getByRole('combobox', { - name: 'Exploration scope', + const scope = page.getByRole('button', { + name: 'Change exploration scope', exact: true, }); - await scope.selectOption('Assembly::Station'); + await selectExplorationScope(page, 'Assembly::Station'); await expect(scope).toBeEnabled(); const representation = page.getByRole('combobox', { name: 'Exploration representation', diff --git a/tests/e2e/panels.spec.ts b/tests/e2e/panels.spec.ts index 25ad0c1..c60827f 100644 --- a/tests/e2e/panels.spec.ts +++ b/tests/e2e/panels.spec.ts @@ -1,7 +1,7 @@ import { fillSource, test, - selectModelElement, + inspectModelElement, startExample, expect, ready, @@ -14,7 +14,7 @@ import { diagramCamera, panDiagram, expectRenderedPositions, - railEdgeOffset, + controlReachable, toolbarCenterOffsets, } from './support'; @@ -31,7 +31,7 @@ test('resizes every divider and preserves draft, selection, source DOM, camera a page.getByRole('group', { name: 'part primary : Device', exact: true }), ); } - await selectModelElement(page, 'Assembly::Station::bay::primary'); + await inspectModelElement(page, 'Assembly::Station::bay::primary'); const source = page.getByRole('textbox', { name: 'SysML source', exact: true, @@ -55,19 +55,21 @@ test('resizes every divider and preserves draft, selection, source DOM, camera a await expect .poll(() => regionSize(explorer, 'width')) .toBeGreaterThan(left + 40); - const right = await regionSize(inspector, 'width'); + const dock = page.getByRole('region', { + name: 'Inspection dock', + exact: true, + }); + const right = await regionSize(dock, 'height'); await page .getByRole('separator', { name: 'Resize Inspector', exact: true }) .focus(); - await page.keyboard.press('ArrowLeft'); - await expect - .poll(() => regionSize(inspector, 'width')) - .toBeGreaterThan(right); + await page.keyboard.press('ArrowUp'); + await expect.poll(() => regionSize(dock, 'height')).toBeGreaterThan(right); const sourceWidth = await regionSize( page.getByRole('region', { name: 'Source editor', exact: true }), 'width', ); - await dragSeparator(page, 'Resize Source and Diagram', 'x', -45); + await dragSeparator(page, 'Resize Source and Diagram', 'x', 45); await expect .poll(() => regionSize( @@ -76,7 +78,7 @@ test('resizes every divider and preserves draft, selection, source DOM, camera a ), ) .toBeLessThan(sourceWidth - 20); - await dragSeparator(page, 'Resize Source and Diagram', 'x', -800); + await dragSeparator(page, 'Resize Source and Diagram', 'x', 800); await expect .poll(() => regionSize( @@ -84,7 +86,7 @@ test('resizes every divider and preserves draft, selection, source DOM, camera a 'width', ), ) - .toBeGreaterThanOrEqual(159); + .toBeGreaterThanOrEqual(279); await expect(source).toBeVisible(); expect((await toolbarCenterOffsets(page)).source).toBeLessThan(1); await expect( @@ -92,14 +94,15 @@ test('resizes every divider and preserves draft, selection, source DOM, camera a ).toHaveAttribute('aria-pressed', 'true'); await page.getByRole('button', { name: 'Show Issues', exact: true }).click(); const issues = page.getByRole('region', { name: 'Issues', exact: true }); - const bottom = await regionSize(issues, 'height'); + await expect(issues).toBeVisible(); + const bottom = await regionSize(dock, 'height'); await page .getByRole('separator', { name: 'Resize Issues', exact: true }) .focus(); await page.keyboard.press('ArrowUp'); - await expect.poll(() => regionSize(issues, 'height')).toBeGreaterThan(bottom); + await expect.poll(() => regionSize(dock, 'height')).toBeGreaterThan(bottom); expect(await diagramCamera(page)).toEqual(camera); - // Explicit editor modes refit the view; divider changes above preserve the camera. + // Both explicit arrangement changes and divider changes preserve the camera. for (const mode of [ 'Show model only', 'Show source only', @@ -110,6 +113,7 @@ test('resizes every divider and preserves draft, selection, source DOM, camera a expect( await source.evaluate((node, original) => node === original, editor), ).toBe(true); + await page.getByRole('tab', { name: 'Properties', exact: true }).click(); await expect(inspector).toContainText('Assembly::Station::bay::primary'); expect((await downloadProject(page)).bundle).toEqual(before); await expect( @@ -137,31 +141,29 @@ test('collapses and restores sizes with keyboard focus, persists UI preferences }); const initial = await regionSize(explorer, 'width'); await page - .getByRole('button', { name: 'Explorer panel options', exact: true }) - .click(); - await page - .getByRole('button', { name: 'Widen Explorer', exact: true }) - .click(); + .getByRole('separator', { name: 'Resize Explorer', exact: true }) + .focus(); + await page.keyboard.press('ArrowRight'); await expect .poll(() => regionSize(explorer, 'width')) .toBeGreaterThan(initial); - await page.keyboard.press('Escape'); - await expect( - page.getByRole('button', { name: 'Explorer panel options', exact: true }), - ).toBeFocused(); const expanded = await regionSize(explorer, 'width'); await page .getByRole('button', { name: 'Collapse Explorer', exact: true }) .focus(); await page.keyboard.press('Enter'); await expect(explorer).not.toBeVisible(); - expect(await railEdgeOffset(page, 'Show Explorer', 'left')).toBeLessThan(8); + expect( + await controlReachable( + page.getByRole('button', { name: 'Show Explorer', exact: true }), + ), + ).toBe(true); await expect( page.getByRole('button', { name: 'Show Explorer', exact: true }), ).toBeFocused(); await page.keyboard.press('Enter'); await expect( - page.getByRole('button', { name: 'Collapse Explorer', exact: true }), + page.getByRole('button', { name: 'Hide Explorer', exact: true }), ).toBeFocused(); await expect .poll(() => regionSize(explorer, 'width')) @@ -172,32 +174,37 @@ test('collapses and restores sizes with keyboard focus, persists UI preferences await expect( page.getByRole('button', { name: 'Show Inspector', exact: true }), ).toBeFocused(); - expect(await railEdgeOffset(page, 'Show Inspector', 'right')).toBeLessThan(8); + expect( + await controlReachable( + page.getByRole('button', { name: 'Show Inspector', exact: true }), + ), + ).toBe(true); await page.keyboard.press('Enter'); await expect( - page.getByRole('button', { name: 'Collapse Inspector', exact: true }), + page.getByRole('button', { name: 'Hide Inspector', exact: true }), ).toBeFocused(); await page.getByRole('button', { name: 'Show Issues', exact: true }).click(); + const dock = page.getByRole('region', { + name: 'Inspection dock', + exact: true, + }); await page - .getByRole('button', { name: 'Issues panel options', exact: true }) - .click(); - await page - .getByRole('button', { name: 'Taller Issues', exact: true }) - .click(); - await page.keyboard.press('Escape'); + .getByRole('separator', { name: 'Resize Issues', exact: true }) + .focus(); + await page.keyboard.press('ArrowUp'); const issues = page.getByRole('region', { name: 'Issues', exact: true }); - const height = await regionSize(issues, 'height'); + const height = await regionSize(dock, 'height'); await page - .getByRole('button', { name: 'Collapse Issues', exact: true }) + .getByRole('button', { name: 'Collapse Inspector', exact: true }) .click(); await expect( - page.getByRole('button', { name: 'Show Issues', exact: true }), + page.getByRole('button', { name: 'Show Inspector', exact: true }), ).toBeFocused(); await page.keyboard.press('Enter'); await expect( - page.getByRole('button', { name: 'Collapse Issues', exact: true }), + page.getByRole('button', { name: 'Hide Inspector', exact: true }), ).toBeFocused(); - await expect.poll(() => regionSize(issues, 'height')).toBeCloseTo(height, 0); + await expect.poll(() => regionSize(dock, 'height')).toBeCloseTo(height, 0); expect((await downloadProject(page)).bundle).toEqual(before); await expect(page.getByRole('banner')).not.toContainText('modified'); await page.reload(); @@ -205,7 +212,7 @@ test('collapses and restores sizes with keyboard focus, persists UI preferences await expect .poll(() => regionSize(explorer, 'width')) .toBeCloseTo(expanded, 0); - await expect.poll(() => regionSize(issues, 'height')).toBeCloseTo(height, 0); + await expect.poll(() => regionSize(dock, 'height')).toBeCloseTo(height, 0); await page .getByRole('button', { name: 'Workspace layout', exact: true }) .click(); @@ -237,16 +244,23 @@ test('opens resizable Issues on validation failure and retains the invalid draft }); const before = (await downloadProject(page)).bundle; await fillSource(source, 'package Unfinished { part'); + await page + .getByRole('button', { name: 'Show source only', exact: true }) + .click(); await page.getByRole('button', { name: 'Apply source', exact: true }).click(); const issues = page.getByRole('region', { name: 'Issues', exact: true }); await expect(issues).toBeVisible(); await expect( page.getByRole('separator', { name: 'Resize Issues', exact: true }), ).toBeVisible(); - const height = await regionSize(issues, 'height'); + const dock = page.getByRole('region', { + name: 'Inspection dock', + exact: true, + }); + const height = await regionSize(dock, 'height'); await dragSeparator(page, 'Resize Issues', 'y', -35); await expect - .poll(() => regionSize(issues, 'height')) + .poll(() => regionSize(dock, 'height')) .toBeGreaterThan(height + 20); const failed = (await downloadProject(page)).bundle; expect(failed.documents).toEqual(before.documents); @@ -279,10 +293,8 @@ test('keeps panels operable when preference storage is denied', async ({ exact: true, }); await expect(options.getByRole('status')).toContainText('cannot be saved'); - await options - .getByRole('button', { name: 'More source space', exact: true }) - .click(); await page.keyboard.press('Escape'); + await dragSeparator(page, 'Resize Source and Diagram', 'x', -20); await page .getByRole('button', { name: 'Collapse Explorer', exact: true }) .click(); @@ -299,7 +311,7 @@ test('recovers from corrupt preferences and keeps narrow dark panels reachable w await page.addInitScript(() => localStorage.setItem('sysml-workbench-layout-v1', '{invalid'), ); - await ready(page); + await ready(page, { inspection: false }); const before = (await downloadProject(page)).bundle; await page.getByRole('button', { name: 'Appearance', exact: true }).click(); await page @@ -310,9 +322,6 @@ test('recovers from corrupt preferences and keeps narrow dark panels reachable w await expect( page.getByRole('button', { name: 'Show Inspector', exact: true }), ).toBeVisible(); - await page - .getByRole('button', { name: 'Collapse Explorer', exact: true }) - .click(); await page .getByRole('button', { name: 'Show Inspector', exact: true }) .click(); @@ -320,7 +329,7 @@ test('recovers from corrupt preferences and keeps narrow dark panels reachable w page.getByRole('complementary', { name: 'Properties', exact: true }), ).toBeVisible(); await expect( - page.getByRole('button', { name: 'Collapse Inspector', exact: true }), + page.getByRole('button', { name: 'Hide Inspector', exact: true }), ).toBeFocused(); await page .getByRole('separator', { name: 'Resize Source and Diagram', exact: true }) diff --git a/tests/e2e/preservation.spec.ts b/tests/e2e/preservation.spec.ts index f16010a..74122e8 100644 --- a/tests/e2e/preservation.spec.ts +++ b/tests/e2e/preservation.spec.ts @@ -1,7 +1,7 @@ import { fillSource, test, - selectModelElement, + inspectModelElement, startExample, expect, ready, @@ -49,7 +49,8 @@ for (const rename of [ ], ), ); - await selectModelElement(page, rename.target); + await inspectModelElement(page, rename.target); + await page.getByText('Edit properties', { exact: true }).click(); await page .getByRole('textbox', { name: 'Name', exact: true }) .fill(rename.name); diff --git a/tests/e2e/readability.spec.ts b/tests/e2e/readability.spec.ts index 1935ac1..d15af56 100644 --- a/tests/e2e/readability.spec.ts +++ b/tests/e2e/readability.spec.ts @@ -1,3 +1,4 @@ +import { activeWorkspaceTab } from './support'; import { importRequirementsTraceability, requirementCard, @@ -34,9 +35,7 @@ for (const width of [1600, 800]) evaluations.some((value) => value.view === 'ReadingViews::assembly'), ) .toBe(true); - await expect( - page.getByRole('combobox', { name: 'Named view', exact: true }), - ).toBeEnabled(); + await expect(activeWorkspaceTab(page)).toBeEnabled(); await expect .poll(async () => (await diagramCamera(page)).zoom, { timeout: 1500 }) .toBeGreaterThanOrEqual(0.75); @@ -109,9 +108,7 @@ test('@critical responsive panes preserve explicit preferences, camera and the u mimeType: 'text/plain', buffer: Buffer.from(source), }); - await expect( - page.getByRole('combobox', { name: 'Named view', exact: true }), - ).toBeEnabled(); + await expect(activeWorkspaceTab(page)).toBeEnabled(); await page .getByRole('button', { name: 'Show source and model', exact: true }) .click(); @@ -121,14 +118,16 @@ test('@critical responsive panes preserve explicit preferences, camera and the u }); const draft = source + '\n// keep this draft through responsive inspection'; await fillSource(editor, draft); - await page - .getByRole('button', { name: 'Collapse Inspector', exact: true }) - .click(); + const closeInspection = page.getByRole('button', { + name: 'Collapse Inspector', + exact: true, + }); + if (await closeInspection.isVisible()) await closeInspection.click(); await page .getByRole('button', { name: 'Collapse Explorer', exact: true }) .click(); const preferences = await page.evaluate(() => - JSON.parse(localStorage.getItem('sysml-workbench-layout-v1')!), + JSON.parse(localStorage.getItem('sysml-workbench-layout-v2')!), ); const saved = (await downloadProject(page)).bundle; const camera = await diagramCamera(page); @@ -144,7 +143,7 @@ test('@critical responsive panes preserve explicit preferences, camera and the u ).toBeVisible(); expect( await page.evaluate(() => - JSON.parse(localStorage.getItem('sysml-workbench-layout-v1')!), + JSON.parse(localStorage.getItem('sysml-workbench-layout-v2')!), ), ).toEqual(preferences); const primary = await page @@ -153,24 +152,10 @@ test('@critical responsive panes preserve explicit preferences, camera and the u const workspace = await page .getByRole('main', { name: 'Model workspace', exact: true }) .boundingBox(); - const activity = await page - .getByRole('navigation', { name: 'Workspace activities', exact: true }) - .boundingBox(); - const reopen = await page - .getByRole('toolbar', { name: 'Inspector panel reopen', exact: true }) - .boundingBox(); const leftDivider = await page .getByRole('separator', { name: 'Resize Explorer', exact: true }) .boundingBox(); - const rightDivider = await page - .getByRole('separator', { name: 'Resize Inspector', exact: true }) - .boundingBox(); - const available = - workspace!.width - - activity!.width - - reopen!.width - - leftDivider!.width - - rightDivider!.width; + const available = workspace!.width - leftDivider!.width; const sourcePane = await page .getByRole('region', { name: 'Source editor', exact: true }) .boundingBox(); @@ -195,22 +180,22 @@ test('@critical responsive panes preserve explicit preferences, camera and the u .focus(); await page.keyboard.press('Enter'); await expect( - page.getByRole('button', { name: 'Collapse Inspector', exact: true }), + page.getByRole('button', { name: 'Hide Inspector', exact: true }), ).toBeFocused(); await expect .poll(() => regionSize( - page.getByRole('complementary', { name: 'Properties', exact: true }), - 'width', + page.getByRole('region', { name: 'Inspection dock', exact: true }), + 'height', ), ) - .toBeGreaterThanOrEqual(189); + .toBeGreaterThanOrEqual(140); expect( await page.evaluate( () => - JSON.parse(localStorage.getItem('sysml-workbench-layout-v1')!) - .inspector, + JSON.parse(localStorage.getItem('sysml-workbench-layout-v2')!) + .inspection, ), - ).toBe(preferences.inspector); + ).toBe(preferences.inspection); expect((await downloadProject(page)).bundle).toEqual(saved); }); diff --git a/tests/e2e/requirements-data.spec.ts b/tests/e2e/requirements-data.spec.ts index 7744e94..388d9ee 100644 --- a/tests/e2e/requirements-data.spec.ts +++ b/tests/e2e/requirements-data.spec.ts @@ -1,3 +1,4 @@ +import { openProjectData, activeWorkspaceTab, openNamedView } from './support'; import { test, expect, @@ -30,9 +31,7 @@ test('@critical reads requirements and exact declared traceability without chang expect(Object.keys(before.presentations)).toEqual([ 'TraceViews::requirements', ]); - await page - .getByRole('button', { name: 'Requirements table', exact: true }) - .click(); + await openProjectData(page, 'Requirements table'); const table = page.getByRole('region', { name: 'Requirements table', exact: true, @@ -77,9 +76,7 @@ test('@critical reads requirements and exact declared traceability without chang const content = Buffer.concat(chunks).toString(); expect(content).toContain('NOT TraceSystem::spare'); expect(content).toContain('REQ-LEFT-CAP'); - await page - .getByRole('button', { name: 'Traceability matrix', exact: true }) - .click(); + await openProjectData(page, 'Traceability matrix'); const matrix = page.getByRole('region', { name: 'Traceability matrix', exact: true, @@ -114,13 +111,12 @@ test('@critical reads requirements and exact declared traceability without chang unlinked.getByRole('button', { name: /Declared|Negated declaration/ }), ).toHaveCount(0); await namedViewButton(page, 'TraceViews::overview').click(); - await expect( - page.getByRole('button', { name: 'Diagram view', exact: true }), - ).toHaveAttribute('aria-pressed', 'true'); + await expect(activeWorkspaceTab(page)).toHaveAttribute( + 'title', + 'view:TraceViews::overview', + ); await namedViewButton(page, 'TraceViews::requirements').click(); - await page - .getByRole('button', { name: 'Traceability matrix', exact: true }) - .click(); + await openProjectData(page, 'Traceability matrix'); await expect(matrix.getByRole('status')).toHaveText( '7 requirements · 3 linked elements', ); @@ -173,7 +169,7 @@ test('@critical reads requirements and exact declared traceability without chang page.getByRole('button', { name: 'Download project', exact: true }), ).toBeEnabled(); expect((await downloadProject(page)).bundle).toEqual(saved); - await page.getByRole('button', { name: 'Diagram view', exact: true }).click(); + await openNamedView(page, 'TraceViews::requirements'); await expectRenderedPositions(page, saved, 'TraceViews::requirements'); }); @@ -188,9 +184,7 @@ test('requirements asset failure is explicit and retries without replacing the p failed++; return r.abort('failed'); }); - await page - .getByRole('button', { name: 'Requirements table', exact: true }) - .click(); + await openProjectData(page, 'Requirements table'); const panel = page.getByRole('region', { name: 'Requirements table', exact: true, @@ -229,9 +223,7 @@ test('matrix verification resolves the actual verifier and requirement through a page.getByRole('button', { name: 'Download project', exact: true }), ).toBeEnabled(); const before = (await downloadProject(page)).bundle; - await page - .getByRole('button', { name: 'Traceability matrix', exact: true }) - .click(); + await openProjectData(page, 'Traceability matrix'); const matrix = page.getByRole('region', { name: 'Traceability matrix', exact: true, diff --git a/tests/e2e/requirements-support.ts b/tests/e2e/requirements-support.ts index 9b9ab67..30cd273 100644 --- a/tests/e2e/requirements-support.ts +++ b/tests/e2e/requirements-support.ts @@ -223,6 +223,11 @@ export async function centerRequirementCard(page: Page, card: Locator) { { x: bounds.right - 8, y: bounds.bottom - 8 }, { x: bounds.x + bounds.width / 2, y: bounds.y + bounds.height / 2 }, ]; + // A short, wide canvas can place nodes over every corner and its centre. + // Search the remaining background before rejecting a real middle-button pan. + for (let y = bounds.top + 16; y < bounds.bottom - 16; y += 32) + for (let x = bounds.left + 16; x < bounds.right - 16; x += 32) + candidates.push({ x, y }); return candidates.find((point) => element.ownerDocument .elementFromPoint(point.x, point.y) diff --git a/tests/e2e/rover-overview.spec.ts b/tests/e2e/rover-overview.spec.ts new file mode 100644 index 0000000..16dcdd0 --- /dev/null +++ b/tests/e2e/rover-overview.spec.ts @@ -0,0 +1,56 @@ +import { + test, + expect, + waitForRoverStartup, + observeExplorations, + downloadProject, + activeWorkspaceTab, +} from './support'; + +test('rover project overview accepts exact correspondence and preserves all project sources', async ({ + page, +}, testInfo) => { + const results = await observeExplorations(page); + await page.goto('/app'); + await page.getByRole('button', { name: 'Load example', exact: true }).click(); + await waitForRoverStartup(page); + const before = (await downloadProject(page)).bundle; + await page + .getByRole('button', { name: 'Project overview', exact: true }) + .click(); + await expect.poll(() => results.length).toBeGreaterThan(0); + await testInfo.attach('exploration-response', { + body: JSON.stringify(results.at(-1), null, 2), + contentType: 'application/json', + }); + await expect(activeWorkspaceTab(page)).toHaveText('Project overview'); + await expect( + page.getByRole('group', { + name: 'Current exploration scope', + exact: true, + }), + ).toContainText('Project overview'); + const overview = results.at(-1)!; + expect(overview.status).toBe('complete'); + expect(overview.selected.map((item) => item.qualifiedName).sort()).toEqual([ + 'RoverBehavior', + 'RoverComponents', + 'RoverReport', + 'RoverRequirements', + 'RoverSystem', + 'RoverTypes', + 'RoverViews', + ]); + expect(overview.artifact?.nodes).toHaveLength(194); + expect(overview.artifact?.edges).toHaveLength(134); + expect(overview.diagnostics).toContain( + 'Exploration omitted 8 relationships without exact source locations.', + ); + await expect( + page.getByRole('status').filter({ hasText: overview.diagnostics[0] }), + ).toBeVisible(); + for (const item of overview.correspondence) { + expect(item.subject.origin).toBeDefined(); + } + expect((await downloadProject(page)).bundle).toEqual(before); +}); diff --git a/tests/e2e/rover.spec.ts b/tests/e2e/rover.spec.ts index 75f5f71..e942606 100644 --- a/tests/e2e/rover.spec.ts +++ b/tests/e2e/rover.spec.ts @@ -189,6 +189,9 @@ for (const [view, target, declaration] of [ .toBe(result.artifact!.edges.filter((edge) => edge.label).length); await symbol.focus(); await symbol.press('Enter'); + await page + .getByRole('button', { name: 'Inspect selection', exact: true }) + .click(); await page .getByRole('complementary', { name: 'Properties', exact: true }) .getByRole('button', { name: 'Open source', exact: true }) diff --git a/tests/e2e/shell-entry.spec.ts b/tests/e2e/shell-entry.spec.ts index 3a1c30d..73c5edf 100644 --- a/tests/e2e/shell-entry.spec.ts +++ b/tests/e2e/shell-entry.spec.ts @@ -1,3 +1,4 @@ +import { activeWorkspaceTab, openNamedView } from './support'; import { readFile } from 'node:fs/promises'; import type { Page } from '@playwright/test'; import { @@ -15,7 +16,7 @@ import { moveNode, panDiagram, diagramCamera, - selectModelElement, + inspectModelElement, expectRenderedPositions, namedViewButton, } from './support'; @@ -257,7 +258,7 @@ test('launcher and browser navigation retain exact drafts, source DOM, camera, b await moveNode(page, diagramNode(page, 'Workshop::Motor')); await openView(page, 'compressor'); await moveNode(page, diagramNode(page, 'primary : Motor')); - await selectModelElement(page, 'Workshop::Compressor::primary'); + await inspectModelElement(page, 'Workshop::Compressor::primary'); const before = (await downloadProject(page)).bundle; const draft = applied + '\n// retained unfinished launcher draft\npart'; await fillSource(source, draft); @@ -429,16 +430,16 @@ test('the diagram view selector keeps source-file choice, pending draft and both '\n// independent source draft\npart'; await fillSource(source, draft); const header = page.getByRole('group', { name: 'Model header', exact: true }); - const selector = header.getByRole('combobox', { - name: 'Named view', - exact: true, - }); - await expect(selector).toHaveValue('WorkshopViews::compressor'); + const selector = activeWorkspaceTab(page); + await expect(selector).toHaveAttribute( + 'title', + 'view:' + 'WorkshopViews::compressor', + ); for (const [view, representation] of [ ['overview', 'Overview tree'], ['compressor', 'Structure'], ] as const) { - await selector.selectOption('WorkshopViews::' + view); + await openNamedView(page, 'WorkshopViews::' + view); await expect( namedViewButton(page, 'WorkshopViews::' + view), ).toHaveAttribute('aria-current', 'page'); diff --git a/tests/e2e/source-header.spec.ts b/tests/e2e/source-header.spec.ts index a942548..55d972c 100644 --- a/tests/e2e/source-header.spec.ts +++ b/tests/e2e/source-header.spec.ts @@ -1,3 +1,5 @@ +import { openProjectData } from './support'; +import { activeWorkspaceTab } from './support'; import { test, expect, @@ -36,7 +38,9 @@ test('@critical keeps source commands local and preserves independent arrangemen .getByRole('complementary', { name: 'Project navigation', exact: true }) .getByRole('button', { name: 'views.sysml', exact: true }) .click(); - await expect(source.getByTitle('views.sysml', { exact: true })).toBeVisible(); + await expect( + source.getByRole('tab', { name: 'views.sysml', exact: true }), + ).toBeVisible(); await expect( source.getByLabel('Unapplied draft in views.sysml', { exact: true }), ).toHaveCount(0); @@ -44,17 +48,13 @@ test('@critical keeps source commands local and preserves independent arrangemen source.getByText('Draft not applied', { exact: true }), ).toBeVisible(); const saved = (await downloadProject(page)).bundle; - const namedView = await page - .getByRole('combobox', { name: 'Named view', exact: true }) - .inputValue(); + const namedView = await activeWorkspaceTab(page).getAttribute('title'); const arrangement = page.getByRole('group', { name: 'Workspace arrangement', exact: true, }); for (const representation of ['Requirements table', 'Traceability matrix']) { - await page - .getByRole('button', { name: representation, exact: true }) - .click(); + await openProjectData(page, representation); await expect( arrangement.getByRole('button', { name: 'Show source and model', @@ -85,16 +85,17 @@ test('@critical keeps source commands local and preserves independent arrangemen ).toHaveCount(0); } } - await expect( - page.getByRole('button', { name: representation, exact: true }), - ).toHaveAttribute('aria-pressed', 'true'); + await expect(activeWorkspaceTab(page)).toHaveText(representation); expect((await downloadProject(page)).bundle).toEqual(saved); } - await page.getByRole('button', { name: 'Diagram view', exact: true }).click(); + await page + .getByRole('tablist', { name: 'Workspace documents', exact: true }) + .getByTitle(namedView!, { exact: true }) + .click(); + await expect(activeWorkspaceTab(page)).toHaveAttribute('title', namedView!); await expect( - page.getByRole('combobox', { name: 'Named view', exact: true }), - ).toHaveValue(namedView); - await expect(source.getByTitle('views.sysml', { exact: true })).toBeVisible(); + source.getByRole('tab', { name: 'views.sysml', exact: true }), + ).toBeVisible(); await page .getByRole('complementary', { name: 'Project navigation', exact: true }) .getByRole('button', { name: 'model.sysml', exact: true }) @@ -129,10 +130,13 @@ test('@critical keeps source actions and editor space reachable at the narrow di [390, 600], ] as const) { await page.setViewportSize({ width, height }); - await dragSeparator(page, 'Resize Source and Diagram', 'y', -2000); + await dragSeparator(page, 'Resize Source and Diagram', 'y', 2000); await expect .poll(async () => (await sourceHeaderGeometry(page)).editorHeight) .toBeGreaterThanOrEqual(80); + await expect + .poll(async () => (await sourceHeaderGeometry(page)).editorHeight) + .toBeLessThanOrEqual(82); await page .getByRole('button', { name: 'Show model only', exact: true }) .click(); diff --git a/tests/e2e/source-reveal-cancel.spec.ts b/tests/e2e/source-reveal-cancel.spec.ts new file mode 100644 index 0000000..75f11df --- /dev/null +++ b/tests/e2e/source-reveal-cancel.spec.ts @@ -0,0 +1,36 @@ +import { test, expect, ready, downloadProject } from './support'; + +test('a cancelled delayed source reveal cannot steal focus when the source panel is reopened', async ({ + page, +}) => { + await ready(page, { split: false, inspection: false }); + await page + .getByRole('group', { name: 'part pump : Pump', exact: true }) + .getByText('pump', { exact: true }) + .click(); + await page + .getByRole('button', { name: 'Inspect selection', exact: true }) + .click(); + const before = (await downloadProject(page)).bundle; + await page + .getByRole('button', { name: 'Maximize Inspector', exact: true }) + .click(); + const delay = await page.addStyleTag({ + content: '.source-editor { display: none !important; }', + }); + await page + .getByRole('complementary', { name: 'Properties', exact: true }) + .getByRole('button', { name: 'Open source', exact: true }) + .click(); + await expect(page.locator('#workspace-source')).not.toHaveAttribute('hidden'); + await page.getByRole('button', { name: 'Hide Source', exact: true }).click(); + await delay.evaluate((element) => element.parentNode?.removeChild(element)); + await page.getByRole('button', { name: 'Show Source', exact: true }).click(); + await expect( + page.getByRole('textbox', { name: 'SysML source', exact: true }), + ).toBeVisible(); + await expect( + page.getByRole('button', { name: 'Hide Source', exact: true }), + ).toBeFocused(); + expect((await downloadProject(page)).bundle).toEqual(before); +}); diff --git a/tests/e2e/source-values.spec.ts b/tests/e2e/source-values.spec.ts index 5bc4ac6..047fb2e 100644 --- a/tests/e2e/source-values.spec.ts +++ b/tests/e2e/source-values.spec.ts @@ -1,3 +1,4 @@ +import { activeWorkspaceTab, openNamedView } from './support'; import { readFile } from 'node:fs/promises'; import { test, @@ -66,20 +67,14 @@ test('@critical inspects exact nested defaults and overrides, explains bindings mimeType: 'text/plain', buffer: bytes, }); - await expect( - page.getByRole('combobox', { name: 'Named view', exact: true }), - ).toBeEnabled(); - await page - .getByRole('combobox', { name: 'Named view', exact: true }) - .selectOption('ReadingViews::nested'); + await expect(activeWorkspaceTab(page)).toBeEnabled(); + await openNamedView(page, 'ReadingViews::nested'); await expect .poll(() => evaluations.some((value) => value.view === 'ReadingViews::nested'), ) .toBe(true); - await expect( - page.getByRole('combobox', { name: 'Named view', exact: true }), - ).toBeEnabled(); + await expect(activeWorkspaceTab(page)).toBeEnabled(); const view = evaluations.findLast( (value) => value.view === 'ReadingViews::nested', )!; @@ -88,6 +83,9 @@ test('@critical inspects exact nested defaults and overrides, explains bindings body: JSON.stringify(view, null, 2), contentType: 'application/json', }); + await page + .getByRole('button', { name: 'Inspect selection', exact: true }) + .click(); const properties = page.getByRole('complementary', { name: 'Properties', exact: true, @@ -129,6 +127,12 @@ test('@critical inspects exact nested defaults and overrides, explains bindings exact: true, }); await expect(details.locator('pre')).toHaveText(expression!); + await expect(details.locator('pre')).toBeVisible(); + const metadata = details.locator('details'); + await expect(metadata).not.toHaveAttribute('open'); + await details.getByText('Declaration details', { exact: true }).click(); + await expect(metadata).toHaveAttribute('open', ''); + await expect(metadata).toContainText(provider!); if (owner === 'Reading::valueless') { await details .getByRole('button', { @@ -199,12 +203,8 @@ test('@critical inspects exact nested defaults and overrides, explains bindings await expect( reopened.getByRole('button', { name: 'Download project', exact: true }), ).toBeEnabled(); - await reopened - .getByRole('combobox', { name: 'Named view', exact: true }) - .selectOption('ReadingViews::nested'); - await expect( - reopened.getByRole('combobox', { name: 'Named view', exact: true }), - ).toBeEnabled(); + await openNamedView(reopened, 'ReadingViews::nested'); + await expect(activeWorkspaceTab(reopened)).toBeEnabled(); expect((await downloadProject(reopened)).bundle).toEqual(saved); await expectRenderedPositions(reopened, saved, 'ReadingViews::nested'); await fresh.close(); diff --git a/tests/e2e/support.ts b/tests/e2e/support.ts index de7b538..b201ede 100644 --- a/tests/e2e/support.ts +++ b/tests/e2e/support.ts @@ -168,9 +168,10 @@ export async function waitForStartup(page: Page, { split = true } = {}) { exact: true, }), ).toBeVisible(); - await expect( - page.getByRole('combobox', { name: 'Named view', exact: true }), - ).toHaveValue('CompressorViews::overview'); + await expect(activeWorkspaceTab(page)).toHaveAttribute( + 'title', + 'view:' + 'CompressorViews::overview', + ); await expect( page.getByRole('button', { name: 'Download project', exact: true }), ).toBeEnabled(); @@ -241,13 +242,23 @@ export async function startExample( } /** Most diagram regressions deliberately use the pneumatic fixture after startup. */ -export async function ready(page: Page, options: { split?: boolean } = {}) { +export async function ready( + page: Page, + options: { split?: boolean; inspection?: boolean } = {}, +) { await page.goto('/app'); await startExample(page, options); - await namedViewButton(page, 'CompressorViews::pneumatics').click(); + await openNamedView(page, 'CompressorViews::pneumatics'); await expect( page.getByRole('group', { name: 'part pump : Pump', exact: true }), ).toBeVisible(); + if (options.inspection !== false) { + const show = page.getByRole('button', { + name: 'Show Inspector', + exact: true, + }); + if (await show.isVisible()) await show.click(); + } } /** Keep focused history/appearance regressions explicit about their small fixture. */ @@ -281,9 +292,10 @@ export async function importWorkshop(page: Page) { ), }); await expect(diagramNode(page, 'Workshop::Motor')).toBeVisible(); - await expect( - page.getByRole('combobox', { name: 'Named view', exact: true }), - ).toHaveValue('WorkshopViews::overview'); + await expect(activeWorkspaceTab(page)).toHaveAttribute( + 'title', + 'view:' + 'WorkshopViews::overview', + ); await expect( page.getByRole('button', { name: 'Download project', exact: true }), ).toBeEnabled(); @@ -310,6 +322,14 @@ export async function selectModelElement(page: Page, id: string) { ); } +/** Explicit inspection is separate from selection in the model-first workbench. */ +export async function inspectModelElement(page: Page, id: string) { + await selectModelElement(page, id); + await page + .getByRole('button', { name: 'Inspect selection', exact: true }) + .click(); +} + export async function openView(page: Page, name: string) { const button = page.getByRole('button', { name, exact: true }); await button.click(); @@ -405,9 +425,10 @@ export async function importAssembly(page: Page) { buffer: Buffer.from(item.text), })), ); - await expect( - page.getByRole('button', { name: 'structure', exact: true }), - ).toHaveAttribute('aria-current', 'page'); + await expect(activeWorkspaceTab(page)).toHaveAttribute( + 'title', + 'view:' + 'AssemblyViews::structure', + ); await expect( page.getByRole('group', { name: 'part primary : Device', exact: true }), ).toBeVisible(); @@ -432,13 +453,38 @@ export async function showAssemblyDiagram(page: Page) { await expect .poll(async () => (await station.boundingBox())!.width) .toBeLessThan(available); - const before = (await station.boundingBox())!.width; + const camera = await diagramCamera(page); await page .getByRole('button', { name: 'Show model only', exact: true }) .click(); + await expect.poll(() => diagramCamera(page)).toEqual(camera); + // A wider panel can remain limited by height. Fit must contain the root, + // without assuming that removing Source always increases zoom. + await page.getByRole('button', { name: 'Fit view', exact: true }).click(); + await expect(station).toBeInViewport(); + // IntersectionObserver can round a fully visible transformed box just below + // ratio 1. Check all edges against the actual diagram pane instead. + await expect + .poll(async () => { + const box = (await station.boundingBox())!; + const pane = (await page + .getByRole('region', { name: 'Diagram', exact: true }) + .boundingBox())!; + return Math.max( + pane.x - box.x, + pane.y - box.y, + box.x + box.width - pane.x - pane.width, + box.y + box.height - pane.y - pane.height, + ); + }) + .toBeLessThanOrEqual(0.5); + const wider = await regionSize( + page.getByRole('region', { name: 'Diagram', exact: true }), + 'width', + ); await expect .poll(async () => (await station.boundingBox())!.width) - .toBeGreaterThan(before + 50); + .toBeLessThan(wider); } export async function connectionPoints(page: Page) { @@ -986,9 +1032,10 @@ export async function overviewRoutingGeometry( /** Product-default startup, independent of the retained air-workshop test fixture. */ export async function waitForRoverStartup(page: Page) { - await expect( - page.getByRole('combobox', { name: 'Named view', exact: true }), - ).toHaveValue('RoverViews::architecture'); + await expect(activeWorkspaceTab(page)).toHaveAttribute( + 'title', + 'view:' + 'RoverViews::architecture', + ); await expect( page.getByRole('group', { name: 'part battery : Battery', exact: true }), ).toBeVisible(); @@ -999,6 +1046,11 @@ export async function waitForRoverStartup(page: Page) { } /** Measure visible pane-local source actions, not the global arrangement bar. */ +/** CodeMirror owns its scroll container; no semantic state is read here. */ +export async function sourceScroll(source: Locator) { + return source.evaluate((node) => node.closest('.cm-scroller')!.scrollTop); +} + export async function sourceHeaderGeometry(page: Page) { return page .getByRole('region', { name: 'Source editor', exact: true }) @@ -1051,13 +1103,21 @@ export async function controlReachable(control: Locator) { /** Normalize a closed Explorer and visible reopen focus after responsive layout. */ export async function hideExplorer(page: Page) { - const activity = page - .getByRole('navigation', { name: 'Workspace activities', exact: true }) - .getByRole('button'); - if ((await activity.getAttribute('aria-expanded')) === 'true') - await activity.click(); - else await activity.focus(); - await expect(activity).toHaveAttribute('aria-expanded', 'false'); + const controls = page.getByRole('group', { + name: 'Workspace panels', + exact: true, + }); + const hide = controls.getByRole('button', { + name: 'Hide Explorer', + exact: true, + }); + if (await hide.isVisible()) await hide.click(); + const activity = controls.getByRole('button', { + name: 'Show Explorer', + exact: true, + }); + await activity.focus(); + await expect(activity).toHaveAttribute('aria-pressed', 'false'); await expect( page.getByRole('complementary', { name: 'Project navigation', @@ -1066,3 +1126,61 @@ export async function hideExplorer(page: Page) { ).not.toBeVisible(); await expect(activity).toBeFocused(); } + +/** The sole selected content tab, independent of Explorer visibility. */ +export function activeWorkspaceTab(page: Page) { + return page + .getByRole('tablist', { name: 'Workspace documents', exact: true }) + .getByRole('tab', { selected: true }); +} +export async function openNamedView(page: Page, id: string) { + if (!id) { + await page + .getByRole('button', { name: 'Project overview', exact: true }) + .click(); + await expect(activeWorkspaceTab(page)).toHaveText('Project overview'); + return; + } + await page + .getByRole('button', { name: 'Open workspace tab', exact: true }) + .click(); + await page + .getByRole('dialog', { name: 'Open workspace tab', exact: true }) + .getByTitle(id, { exact: true }) + .click(); + await expect(activeWorkspaceTab(page)).toHaveAttribute('title', 'view:' + id); + await expect( + page.getByRole('button', { name: 'Open workspace tab', exact: true }), + ).toBeEnabled(); +} +export async function openProjectData(page: Page, name: string) { + await page + .getByRole('button', { name: 'Open workspace tab', exact: true }) + .click(); + await page + .getByRole('dialog', { name: 'Open workspace tab', exact: true }) + .getByRole('button', { name, exact: true }) + .click(); + await expect( + page.getByRole('dialog', { name: 'Open workspace tab', exact: true }), + ).toHaveCount(0); + await expect(activeWorkspaceTab(page)).toHaveText(name); + await expect(activeWorkspaceTab(page)).toBeFocused(); +} + +export async function selectExplorationScope(page: Page, subject: string) { + const trigger = page.getByRole('button', { + name: 'Change exploration scope', + exact: true, + }); + await trigger.click(); + const picker = page.getByRole('dialog', { + name: 'Change exploration scope', + exact: true, + }); + await picker + .getByRole('combobox', { name: 'Exploration scope', exact: true }) + .selectOption(subject); + await expect(picker).not.toBeVisible(); + await expect(trigger).toBeEnabled(); +} diff --git a/tests/e2e/toolbar.spec.ts b/tests/e2e/toolbar.spec.ts index 923adba..065d0b6 100644 --- a/tests/e2e/toolbar.spec.ts +++ b/tests/e2e/toolbar.spec.ts @@ -1,3 +1,4 @@ +import { activeWorkspaceTab } from './support'; import { readSource, fillSource, @@ -161,9 +162,10 @@ test('keeps wrapped mobile project actions inside the header and above source co await page.setViewportSize({ width: 390, height: 900 }); await page.goto('/app'); await startExample(page, { split: false }); - await expect( - page.getByRole('combobox', { name: 'Named view', exact: true }), - ).toHaveValue('CompressorViews::overview'); + await expect(activeWorkspaceTab(page)).toHaveAttribute( + 'title', + 'view:' + 'CompressorViews::overview', + ); await expect( page.getByRole('group', { name: 'part compressor : CompressorInterface', diff --git a/tests/e2e/visual.spec.ts b/tests/e2e/visual.spec.ts index 59c5cb5..74507a9 100644 --- a/tests/e2e/visual.spec.ts +++ b/tests/e2e/visual.spec.ts @@ -1,3 +1,6 @@ +import { selectExplorationScope } from './support'; +import { openProjectData } from './support'; +import { activeWorkspaceTab, openNamedView } from './support'; import { openRoverReport } from './document-support'; import { readFile } from 'node:fs/promises'; import { noViews, assemblyExploration, documents } from './exploration-support'; @@ -112,8 +115,6 @@ test('workbench and keyboard-operated appearance at a narrow viewport', async ({ for (const appearance of [ { theme: 'light', narrow: false }, - { theme: 'dark', narrow: false }, - { theme: 'light', narrow: true }, { theme: 'dark', narrow: true }, ]) { test(`structural authoring dialogs in ${appearance.theme}${appearance.narrow ? ' narrow' : ''}`, async ({ @@ -153,8 +154,11 @@ for (const appearance of [ }); } +// Pair light desktop with dark compact layouts instead of multiplying every +// surface across both themes and widths. Functional scenarios own behavior. for (const theme of ['light', 'dark']) { for (const narrow of [false, true]) { + if (narrow !== (theme === 'dark')) continue; test(`resized workspace panels in ${theme}${narrow ? ' narrow' : ''}`, async ({ page, }) => { @@ -170,17 +174,16 @@ for (const theme of ['light', 'dark']) { await page.getByRole('button', { name: 'Done', exact: true }).click(); if (narrow) { await hideExplorer(page); - await page - .getByRole('button', { name: 'Show Inspector', exact: true }) - .click(); + const showInspector = page.getByRole('button', { + name: 'Show Inspector', + exact: true, + }); + if (await showInspector.isVisible()) await showInspector.click(); } else { await page - .getByRole('button', { name: 'Explorer panel options', exact: true }) - .click(); - await page - .getByRole('button', { name: 'Widen Explorer', exact: true }) - .click(); - await page.keyboard.press('Escape'); + .getByRole('separator', { name: 'Resize Explorer', exact: true }) + .focus(); + await page.keyboard.press('ArrowRight'); } await page .getByRole('button', { name: 'Show Issues', exact: true }) @@ -190,7 +193,7 @@ for (const theme of ['light', 'dark']) { exact: true, }); await expect( - page.getByRole('button', { name: 'Collapse Issues', exact: true }), + page.getByRole('button', { name: 'Hide Issues', exact: true }), ).toBeFocused(); await handle.focus(); await expect(handle).toBeFocused(); @@ -207,6 +210,7 @@ for (const theme of ['light', 'dark']) { for (const theme of ['light', 'dark']) { for (const narrow of [false, true]) { + if (narrow !== (theme === 'dark')) continue; test(`model ownership tree in ${theme}${narrow ? ' narrow' : ''}`, async ({ page, }) => { @@ -220,20 +224,13 @@ for (const theme of ['light', 'dark']) { .getByLabel('Theme', { exact: true }) .selectOption(theme); await page.getByRole('button', { name: 'Done', exact: true }).click(); - await page - .getByRole('button', { name: 'Explorer panel options', exact: true }) - .click(); - for (let i = 0; i < 4; i++) - await page - .getByRole('button', { name: 'Widen Explorer', exact: true }) - .click(); - await page.keyboard.press('Escape'); - await expect( - page.getByRole('button', { - name: 'Explorer panel options', - exact: true, - }), - ).toBeFocused(); + const explorerDivider = page.getByRole('separator', { + name: 'Resize Explorer', + exact: true, + }); + await explorerDivider.focus(); + for (let i = 0; i < 4; i++) await page.keyboard.press('ArrowRight'); + await expect(explorerDivider).toBeFocused(); const behavior = modelTreeItem(page, 'CompressorBehavior'); await behavior.focus(); await page.keyboard.press('ArrowRight'); @@ -267,6 +264,7 @@ for (const theme of ['light', 'dark']) { for (const theme of ['light', 'dark']) { for (const narrow of [false, true]) { + if (narrow !== (theme === 'dark')) continue; test(`source editor and search in ${theme}${narrow ? ' narrow' : ''}`, async ({ page, }) => { @@ -325,6 +323,7 @@ for (const theme of ['light', 'dark']) { for (const theme of ['light', 'dark']) { for (const narrow of [false, true]) { + if (narrow !== (theme === 'dark')) continue; test(`navigable source diagnostics in ${theme}${narrow ? ' narrow' : ''}`, async ({ page, }) => { @@ -368,6 +367,7 @@ for (const theme of ['light', 'dark']) { for (const theme of ['light', 'dark']) { for (const narrow of [false, true]) { + if (narrow !== (theme === 'dark')) continue; test(`local recovery dialog in ${theme}${narrow ? ' narrow' : ''}`, async ({ page, }) => { @@ -487,6 +487,11 @@ for (const theme of ['light', 'dark']) { for (const theme of ['light', 'dark']) { for (const width of [1440, 768, 390]) { + if (!( + (theme === 'light' && [1440, 390].includes(width)) || + (theme === 'dark' && width === 768) + )) + continue; test(`OpenMBEE entry surfaces in ${theme} at ${width}`, async ({ page, }) => { @@ -543,6 +548,7 @@ for (const theme of ['light', 'dark']) { for (const theme of ['light', 'dark']) { for (const narrow of [false, true]) { + if (narrow !== (theme === 'dark')) continue; test(`selected structural nodes in ${theme}${narrow ? ' narrow' : ''}`, async ({ page, }) => { @@ -578,6 +584,7 @@ for (const theme of ['light', 'dark']) { for (const theme of ['light', 'dark']) { for (const width of [390, 600]) { + if (width !== (theme === 'light' ? 390 : 600)) continue; test(`mobile project header in ${theme} at ${width}`, async ({ page }) => { await ready(page, { split: false }); await page.setViewportSize({ width, height: 900 }); @@ -601,6 +608,7 @@ for (const theme of ['light', 'dark']) { for (const theme of ['light', 'dark']) { for (const width of [1440, 768]) { + if (width !== (theme === 'light' ? 1440 : 768)) continue; test(`requirement hierarchy and declared satisfaction in ${theme} at ${width}`, async ({ page, }) => { @@ -664,6 +672,7 @@ for (const theme of ['light', 'dark']) { for (const theme of ['light', 'dark']) { for (const width of [1440, 768]) { + if (width !== (theme === 'light' ? 1440 : 768)) continue; test(`read-only model exploration in ${theme} at ${width}`, async ({ page, }) => { @@ -694,8 +703,8 @@ for (const theme of ['light', 'dark']) { page.getByRole('button', { name: 'Show Explorer', exact: true }), ).toBeFocused(); } - const scope = page.getByRole('combobox', { - name: 'Exploration scope', + const scope = page.getByRole('button', { + name: 'Change exploration scope', exact: true, }); const representation = page.getByRole('combobox', { @@ -712,7 +721,7 @@ for (const theme of ['light', 'dark']) { await expect(page).toHaveScreenshot( `exploration-overview-${theme}-${width}.png`, ); - await scope.selectOption('P::System'); + await selectExplorationScope(page, 'P::System'); await expect(scope).toBeEnabled(); await representation.selectOption('interconnection'); await expect( @@ -737,6 +746,7 @@ for (const theme of ['light', 'dark']) { for (const theme of ['light', 'dark']) for (const width of [1440, 768]) { + if (width !== (theme === 'light' ? 1440 : 768)) continue; test(`assembly exploration routing in ${theme} at ${width}`, async ({ page, }) => { @@ -775,11 +785,11 @@ for (const theme of ['light', 'dark']) await expect(page).toHaveScreenshot( `assembly-exploration-overview-${theme}-${width}.png`, ); - const scope = page.getByRole('combobox', { - name: 'Exploration scope', + const scope = page.getByRole('button', { + name: 'Change exploration scope', exact: true, }); - await scope.selectOption('Assembly::Station'); + await selectExplorationScope(page, 'Assembly::Station'); await expect(scope).toBeEnabled(); const representation = page.getByRole('combobox', { name: 'Exploration representation', @@ -800,6 +810,7 @@ for (const theme of ['light', 'dark']) for (const theme of ['light', 'dark']) for (const width of [1440, 768]) { + if (width !== (theme === 'light' ? 1440 : 768)) continue; test(`initial exploration retry in ${theme} at ${width}`, async ({ page, }) => { @@ -890,9 +901,7 @@ for (const theme of ['light', 'dark']) { await page.mouse.move(0, 0); await page.keyboard.press('Escape'); await expect(page.getByRole('tooltip')).not.toBeVisible(); - await page - .getByRole('combobox', { name: 'Named view', exact: true }) - .focus(); + await activeWorkspaceTab(page).focus(); await page.getByRole('button', { name: 'Fit view', exact: true }).click(); await page.evaluate(() => document.fonts.ready); await page.mouse.move(0, 0); @@ -915,6 +924,7 @@ for (const theme of ['light', 'dark']) { for (const theme of ['light', 'dark']) for (const width of [1440, 768]) { + if (width !== (theme === 'light' ? 1440 : 768)) continue; test(`rover guided behavior and traceability in ${theme} at ${width}`, async ({ page, }) => { @@ -937,12 +947,9 @@ for (const theme of ['light', 'dark']) page.getByRole('button', { name: 'Appearance', exact: true }), ).toBeFocused(); if (width === 768) await hideExplorer(page); - const selector = page.getByRole('combobox', { - name: 'Named view', - exact: true, - }); + const selector = activeWorkspaceTab(page); for (const view of ['mission', 'lifecycle', 'requirements']) { - await selector.selectOption('RoverViews::' + view); + await openNamedView(page, 'RoverViews::' + view); await expect(selector).toBeEnabled(); await page .getByRole('button', { name: 'Fit view', exact: true }) @@ -973,6 +980,7 @@ for (const theme of ['light', 'dark']) for (const theme of ['light', 'dark']) { for (const width of [1440, 768]) { + if (width !== (theme === 'light' ? 1440 : 768)) continue; for (const representation of [ 'Requirements table', 'Traceability matrix', @@ -993,9 +1001,7 @@ for (const theme of ['light', 'dark']) { await dialog.getByLabel('Theme', { exact: true }).selectOption(theme); await dialog.getByRole('button', { name: 'Done', exact: true }).click(); await page.setViewportSize({ width, height: 900 }); - await page - .getByRole('button', { name: representation, exact: true }) - .click(); + await openProjectData(page, representation); const panel = page.getByRole('region', { name: representation, exact: true, @@ -1014,6 +1020,7 @@ for (const theme of ['light', 'dark']) { for (const theme of ['light', 'dark']) { for (const width of [1440, 768]) { + if (width !== (theme === 'light' ? 1440 : 768)) continue; test(`editor guide in ${theme} at ${width}`, async ({ page }) => { await page.setViewportSize({ width, height: 900 }); await ready(page); @@ -1035,6 +1042,7 @@ for (const theme of ['light', 'dark']) { for (const theme of ['light', 'dark']) { for (const width of [1440, 768]) { + if (width !== (theme === 'light' ? 1440 : 768)) continue; test(`recovery conflict and saved-copy choices in ${theme} at ${width}`, async ({ page, }) => { @@ -1144,6 +1152,7 @@ for (const theme of ['light', 'dark']) { for (const theme of ['light', 'dark']) { for (const width of [1440, 768]) { + if (width !== (theme === 'light' ? 1440 : 768)) continue; test(`inherited structural occurrences ${theme} ${width}`, async ({ page, }) => { @@ -1160,9 +1169,10 @@ for (const theme of ['light', 'dark']) { ), ), }); - await expect( - page.getByRole('combobox', { name: 'Named view', exact: true }), - ).toHaveValue('Views::both'); + await expect(activeWorkspaceTab(page)).toHaveAttribute( + 'title', + 'view:' + 'Views::both', + ); await expect .poll(() => evaluations.some((view) => view.view === 'Views::both')) .toBe(true); @@ -1197,6 +1207,7 @@ for (const theme of ['light', 'dark']) { for (const theme of ['light', 'dark']) for (const width of [1440, 800]) { + if (width !== (theme === 'light' ? 1440 : 800)) continue; test(`source value inspection in ${theme} at ${width}px`, async ({ page, }) => { @@ -1217,9 +1228,7 @@ for (const theme of ['light', 'dark']) mimeType: 'text/plain', buffer, }); - await expect( - page.getByRole('combobox', { name: 'Named view', exact: true }), - ).toBeEnabled(); + await expect(activeWorkspaceTab(page)).toBeEnabled(); await page .getByRole('button', { name: 'Appearance', exact: true }) .click(); @@ -1242,6 +1251,9 @@ for (const theme of ['light', 'dark']) const node = diagramSymbol(page, binding.symbol); await node.focus(); await node.press('Enter'); + await page + .getByRole('button', { name: 'Inspect selection', exact: true }) + .click(); await page .getByRole('button', { name: 'Read at 100%', exact: true }) .click(); @@ -1261,6 +1273,7 @@ for (const theme of ['light', 'dark']) for (const theme of ['light', 'dark']) for (const width of [1440, 390]) { + if (width !== (theme === 'light' ? 1440 : 390)) continue; test(`pane-local source controls in ${theme} at ${width}px`, async ({ page, }) => { @@ -1314,10 +1327,13 @@ for (const theme of ['light', 'dark']) `source-pane-header-${theme}-${width}.png`, ); if (width === 390) { - await dragSeparator(page, 'Resize Source and Diagram', 'y', -2000); + await dragSeparator(page, 'Resize Source and Diagram', 'y', 2000); await expect .poll(async () => (await sourceHeaderGeometry(page)).editorHeight) .toBeGreaterThanOrEqual(80); + await expect + .poll(async () => (await sourceHeaderGeometry(page)).editorHeight) + .toBeLessThanOrEqual(82); await expect .poll(async () => (await sourceHeaderGeometry(page)).minInset) .toBeGreaterThanOrEqual(0); @@ -1332,6 +1348,7 @@ for (const theme of ['light', 'dark']) for (const theme of ['light', 'dark']) for (const width of [1440, 390]) { + if (width !== (theme === 'light' ? 1440 : 390)) continue; test(`composed Model header in ${theme} at ${width}px`, async ({ page, }) => { @@ -1365,16 +1382,15 @@ for (const theme of ['light', 'dark']) exact: true, }); await expect(header).toContainText('Applied revision · draft pending'); - await expect( - header.getByRole('combobox', { name: 'Named view', exact: true }), - ).toHaveValue('WorkshopViews::overview'); + await expect(activeWorkspaceTab(page)).toHaveAttribute( + 'title', + 'view:' + 'WorkshopViews::overview', + ); await page.mouse.move(0, 0); await expect(page).toHaveScreenshot( `model-header-diagram-${theme}-${width}.png`, ); - await header - .getByRole('button', { name: 'Requirements table', exact: true }) - .click(); + await openProjectData(page, 'Requirements table'); await expect( page .getByRole('region', { name: 'Requirements table', exact: true }) @@ -1395,6 +1411,7 @@ for (const theme of ['light', 'dark']) for (const theme of ['light', 'dark']) { for (const width of [1440, 390]) { + if (width !== (theme === 'light' ? 1440 : 390)) continue; test(`sectioned Explorer in ${theme} at ${width}px`, async ({ page }) => { await ready(page, { split: false }); await page.setViewportSize({ width, height: 900 }); @@ -1446,13 +1463,13 @@ test('workbench selection and focus in forced colors', async ({ page }) => { await page .getByRole('button', { name: 'Show source and model', exact: true }) .click(); - const header = page.getByRole('group', { name: 'Model header', exact: true }); - await header - .getByRole('button', { name: 'Requirements table', exact: true }) + await page + .getByRole('button', { name: 'Open workspace tab', exact: true }) .focus(); - await expect( - header.getByRole('button', { name: 'Diagram view', exact: true }), - ).toHaveAttribute('aria-pressed', 'true'); + await expect(activeWorkspaceTab(page)).toHaveAttribute( + 'aria-selected', + 'true', + ); await expect(page).toHaveScreenshot( 'workbench-forced-colors-selection-focus.png', ); @@ -1460,6 +1477,7 @@ test('workbench selection and focus in forced colors', async ({ page }) => { for (const theme of ['light', 'dark']) for (const width of [1440, 390]) { + if (width !== (theme === 'light' ? 1440 : 390)) continue; test(`generated document and embedded view in ${theme} at ${width}`, async ({ page, }) => { @@ -1499,3 +1517,51 @@ for (const theme of ['light', 'dark']) ); }); } + +for (const theme of ['light', 'dark']) + for (const width of [1440, 390]) { + if (width !== (theme === 'light' ? 1440 : 390)) continue; + test(`workspace content picker in ${theme} at ${width}`, async ({ + page, + }) => { + await ready(page, { split: false, inspection: false }); + await page.setViewportSize({ width, height: 900 }); + await hideExplorer(page); + await page + .getByRole('button', { name: 'Appearance', exact: true }) + .click(); + const appearance = page.getByRole('dialog', { + name: 'Appearance', + exact: true, + }); + await appearance.getByLabel('Theme', { exact: true }).selectOption(theme); + await appearance + .getByRole('button', { name: 'Done', exact: true }) + .click(); + await expect(appearance).not.toBeVisible(); + const trigger = page.getByRole('button', { + name: 'Open workspace tab', + exact: true, + }); + await trigger.focus(); + await trigger.press('Enter'); + const picker = page.getByRole('dialog', { + name: 'Open workspace tab', + exact: true, + }); + await expect(picker).toBeVisible(); + await expect( + picker.getByRole('button', { name: 'Requirements table', exact: true }), + ).toBeVisible(); + const bounds = await picker.boundingBox(); + expect(bounds!.x).toBeGreaterThanOrEqual(0); + expect(bounds!.x + bounds!.width).toBeLessThanOrEqual(width); + await page.mouse.move(0, 0); + await expect(page).toHaveScreenshot( + `workspace-picker-${theme}-${width}.png`, + ); + await page.keyboard.press('Escape'); + await expect(picker).not.toBeVisible(); + await expect(trigger).toBeFocused(); + }); + } diff --git a/tests/e2e/visual.spec.ts-snapshots/appearance-dark-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/appearance-dark-visual-linux.png index 03504c4..ed2a287 100644 Binary files a/tests/e2e/visual.spec.ts-snapshots/appearance-dark-visual-linux.png and b/tests/e2e/visual.spec.ts-snapshots/appearance-dark-visual-linux.png differ diff --git a/tests/e2e/visual.spec.ts-snapshots/appearance-narrow-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/appearance-narrow-visual-linux.png index 1a504c8..0f5d402 100644 Binary files a/tests/e2e/visual.spec.ts-snapshots/appearance-narrow-visual-linux.png and b/tests/e2e/visual.spec.ts-snapshots/appearance-narrow-visual-linux.png differ diff --git a/tests/e2e/visual.spec.ts-snapshots/assembly-dark-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/assembly-dark-visual-linux.png index 483b485..854071b 100644 Binary files a/tests/e2e/visual.spec.ts-snapshots/assembly-dark-visual-linux.png and b/tests/e2e/visual.spec.ts-snapshots/assembly-dark-visual-linux.png differ diff --git a/tests/e2e/visual.spec.ts-snapshots/assembly-exploration-overview-dark-1440-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/assembly-exploration-overview-dark-1440-visual-linux.png deleted file mode 100644 index 3d5c8ac..0000000 Binary files a/tests/e2e/visual.spec.ts-snapshots/assembly-exploration-overview-dark-1440-visual-linux.png and /dev/null differ diff --git a/tests/e2e/visual.spec.ts-snapshots/assembly-exploration-overview-dark-768-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/assembly-exploration-overview-dark-768-visual-linux.png index a0a8639..38588a3 100644 Binary files a/tests/e2e/visual.spec.ts-snapshots/assembly-exploration-overview-dark-768-visual-linux.png and b/tests/e2e/visual.spec.ts-snapshots/assembly-exploration-overview-dark-768-visual-linux.png differ diff --git a/tests/e2e/visual.spec.ts-snapshots/assembly-exploration-overview-light-1440-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/assembly-exploration-overview-light-1440-visual-linux.png index 25a411e..70283c3 100644 Binary files a/tests/e2e/visual.spec.ts-snapshots/assembly-exploration-overview-light-1440-visual-linux.png and b/tests/e2e/visual.spec.ts-snapshots/assembly-exploration-overview-light-1440-visual-linux.png differ diff --git a/tests/e2e/visual.spec.ts-snapshots/assembly-exploration-overview-light-768-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/assembly-exploration-overview-light-768-visual-linux.png deleted file mode 100644 index cc87f1b..0000000 Binary files a/tests/e2e/visual.spec.ts-snapshots/assembly-exploration-overview-light-768-visual-linux.png and /dev/null differ diff --git a/tests/e2e/visual.spec.ts-snapshots/assembly-exploration-structure-dark-1440-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/assembly-exploration-structure-dark-1440-visual-linux.png deleted file mode 100644 index c08cefa..0000000 Binary files a/tests/e2e/visual.spec.ts-snapshots/assembly-exploration-structure-dark-1440-visual-linux.png and /dev/null differ diff --git a/tests/e2e/visual.spec.ts-snapshots/assembly-exploration-structure-dark-768-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/assembly-exploration-structure-dark-768-visual-linux.png index 06e0c66..4b9da03 100644 Binary files a/tests/e2e/visual.spec.ts-snapshots/assembly-exploration-structure-dark-768-visual-linux.png and b/tests/e2e/visual.spec.ts-snapshots/assembly-exploration-structure-dark-768-visual-linux.png differ diff --git a/tests/e2e/visual.spec.ts-snapshots/assembly-exploration-structure-light-1440-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/assembly-exploration-structure-light-1440-visual-linux.png index bc7dca8..027b872 100644 Binary files a/tests/e2e/visual.spec.ts-snapshots/assembly-exploration-structure-light-1440-visual-linux.png and b/tests/e2e/visual.spec.ts-snapshots/assembly-exploration-structure-light-1440-visual-linux.png differ diff --git a/tests/e2e/visual.spec.ts-snapshots/assembly-exploration-structure-light-768-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/assembly-exploration-structure-light-768-visual-linux.png deleted file mode 100644 index 592fb99..0000000 Binary files a/tests/e2e/visual.spec.ts-snapshots/assembly-exploration-structure-light-768-visual-linux.png and /dev/null differ diff --git a/tests/e2e/visual.spec.ts-snapshots/assembly-light-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/assembly-light-visual-linux.png index ab1526e..fe50164 100644 Binary files a/tests/e2e/visual.spec.ts-snapshots/assembly-light-visual-linux.png and b/tests/e2e/visual.spec.ts-snapshots/assembly-light-visual-linux.png differ diff --git a/tests/e2e/visual.spec.ts-snapshots/authoring-connection-dark-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/authoring-connection-dark-visual-linux.png deleted file mode 100644 index 85b326f..0000000 Binary files a/tests/e2e/visual.spec.ts-snapshots/authoring-connection-dark-visual-linux.png and /dev/null differ diff --git a/tests/e2e/visual.spec.ts-snapshots/authoring-connection-light-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/authoring-connection-light-visual-linux.png index a725596..161ce50 100644 Binary files a/tests/e2e/visual.spec.ts-snapshots/authoring-connection-light-visual-linux.png and b/tests/e2e/visual.spec.ts-snapshots/authoring-connection-light-visual-linux.png differ diff --git a/tests/e2e/visual.spec.ts-snapshots/authoring-connection-narrow-dark-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/authoring-connection-narrow-dark-visual-linux.png index 2485e5d..4d718b0 100644 Binary files a/tests/e2e/visual.spec.ts-snapshots/authoring-connection-narrow-dark-visual-linux.png and b/tests/e2e/visual.spec.ts-snapshots/authoring-connection-narrow-dark-visual-linux.png differ diff --git a/tests/e2e/visual.spec.ts-snapshots/authoring-connection-narrow-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/authoring-connection-narrow-visual-linux.png deleted file mode 100644 index 66a929d..0000000 Binary files a/tests/e2e/visual.spec.ts-snapshots/authoring-connection-narrow-visual-linux.png and /dev/null differ diff --git a/tests/e2e/visual.spec.ts-snapshots/authoring-part-dark-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/authoring-part-dark-visual-linux.png deleted file mode 100644 index f1083b9..0000000 Binary files a/tests/e2e/visual.spec.ts-snapshots/authoring-part-dark-visual-linux.png and /dev/null differ diff --git a/tests/e2e/visual.spec.ts-snapshots/authoring-part-light-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/authoring-part-light-visual-linux.png index 56d4099..2ef36e8 100644 Binary files a/tests/e2e/visual.spec.ts-snapshots/authoring-part-light-visual-linux.png and b/tests/e2e/visual.spec.ts-snapshots/authoring-part-light-visual-linux.png differ diff --git a/tests/e2e/visual.spec.ts-snapshots/authoring-part-narrow-dark-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/authoring-part-narrow-dark-visual-linux.png index 683440a..ebbe4ea 100644 Binary files a/tests/e2e/visual.spec.ts-snapshots/authoring-part-narrow-dark-visual-linux.png and b/tests/e2e/visual.spec.ts-snapshots/authoring-part-narrow-dark-visual-linux.png differ diff --git a/tests/e2e/visual.spec.ts-snapshots/authoring-part-narrow-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/authoring-part-narrow-visual-linux.png deleted file mode 100644 index 1628688..0000000 Binary files a/tests/e2e/visual.spec.ts-snapshots/authoring-part-narrow-visual-linux.png and /dev/null differ diff --git a/tests/e2e/visual.spec.ts-snapshots/default-rover-architecture-dark-768-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/default-rover-architecture-dark-768-visual-linux.png index e14f279..a13c15f 100644 Binary files a/tests/e2e/visual.spec.ts-snapshots/default-rover-architecture-dark-768-visual-linux.png and b/tests/e2e/visual.spec.ts-snapshots/default-rover-architecture-dark-768-visual-linux.png differ diff --git a/tests/e2e/visual.spec.ts-snapshots/default-rover-architecture-light-768-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/default-rover-architecture-light-768-visual-linux.png index ad962fe..3dce384 100644 Binary files a/tests/e2e/visual.spec.ts-snapshots/default-rover-architecture-light-768-visual-linux.png and b/tests/e2e/visual.spec.ts-snapshots/default-rover-architecture-light-768-visual-linux.png differ diff --git a/tests/e2e/visual.spec.ts-snapshots/diagnostics-dark-narrow-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/diagnostics-dark-narrow-visual-linux.png index b07145e..5375a62 100644 Binary files a/tests/e2e/visual.spec.ts-snapshots/diagnostics-dark-narrow-visual-linux.png and b/tests/e2e/visual.spec.ts-snapshots/diagnostics-dark-narrow-visual-linux.png differ diff --git a/tests/e2e/visual.spec.ts-snapshots/diagnostics-dark-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/diagnostics-dark-visual-linux.png deleted file mode 100644 index 4787c10..0000000 Binary files a/tests/e2e/visual.spec.ts-snapshots/diagnostics-dark-visual-linux.png and /dev/null differ diff --git a/tests/e2e/visual.spec.ts-snapshots/diagnostics-light-narrow-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/diagnostics-light-narrow-visual-linux.png deleted file mode 100644 index 8ab5787..0000000 Binary files a/tests/e2e/visual.spec.ts-snapshots/diagnostics-light-narrow-visual-linux.png and /dev/null differ diff --git a/tests/e2e/visual.spec.ts-snapshots/diagnostics-light-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/diagnostics-light-visual-linux.png index 809cb89..36407d2 100644 Binary files a/tests/e2e/visual.spec.ts-snapshots/diagnostics-light-visual-linux.png and b/tests/e2e/visual.spec.ts-snapshots/diagnostics-light-visual-linux.png differ diff --git a/tests/e2e/visual.spec.ts-snapshots/document-embedded-dark-1440-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/document-embedded-dark-1440-visual-linux.png deleted file mode 100644 index 3ee99f6..0000000 Binary files a/tests/e2e/visual.spec.ts-snapshots/document-embedded-dark-1440-visual-linux.png and /dev/null differ diff --git a/tests/e2e/visual.spec.ts-snapshots/document-embedded-dark-390-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/document-embedded-dark-390-visual-linux.png index d2c1b4b..c43cf7d 100644 Binary files a/tests/e2e/visual.spec.ts-snapshots/document-embedded-dark-390-visual-linux.png and b/tests/e2e/visual.spec.ts-snapshots/document-embedded-dark-390-visual-linux.png differ diff --git a/tests/e2e/visual.spec.ts-snapshots/document-embedded-light-1440-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/document-embedded-light-1440-visual-linux.png index 4d4e121..661c06e 100644 Binary files a/tests/e2e/visual.spec.ts-snapshots/document-embedded-light-1440-visual-linux.png and b/tests/e2e/visual.spec.ts-snapshots/document-embedded-light-1440-visual-linux.png differ diff --git a/tests/e2e/visual.spec.ts-snapshots/document-embedded-light-390-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/document-embedded-light-390-visual-linux.png deleted file mode 100644 index 35f3ae5..0000000 Binary files a/tests/e2e/visual.spec.ts-snapshots/document-embedded-light-390-visual-linux.png and /dev/null differ diff --git a/tests/e2e/visual.spec.ts-snapshots/document-report-dark-1440-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/document-report-dark-1440-visual-linux.png deleted file mode 100644 index c4ee6e4..0000000 Binary files a/tests/e2e/visual.spec.ts-snapshots/document-report-dark-1440-visual-linux.png and /dev/null differ diff --git a/tests/e2e/visual.spec.ts-snapshots/document-report-dark-390-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/document-report-dark-390-visual-linux.png index 1cef0dd..0735d1d 100644 Binary files a/tests/e2e/visual.spec.ts-snapshots/document-report-dark-390-visual-linux.png and b/tests/e2e/visual.spec.ts-snapshots/document-report-dark-390-visual-linux.png differ diff --git a/tests/e2e/visual.spec.ts-snapshots/document-report-light-1440-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/document-report-light-1440-visual-linux.png index 30669d7..7895b27 100644 Binary files a/tests/e2e/visual.spec.ts-snapshots/document-report-light-1440-visual-linux.png and b/tests/e2e/visual.spec.ts-snapshots/document-report-light-1440-visual-linux.png differ diff --git a/tests/e2e/visual.spec.ts-snapshots/document-report-light-390-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/document-report-light-390-visual-linux.png deleted file mode 100644 index 879bafb..0000000 Binary files a/tests/e2e/visual.spec.ts-snapshots/document-report-light-390-visual-linux.png and /dev/null differ diff --git a/tests/e2e/visual.spec.ts-snapshots/editor-guide-dark-1440-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/editor-guide-dark-1440-visual-linux.png deleted file mode 100644 index d5c5d52..0000000 Binary files a/tests/e2e/visual.spec.ts-snapshots/editor-guide-dark-1440-visual-linux.png and /dev/null differ diff --git a/tests/e2e/visual.spec.ts-snapshots/editor-guide-dark-768-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/editor-guide-dark-768-visual-linux.png index 6a69e02..c58fc69 100644 Binary files a/tests/e2e/visual.spec.ts-snapshots/editor-guide-dark-768-visual-linux.png and b/tests/e2e/visual.spec.ts-snapshots/editor-guide-dark-768-visual-linux.png differ diff --git a/tests/e2e/visual.spec.ts-snapshots/editor-guide-light-1440-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/editor-guide-light-1440-visual-linux.png index 8205b88..e612b22 100644 Binary files a/tests/e2e/visual.spec.ts-snapshots/editor-guide-light-1440-visual-linux.png and b/tests/e2e/visual.spec.ts-snapshots/editor-guide-light-1440-visual-linux.png differ diff --git a/tests/e2e/visual.spec.ts-snapshots/editor-guide-light-768-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/editor-guide-light-768-visual-linux.png deleted file mode 100644 index 5c06250..0000000 Binary files a/tests/e2e/visual.spec.ts-snapshots/editor-guide-light-768-visual-linux.png and /dev/null differ diff --git a/tests/e2e/visual.spec.ts-snapshots/exploration-overview-dark-1440-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/exploration-overview-dark-1440-visual-linux.png deleted file mode 100644 index ba35741..0000000 Binary files a/tests/e2e/visual.spec.ts-snapshots/exploration-overview-dark-1440-visual-linux.png and /dev/null differ diff --git a/tests/e2e/visual.spec.ts-snapshots/exploration-overview-dark-768-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/exploration-overview-dark-768-visual-linux.png index 71f9cb4..a742e1d 100644 Binary files a/tests/e2e/visual.spec.ts-snapshots/exploration-overview-dark-768-visual-linux.png and b/tests/e2e/visual.spec.ts-snapshots/exploration-overview-dark-768-visual-linux.png differ diff --git a/tests/e2e/visual.spec.ts-snapshots/exploration-overview-light-1440-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/exploration-overview-light-1440-visual-linux.png index 48d131e..17e789a 100644 Binary files a/tests/e2e/visual.spec.ts-snapshots/exploration-overview-light-1440-visual-linux.png and b/tests/e2e/visual.spec.ts-snapshots/exploration-overview-light-1440-visual-linux.png differ diff --git a/tests/e2e/visual.spec.ts-snapshots/exploration-overview-light-768-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/exploration-overview-light-768-visual-linux.png deleted file mode 100644 index a75acc0..0000000 Binary files a/tests/e2e/visual.spec.ts-snapshots/exploration-overview-light-768-visual-linux.png and /dev/null differ diff --git a/tests/e2e/visual.spec.ts-snapshots/exploration-structure-dark-1440-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/exploration-structure-dark-1440-visual-linux.png deleted file mode 100644 index 7571080..0000000 Binary files a/tests/e2e/visual.spec.ts-snapshots/exploration-structure-dark-1440-visual-linux.png and /dev/null differ diff --git a/tests/e2e/visual.spec.ts-snapshots/exploration-structure-dark-768-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/exploration-structure-dark-768-visual-linux.png index a50cb34..5ac4c6d 100644 Binary files a/tests/e2e/visual.spec.ts-snapshots/exploration-structure-dark-768-visual-linux.png and b/tests/e2e/visual.spec.ts-snapshots/exploration-structure-dark-768-visual-linux.png differ diff --git a/tests/e2e/visual.spec.ts-snapshots/exploration-structure-light-1440-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/exploration-structure-light-1440-visual-linux.png index 8f8a937..a2c99a3 100644 Binary files a/tests/e2e/visual.spec.ts-snapshots/exploration-structure-light-1440-visual-linux.png and b/tests/e2e/visual.spec.ts-snapshots/exploration-structure-light-1440-visual-linux.png differ diff --git a/tests/e2e/visual.spec.ts-snapshots/exploration-structure-light-768-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/exploration-structure-light-768-visual-linux.png deleted file mode 100644 index 4fe183c..0000000 Binary files a/tests/e2e/visual.spec.ts-snapshots/exploration-structure-light-768-visual-linux.png and /dev/null differ diff --git a/tests/e2e/visual.spec.ts-snapshots/explorer-model-dark-1440-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/explorer-model-dark-1440-visual-linux.png deleted file mode 100644 index b432bce..0000000 Binary files a/tests/e2e/visual.spec.ts-snapshots/explorer-model-dark-1440-visual-linux.png and /dev/null differ diff --git a/tests/e2e/visual.spec.ts-snapshots/explorer-model-dark-390-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/explorer-model-dark-390-visual-linux.png index 512c548..6e515b5 100644 Binary files a/tests/e2e/visual.spec.ts-snapshots/explorer-model-dark-390-visual-linux.png and b/tests/e2e/visual.spec.ts-snapshots/explorer-model-dark-390-visual-linux.png differ diff --git a/tests/e2e/visual.spec.ts-snapshots/explorer-model-light-1440-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/explorer-model-light-1440-visual-linux.png index 3652a1b..704654d 100644 Binary files a/tests/e2e/visual.spec.ts-snapshots/explorer-model-light-1440-visual-linux.png and b/tests/e2e/visual.spec.ts-snapshots/explorer-model-light-1440-visual-linux.png differ diff --git a/tests/e2e/visual.spec.ts-snapshots/explorer-model-light-390-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/explorer-model-light-390-visual-linux.png deleted file mode 100644 index 6982d9b..0000000 Binary files a/tests/e2e/visual.spec.ts-snapshots/explorer-model-light-390-visual-linux.png and /dev/null differ diff --git a/tests/e2e/visual.spec.ts-snapshots/explorer-sections-dark-1440-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/explorer-sections-dark-1440-visual-linux.png deleted file mode 100644 index c5349a7..0000000 Binary files a/tests/e2e/visual.spec.ts-snapshots/explorer-sections-dark-1440-visual-linux.png and /dev/null differ diff --git a/tests/e2e/visual.spec.ts-snapshots/explorer-sections-dark-390-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/explorer-sections-dark-390-visual-linux.png index 200336f..43a3699 100644 Binary files a/tests/e2e/visual.spec.ts-snapshots/explorer-sections-dark-390-visual-linux.png and b/tests/e2e/visual.spec.ts-snapshots/explorer-sections-dark-390-visual-linux.png differ diff --git a/tests/e2e/visual.spec.ts-snapshots/explorer-sections-light-1440-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/explorer-sections-light-1440-visual-linux.png index d480f45..fd4335f 100644 Binary files a/tests/e2e/visual.spec.ts-snapshots/explorer-sections-light-1440-visual-linux.png and b/tests/e2e/visual.spec.ts-snapshots/explorer-sections-light-1440-visual-linux.png differ diff --git a/tests/e2e/visual.spec.ts-snapshots/explorer-sections-light-390-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/explorer-sections-light-390-visual-linux.png deleted file mode 100644 index 36199c4..0000000 Binary files a/tests/e2e/visual.spec.ts-snapshots/explorer-sections-light-390-visual-linux.png and /dev/null differ diff --git a/tests/e2e/visual.spec.ts-snapshots/inherited-occurrences-dark-1440-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/inherited-occurrences-dark-1440-visual-linux.png deleted file mode 100644 index 24c19f3..0000000 Binary files a/tests/e2e/visual.spec.ts-snapshots/inherited-occurrences-dark-1440-visual-linux.png and /dev/null differ diff --git a/tests/e2e/visual.spec.ts-snapshots/inherited-occurrences-dark-768-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/inherited-occurrences-dark-768-visual-linux.png index 43b7132..3c95865 100644 Binary files a/tests/e2e/visual.spec.ts-snapshots/inherited-occurrences-dark-768-visual-linux.png and b/tests/e2e/visual.spec.ts-snapshots/inherited-occurrences-dark-768-visual-linux.png differ diff --git a/tests/e2e/visual.spec.ts-snapshots/inherited-occurrences-light-1440-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/inherited-occurrences-light-1440-visual-linux.png index e1b8d0d..8eae8eb 100644 Binary files a/tests/e2e/visual.spec.ts-snapshots/inherited-occurrences-light-1440-visual-linux.png and b/tests/e2e/visual.spec.ts-snapshots/inherited-occurrences-light-1440-visual-linux.png differ diff --git a/tests/e2e/visual.spec.ts-snapshots/inherited-occurrences-light-768-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/inherited-occurrences-light-768-visual-linux.png deleted file mode 100644 index 6752382..0000000 Binary files a/tests/e2e/visual.spec.ts-snapshots/inherited-occurrences-light-768-visual-linux.png and /dev/null differ diff --git a/tests/e2e/visual.spec.ts-snapshots/initial-exploration-retry-dark-1440-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/initial-exploration-retry-dark-1440-visual-linux.png deleted file mode 100644 index 96bef82..0000000 Binary files a/tests/e2e/visual.spec.ts-snapshots/initial-exploration-retry-dark-1440-visual-linux.png and /dev/null differ diff --git a/tests/e2e/visual.spec.ts-snapshots/initial-exploration-retry-dark-768-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/initial-exploration-retry-dark-768-visual-linux.png index fc835bd..a23b77d 100644 Binary files a/tests/e2e/visual.spec.ts-snapshots/initial-exploration-retry-dark-768-visual-linux.png and b/tests/e2e/visual.spec.ts-snapshots/initial-exploration-retry-dark-768-visual-linux.png differ diff --git a/tests/e2e/visual.spec.ts-snapshots/initial-exploration-retry-light-1440-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/initial-exploration-retry-light-1440-visual-linux.png index 354259c..9d9c68b 100644 Binary files a/tests/e2e/visual.spec.ts-snapshots/initial-exploration-retry-light-1440-visual-linux.png and b/tests/e2e/visual.spec.ts-snapshots/initial-exploration-retry-light-1440-visual-linux.png differ diff --git a/tests/e2e/visual.spec.ts-snapshots/initial-exploration-retry-light-768-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/initial-exploration-retry-light-768-visual-linux.png deleted file mode 100644 index 44004af..0000000 Binary files a/tests/e2e/visual.spec.ts-snapshots/initial-exploration-retry-light-768-visual-linux.png and /dev/null differ diff --git a/tests/e2e/visual.spec.ts-snapshots/landing-dark-1440-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/landing-dark-1440-visual-linux.png deleted file mode 100644 index 1a7c86c..0000000 Binary files a/tests/e2e/visual.spec.ts-snapshots/landing-dark-1440-visual-linux.png and /dev/null differ diff --git a/tests/e2e/visual.spec.ts-snapshots/landing-dark-390-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/landing-dark-390-visual-linux.png deleted file mode 100644 index 44a678c..0000000 Binary files a/tests/e2e/visual.spec.ts-snapshots/landing-dark-390-visual-linux.png and /dev/null differ diff --git a/tests/e2e/visual.spec.ts-snapshots/landing-light-768-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/landing-light-768-visual-linux.png deleted file mode 100644 index 313641e..0000000 Binary files a/tests/e2e/visual.spec.ts-snapshots/landing-light-768-visual-linux.png and /dev/null differ diff --git a/tests/e2e/visual.spec.ts-snapshots/launcher-dark-1440-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/launcher-dark-1440-visual-linux.png deleted file mode 100644 index 3ce7c41..0000000 Binary files a/tests/e2e/visual.spec.ts-snapshots/launcher-dark-1440-visual-linux.png and /dev/null differ diff --git a/tests/e2e/visual.spec.ts-snapshots/launcher-dark-390-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/launcher-dark-390-visual-linux.png deleted file mode 100644 index b40c803..0000000 Binary files a/tests/e2e/visual.spec.ts-snapshots/launcher-dark-390-visual-linux.png and /dev/null differ diff --git a/tests/e2e/visual.spec.ts-snapshots/launcher-light-768-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/launcher-light-768-visual-linux.png deleted file mode 100644 index 509c0ec..0000000 Binary files a/tests/e2e/visual.spec.ts-snapshots/launcher-light-768-visual-linux.png and /dev/null differ diff --git a/tests/e2e/visual.spec.ts-snapshots/local-recovery-dark-narrow-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/local-recovery-dark-narrow-visual-linux.png index 2ba3531..287af2a 100644 Binary files a/tests/e2e/visual.spec.ts-snapshots/local-recovery-dark-narrow-visual-linux.png and b/tests/e2e/visual.spec.ts-snapshots/local-recovery-dark-narrow-visual-linux.png differ diff --git a/tests/e2e/visual.spec.ts-snapshots/local-recovery-dark-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/local-recovery-dark-visual-linux.png deleted file mode 100644 index 1b892ad..0000000 Binary files a/tests/e2e/visual.spec.ts-snapshots/local-recovery-dark-visual-linux.png and /dev/null differ diff --git a/tests/e2e/visual.spec.ts-snapshots/local-recovery-light-narrow-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/local-recovery-light-narrow-visual-linux.png deleted file mode 100644 index 0a82998..0000000 Binary files a/tests/e2e/visual.spec.ts-snapshots/local-recovery-light-narrow-visual-linux.png and /dev/null differ diff --git a/tests/e2e/visual.spec.ts-snapshots/local-recovery-light-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/local-recovery-light-visual-linux.png index 7692c34..ecc2ef2 100644 Binary files a/tests/e2e/visual.spec.ts-snapshots/local-recovery-light-visual-linux.png and b/tests/e2e/visual.spec.ts-snapshots/local-recovery-light-visual-linux.png differ diff --git a/tests/e2e/visual.spec.ts-snapshots/mobile-header-dark-390-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/mobile-header-dark-390-visual-linux.png deleted file mode 100644 index 5c80d67..0000000 Binary files a/tests/e2e/visual.spec.ts-snapshots/mobile-header-dark-390-visual-linux.png and /dev/null differ diff --git a/tests/e2e/visual.spec.ts-snapshots/mobile-header-light-600-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/mobile-header-light-600-visual-linux.png deleted file mode 100644 index 35446d2..0000000 Binary files a/tests/e2e/visual.spec.ts-snapshots/mobile-header-light-600-visual-linux.png and /dev/null differ diff --git a/tests/e2e/visual.spec.ts-snapshots/model-header-diagram-dark-1440-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/model-header-diagram-dark-1440-visual-linux.png deleted file mode 100644 index 07f9f6a..0000000 Binary files a/tests/e2e/visual.spec.ts-snapshots/model-header-diagram-dark-1440-visual-linux.png and /dev/null differ diff --git a/tests/e2e/visual.spec.ts-snapshots/model-header-diagram-dark-390-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/model-header-diagram-dark-390-visual-linux.png index b941bf0..c1498c4 100644 Binary files a/tests/e2e/visual.spec.ts-snapshots/model-header-diagram-dark-390-visual-linux.png and b/tests/e2e/visual.spec.ts-snapshots/model-header-diagram-dark-390-visual-linux.png differ diff --git a/tests/e2e/visual.spec.ts-snapshots/model-header-diagram-light-1440-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/model-header-diagram-light-1440-visual-linux.png index db793de..ffdae40 100644 Binary files a/tests/e2e/visual.spec.ts-snapshots/model-header-diagram-light-1440-visual-linux.png and b/tests/e2e/visual.spec.ts-snapshots/model-header-diagram-light-1440-visual-linux.png differ diff --git a/tests/e2e/visual.spec.ts-snapshots/model-header-diagram-light-390-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/model-header-diagram-light-390-visual-linux.png deleted file mode 100644 index 15562b3..0000000 Binary files a/tests/e2e/visual.spec.ts-snapshots/model-header-diagram-light-390-visual-linux.png and /dev/null differ diff --git a/tests/e2e/visual.spec.ts-snapshots/model-header-table-dark-1440-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/model-header-table-dark-1440-visual-linux.png deleted file mode 100644 index 175c8ea..0000000 Binary files a/tests/e2e/visual.spec.ts-snapshots/model-header-table-dark-1440-visual-linux.png and /dev/null differ diff --git a/tests/e2e/visual.spec.ts-snapshots/model-header-table-dark-390-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/model-header-table-dark-390-visual-linux.png index 7f06420..43702b9 100644 Binary files a/tests/e2e/visual.spec.ts-snapshots/model-header-table-dark-390-visual-linux.png and b/tests/e2e/visual.spec.ts-snapshots/model-header-table-dark-390-visual-linux.png differ diff --git a/tests/e2e/visual.spec.ts-snapshots/model-header-table-light-1440-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/model-header-table-light-1440-visual-linux.png index 89a0d96..ebdd195 100644 Binary files a/tests/e2e/visual.spec.ts-snapshots/model-header-table-light-1440-visual-linux.png and b/tests/e2e/visual.spec.ts-snapshots/model-header-table-light-1440-visual-linux.png differ diff --git a/tests/e2e/visual.spec.ts-snapshots/model-header-table-light-390-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/model-header-table-light-390-visual-linux.png deleted file mode 100644 index 78f77b5..0000000 Binary files a/tests/e2e/visual.spec.ts-snapshots/model-header-table-light-390-visual-linux.png and /dev/null differ diff --git a/tests/e2e/visual.spec.ts-snapshots/model-tree-dark-narrow-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/model-tree-dark-narrow-visual-linux.png index e8231da..a19da85 100644 Binary files a/tests/e2e/visual.spec.ts-snapshots/model-tree-dark-narrow-visual-linux.png and b/tests/e2e/visual.spec.ts-snapshots/model-tree-dark-narrow-visual-linux.png differ diff --git a/tests/e2e/visual.spec.ts-snapshots/model-tree-dark-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/model-tree-dark-visual-linux.png deleted file mode 100644 index 3184540..0000000 Binary files a/tests/e2e/visual.spec.ts-snapshots/model-tree-dark-visual-linux.png and /dev/null differ diff --git a/tests/e2e/visual.spec.ts-snapshots/model-tree-light-narrow-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/model-tree-light-narrow-visual-linux.png deleted file mode 100644 index 8ed4173..0000000 Binary files a/tests/e2e/visual.spec.ts-snapshots/model-tree-light-narrow-visual-linux.png and /dev/null differ diff --git a/tests/e2e/visual.spec.ts-snapshots/model-tree-light-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/model-tree-light-visual-linux.png index e21ed5c..b168510 100644 Binary files a/tests/e2e/visual.spec.ts-snapshots/model-tree-light-visual-linux.png and b/tests/e2e/visual.spec.ts-snapshots/model-tree-light-visual-linux.png differ diff --git a/tests/e2e/visual.spec.ts-snapshots/panels-dark-narrow-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/panels-dark-narrow-visual-linux.png index d2e51af..ef073de 100644 Binary files a/tests/e2e/visual.spec.ts-snapshots/panels-dark-narrow-visual-linux.png and b/tests/e2e/visual.spec.ts-snapshots/panels-dark-narrow-visual-linux.png differ diff --git a/tests/e2e/visual.spec.ts-snapshots/panels-dark-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/panels-dark-visual-linux.png deleted file mode 100644 index 9934f62..0000000 Binary files a/tests/e2e/visual.spec.ts-snapshots/panels-dark-visual-linux.png and /dev/null differ diff --git a/tests/e2e/visual.spec.ts-snapshots/panels-light-narrow-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/panels-light-narrow-visual-linux.png deleted file mode 100644 index c2174f7..0000000 Binary files a/tests/e2e/visual.spec.ts-snapshots/panels-light-narrow-visual-linux.png and /dev/null differ diff --git a/tests/e2e/visual.spec.ts-snapshots/panels-light-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/panels-light-visual-linux.png index 71f1e9a..9ca9afc 100644 Binary files a/tests/e2e/visual.spec.ts-snapshots/panels-light-visual-linux.png and b/tests/e2e/visual.spec.ts-snapshots/panels-light-visual-linux.png differ diff --git a/tests/e2e/visual.spec.ts-snapshots/recovery-choices-dark-1440-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/recovery-choices-dark-1440-visual-linux.png deleted file mode 100644 index e5fec55..0000000 Binary files a/tests/e2e/visual.spec.ts-snapshots/recovery-choices-dark-1440-visual-linux.png and /dev/null differ diff --git a/tests/e2e/visual.spec.ts-snapshots/recovery-choices-dark-768-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/recovery-choices-dark-768-visual-linux.png index f6906ce..a4b7386 100644 Binary files a/tests/e2e/visual.spec.ts-snapshots/recovery-choices-dark-768-visual-linux.png and b/tests/e2e/visual.spec.ts-snapshots/recovery-choices-dark-768-visual-linux.png differ diff --git a/tests/e2e/visual.spec.ts-snapshots/recovery-choices-light-1440-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/recovery-choices-light-1440-visual-linux.png index 8fc7bf1..450be6d 100644 Binary files a/tests/e2e/visual.spec.ts-snapshots/recovery-choices-light-1440-visual-linux.png and b/tests/e2e/visual.spec.ts-snapshots/recovery-choices-light-1440-visual-linux.png differ diff --git a/tests/e2e/visual.spec.ts-snapshots/recovery-choices-light-768-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/recovery-choices-light-768-visual-linux.png deleted file mode 100644 index 8a06614..0000000 Binary files a/tests/e2e/visual.spec.ts-snapshots/recovery-choices-light-768-visual-linux.png and /dev/null differ diff --git a/tests/e2e/visual.spec.ts-snapshots/recovery-conflict-dark-1440-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/recovery-conflict-dark-1440-visual-linux.png deleted file mode 100644 index 5f38e7b..0000000 Binary files a/tests/e2e/visual.spec.ts-snapshots/recovery-conflict-dark-1440-visual-linux.png and /dev/null differ diff --git a/tests/e2e/visual.spec.ts-snapshots/recovery-conflict-dark-768-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/recovery-conflict-dark-768-visual-linux.png index a561351..e0a9dd0 100644 Binary files a/tests/e2e/visual.spec.ts-snapshots/recovery-conflict-dark-768-visual-linux.png and b/tests/e2e/visual.spec.ts-snapshots/recovery-conflict-dark-768-visual-linux.png differ diff --git a/tests/e2e/visual.spec.ts-snapshots/recovery-conflict-light-1440-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/recovery-conflict-light-1440-visual-linux.png index 42af288..72431f4 100644 Binary files a/tests/e2e/visual.spec.ts-snapshots/recovery-conflict-light-1440-visual-linux.png and b/tests/e2e/visual.spec.ts-snapshots/recovery-conflict-light-1440-visual-linux.png differ diff --git a/tests/e2e/visual.spec.ts-snapshots/recovery-conflict-light-768-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/recovery-conflict-light-768-visual-linux.png deleted file mode 100644 index 49460aa..0000000 Binary files a/tests/e2e/visual.spec.ts-snapshots/recovery-conflict-light-768-visual-linux.png and /dev/null differ diff --git a/tests/e2e/visual.spec.ts-snapshots/requirements-dark-1440-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/requirements-dark-1440-visual-linux.png deleted file mode 100644 index 5669859..0000000 Binary files a/tests/e2e/visual.spec.ts-snapshots/requirements-dark-1440-visual-linux.png and /dev/null differ diff --git a/tests/e2e/visual.spec.ts-snapshots/requirements-dark-768-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/requirements-dark-768-visual-linux.png index bb44527..c132bde 100644 Binary files a/tests/e2e/visual.spec.ts-snapshots/requirements-dark-768-visual-linux.png and b/tests/e2e/visual.spec.ts-snapshots/requirements-dark-768-visual-linux.png differ diff --git a/tests/e2e/visual.spec.ts-snapshots/requirements-light-1440-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/requirements-light-1440-visual-linux.png index 1e17567..ea4ec7e 100644 Binary files a/tests/e2e/visual.spec.ts-snapshots/requirements-light-1440-visual-linux.png and b/tests/e2e/visual.spec.ts-snapshots/requirements-light-1440-visual-linux.png differ diff --git a/tests/e2e/visual.spec.ts-snapshots/requirements-light-768-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/requirements-light-768-visual-linux.png deleted file mode 100644 index 1111825..0000000 Binary files a/tests/e2e/visual.spec.ts-snapshots/requirements-light-768-visual-linux.png and /dev/null differ diff --git a/tests/e2e/visual.spec.ts-snapshots/requirements-overview-dark-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/requirements-overview-dark-visual-linux.png deleted file mode 100644 index e906999..0000000 Binary files a/tests/e2e/visual.spec.ts-snapshots/requirements-overview-dark-visual-linux.png and /dev/null differ diff --git a/tests/e2e/visual.spec.ts-snapshots/requirements-overview-light-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/requirements-overview-light-visual-linux.png index bebc270..09a9eae 100644 Binary files a/tests/e2e/visual.spec.ts-snapshots/requirements-overview-light-visual-linux.png and b/tests/e2e/visual.spec.ts-snapshots/requirements-overview-light-visual-linux.png differ diff --git a/tests/e2e/visual.spec.ts-snapshots/requirements-table-dark-1440-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/requirements-table-dark-1440-visual-linux.png deleted file mode 100644 index 22c29fc..0000000 Binary files a/tests/e2e/visual.spec.ts-snapshots/requirements-table-dark-1440-visual-linux.png and /dev/null differ diff --git a/tests/e2e/visual.spec.ts-snapshots/requirements-table-dark-768-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/requirements-table-dark-768-visual-linux.png index 2015f48..b82aa55 100644 Binary files a/tests/e2e/visual.spec.ts-snapshots/requirements-table-dark-768-visual-linux.png and b/tests/e2e/visual.spec.ts-snapshots/requirements-table-dark-768-visual-linux.png differ diff --git a/tests/e2e/visual.spec.ts-snapshots/requirements-table-light-1440-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/requirements-table-light-1440-visual-linux.png index 6867eca..5249ccf 100644 Binary files a/tests/e2e/visual.spec.ts-snapshots/requirements-table-light-1440-visual-linux.png and b/tests/e2e/visual.spec.ts-snapshots/requirements-table-light-1440-visual-linux.png differ diff --git a/tests/e2e/visual.spec.ts-snapshots/requirements-table-light-768-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/requirements-table-light-768-visual-linux.png deleted file mode 100644 index f6ba567..0000000 Binary files a/tests/e2e/visual.spec.ts-snapshots/requirements-table-light-768-visual-linux.png and /dev/null differ diff --git a/tests/e2e/visual.spec.ts-snapshots/rover-lifecycle-dark-1440-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/rover-lifecycle-dark-1440-visual-linux.png deleted file mode 100644 index 0db3bea..0000000 Binary files a/tests/e2e/visual.spec.ts-snapshots/rover-lifecycle-dark-1440-visual-linux.png and /dev/null differ diff --git a/tests/e2e/visual.spec.ts-snapshots/rover-lifecycle-dark-768-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/rover-lifecycle-dark-768-visual-linux.png index ee5f1f5..4fbc586 100644 Binary files a/tests/e2e/visual.spec.ts-snapshots/rover-lifecycle-dark-768-visual-linux.png and b/tests/e2e/visual.spec.ts-snapshots/rover-lifecycle-dark-768-visual-linux.png differ diff --git a/tests/e2e/visual.spec.ts-snapshots/rover-lifecycle-light-1440-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/rover-lifecycle-light-1440-visual-linux.png index d96f1eb..3a78698 100644 Binary files a/tests/e2e/visual.spec.ts-snapshots/rover-lifecycle-light-1440-visual-linux.png and b/tests/e2e/visual.spec.ts-snapshots/rover-lifecycle-light-1440-visual-linux.png differ diff --git a/tests/e2e/visual.spec.ts-snapshots/rover-lifecycle-light-768-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/rover-lifecycle-light-768-visual-linux.png deleted file mode 100644 index 6ec07f1..0000000 Binary files a/tests/e2e/visual.spec.ts-snapshots/rover-lifecycle-light-768-visual-linux.png and /dev/null differ diff --git a/tests/e2e/visual.spec.ts-snapshots/rover-mission-dark-1440-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/rover-mission-dark-1440-visual-linux.png deleted file mode 100644 index c9b0fd0..0000000 Binary files a/tests/e2e/visual.spec.ts-snapshots/rover-mission-dark-1440-visual-linux.png and /dev/null differ diff --git a/tests/e2e/visual.spec.ts-snapshots/rover-mission-dark-768-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/rover-mission-dark-768-visual-linux.png index c2a1074..b9e1488 100644 Binary files a/tests/e2e/visual.spec.ts-snapshots/rover-mission-dark-768-visual-linux.png and b/tests/e2e/visual.spec.ts-snapshots/rover-mission-dark-768-visual-linux.png differ diff --git a/tests/e2e/visual.spec.ts-snapshots/rover-mission-light-1440-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/rover-mission-light-1440-visual-linux.png index b2bffba..18ff2e2 100644 Binary files a/tests/e2e/visual.spec.ts-snapshots/rover-mission-light-1440-visual-linux.png and b/tests/e2e/visual.spec.ts-snapshots/rover-mission-light-1440-visual-linux.png differ diff --git a/tests/e2e/visual.spec.ts-snapshots/rover-mission-light-768-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/rover-mission-light-768-visual-linux.png deleted file mode 100644 index cb3b2ef..0000000 Binary files a/tests/e2e/visual.spec.ts-snapshots/rover-mission-light-768-visual-linux.png and /dev/null differ diff --git a/tests/e2e/visual.spec.ts-snapshots/rover-requirements-dark-1440-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/rover-requirements-dark-1440-visual-linux.png deleted file mode 100644 index 8fde9bc..0000000 Binary files a/tests/e2e/visual.spec.ts-snapshots/rover-requirements-dark-1440-visual-linux.png and /dev/null differ diff --git a/tests/e2e/visual.spec.ts-snapshots/rover-requirements-dark-768-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/rover-requirements-dark-768-visual-linux.png index 30bc5e3..8396666 100644 Binary files a/tests/e2e/visual.spec.ts-snapshots/rover-requirements-dark-768-visual-linux.png and b/tests/e2e/visual.spec.ts-snapshots/rover-requirements-dark-768-visual-linux.png differ diff --git a/tests/e2e/visual.spec.ts-snapshots/rover-requirements-light-1440-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/rover-requirements-light-1440-visual-linux.png index 1ed0d1b..49d0431 100644 Binary files a/tests/e2e/visual.spec.ts-snapshots/rover-requirements-light-1440-visual-linux.png and b/tests/e2e/visual.spec.ts-snapshots/rover-requirements-light-1440-visual-linux.png differ diff --git a/tests/e2e/visual.spec.ts-snapshots/rover-requirements-light-768-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/rover-requirements-light-768-visual-linux.png deleted file mode 100644 index 3785957..0000000 Binary files a/tests/e2e/visual.spec.ts-snapshots/rover-requirements-light-768-visual-linux.png and /dev/null differ diff --git a/tests/e2e/visual.spec.ts-snapshots/selected-structure-dark-narrow-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/selected-structure-dark-narrow-visual-linux.png index 2905ffa..07fe62a 100644 Binary files a/tests/e2e/visual.spec.ts-snapshots/selected-structure-dark-narrow-visual-linux.png and b/tests/e2e/visual.spec.ts-snapshots/selected-structure-dark-narrow-visual-linux.png differ diff --git a/tests/e2e/visual.spec.ts-snapshots/selected-structure-dark-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/selected-structure-dark-visual-linux.png deleted file mode 100644 index 2d10729..0000000 Binary files a/tests/e2e/visual.spec.ts-snapshots/selected-structure-dark-visual-linux.png and /dev/null differ diff --git a/tests/e2e/visual.spec.ts-snapshots/selected-structure-light-narrow-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/selected-structure-light-narrow-visual-linux.png deleted file mode 100644 index b6d696e..0000000 Binary files a/tests/e2e/visual.spec.ts-snapshots/selected-structure-light-narrow-visual-linux.png and /dev/null differ diff --git a/tests/e2e/visual.spec.ts-snapshots/selected-structure-light-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/selected-structure-light-visual-linux.png index c8f45b5..2e0f590 100644 Binary files a/tests/e2e/visual.spec.ts-snapshots/selected-structure-light-visual-linux.png and b/tests/e2e/visual.spec.ts-snapshots/selected-structure-light-visual-linux.png differ diff --git a/tests/e2e/visual.spec.ts-snapshots/source-editor-dark-narrow-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/source-editor-dark-narrow-visual-linux.png index 2565ca0..ec4cb45 100644 Binary files a/tests/e2e/visual.spec.ts-snapshots/source-editor-dark-narrow-visual-linux.png and b/tests/e2e/visual.spec.ts-snapshots/source-editor-dark-narrow-visual-linux.png differ diff --git a/tests/e2e/visual.spec.ts-snapshots/source-editor-dark-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/source-editor-dark-visual-linux.png deleted file mode 100644 index 3866e6c..0000000 Binary files a/tests/e2e/visual.spec.ts-snapshots/source-editor-dark-visual-linux.png and /dev/null differ diff --git a/tests/e2e/visual.spec.ts-snapshots/source-editor-light-narrow-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/source-editor-light-narrow-visual-linux.png deleted file mode 100644 index 43c81f3..0000000 Binary files a/tests/e2e/visual.spec.ts-snapshots/source-editor-light-narrow-visual-linux.png and /dev/null differ diff --git a/tests/e2e/visual.spec.ts-snapshots/source-editor-light-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/source-editor-light-visual-linux.png index d5fc5a1..7dc8816 100644 Binary files a/tests/e2e/visual.spec.ts-snapshots/source-editor-light-visual-linux.png and b/tests/e2e/visual.spec.ts-snapshots/source-editor-light-visual-linux.png differ diff --git a/tests/e2e/visual.spec.ts-snapshots/source-pane-header-dark-1440-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/source-pane-header-dark-1440-visual-linux.png deleted file mode 100644 index 3b695fb..0000000 Binary files a/tests/e2e/visual.spec.ts-snapshots/source-pane-header-dark-1440-visual-linux.png and /dev/null differ diff --git a/tests/e2e/visual.spec.ts-snapshots/source-pane-header-dark-390-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/source-pane-header-dark-390-visual-linux.png index 6aca47e..86ff643 100644 Binary files a/tests/e2e/visual.spec.ts-snapshots/source-pane-header-dark-390-visual-linux.png and b/tests/e2e/visual.spec.ts-snapshots/source-pane-header-dark-390-visual-linux.png differ diff --git a/tests/e2e/visual.spec.ts-snapshots/source-pane-header-light-1440-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/source-pane-header-light-1440-visual-linux.png index 38f5846..96d5d33 100644 Binary files a/tests/e2e/visual.spec.ts-snapshots/source-pane-header-light-1440-visual-linux.png and b/tests/e2e/visual.spec.ts-snapshots/source-pane-header-light-1440-visual-linux.png differ diff --git a/tests/e2e/visual.spec.ts-snapshots/source-pane-header-light-390-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/source-pane-header-light-390-visual-linux.png deleted file mode 100644 index 0d1bfd6..0000000 Binary files a/tests/e2e/visual.spec.ts-snapshots/source-pane-header-light-390-visual-linux.png and /dev/null differ diff --git a/tests/e2e/visual.spec.ts-snapshots/source-pane-minimum-dark-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/source-pane-minimum-dark-visual-linux.png index 6c4382f..86ff643 100644 Binary files a/tests/e2e/visual.spec.ts-snapshots/source-pane-minimum-dark-visual-linux.png and b/tests/e2e/visual.spec.ts-snapshots/source-pane-minimum-dark-visual-linux.png differ diff --git a/tests/e2e/visual.spec.ts-snapshots/source-pane-minimum-light-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/source-pane-minimum-light-visual-linux.png deleted file mode 100644 index 3447a3f..0000000 Binary files a/tests/e2e/visual.spec.ts-snapshots/source-pane-minimum-light-visual-linux.png and /dev/null differ diff --git a/tests/e2e/visual.spec.ts-snapshots/source-values-dark-1440-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/source-values-dark-1440-visual-linux.png deleted file mode 100644 index 8d5f7ef..0000000 Binary files a/tests/e2e/visual.spec.ts-snapshots/source-values-dark-1440-visual-linux.png and /dev/null differ diff --git a/tests/e2e/visual.spec.ts-snapshots/source-values-dark-800-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/source-values-dark-800-visual-linux.png index e46033b..5cbfbd5 100644 Binary files a/tests/e2e/visual.spec.ts-snapshots/source-values-dark-800-visual-linux.png and b/tests/e2e/visual.spec.ts-snapshots/source-values-dark-800-visual-linux.png differ diff --git a/tests/e2e/visual.spec.ts-snapshots/source-values-light-1440-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/source-values-light-1440-visual-linux.png index fcf37a7..7399fb7 100644 Binary files a/tests/e2e/visual.spec.ts-snapshots/source-values-light-1440-visual-linux.png and b/tests/e2e/visual.spec.ts-snapshots/source-values-light-1440-visual-linux.png differ diff --git a/tests/e2e/visual.spec.ts-snapshots/source-values-light-800-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/source-values-light-800-visual-linux.png deleted file mode 100644 index 76343db..0000000 Binary files a/tests/e2e/visual.spec.ts-snapshots/source-values-light-800-visual-linux.png and /dev/null differ diff --git a/tests/e2e/visual.spec.ts-snapshots/symbol-information-dark-narrow-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/symbol-information-dark-narrow-visual-linux.png index 3803da1..05c1913 100644 Binary files a/tests/e2e/visual.spec.ts-snapshots/symbol-information-dark-narrow-visual-linux.png and b/tests/e2e/visual.spec.ts-snapshots/symbol-information-dark-narrow-visual-linux.png differ diff --git a/tests/e2e/visual.spec.ts-snapshots/symbol-information-dark-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/symbol-information-dark-visual-linux.png deleted file mode 100644 index 6a859d3..0000000 Binary files a/tests/e2e/visual.spec.ts-snapshots/symbol-information-dark-visual-linux.png and /dev/null differ diff --git a/tests/e2e/visual.spec.ts-snapshots/symbol-information-light-narrow-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/symbol-information-light-narrow-visual-linux.png deleted file mode 100644 index 04cafce..0000000 Binary files a/tests/e2e/visual.spec.ts-snapshots/symbol-information-light-narrow-visual-linux.png and /dev/null differ diff --git a/tests/e2e/visual.spec.ts-snapshots/symbol-information-light-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/symbol-information-light-visual-linux.png index 746b180..6717ad0 100644 Binary files a/tests/e2e/visual.spec.ts-snapshots/symbol-information-light-visual-linux.png and b/tests/e2e/visual.spec.ts-snapshots/symbol-information-light-visual-linux.png differ diff --git a/tests/e2e/visual.spec.ts-snapshots/traceability-matrix-dark-1440-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/traceability-matrix-dark-1440-visual-linux.png deleted file mode 100644 index 1866381..0000000 Binary files a/tests/e2e/visual.spec.ts-snapshots/traceability-matrix-dark-1440-visual-linux.png and /dev/null differ diff --git a/tests/e2e/visual.spec.ts-snapshots/traceability-matrix-dark-768-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/traceability-matrix-dark-768-visual-linux.png index dbf7299..bfcebd0 100644 Binary files a/tests/e2e/visual.spec.ts-snapshots/traceability-matrix-dark-768-visual-linux.png and b/tests/e2e/visual.spec.ts-snapshots/traceability-matrix-dark-768-visual-linux.png differ diff --git a/tests/e2e/visual.spec.ts-snapshots/traceability-matrix-light-1440-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/traceability-matrix-light-1440-visual-linux.png index 1384775..5a0bd85 100644 Binary files a/tests/e2e/visual.spec.ts-snapshots/traceability-matrix-light-1440-visual-linux.png and b/tests/e2e/visual.spec.ts-snapshots/traceability-matrix-light-1440-visual-linux.png differ diff --git a/tests/e2e/visual.spec.ts-snapshots/traceability-matrix-light-768-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/traceability-matrix-light-768-visual-linux.png deleted file mode 100644 index 2708a0f..0000000 Binary files a/tests/e2e/visual.spec.ts-snapshots/traceability-matrix-light-768-visual-linux.png and /dev/null differ diff --git a/tests/e2e/visual.spec.ts-snapshots/workbench-dark-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/workbench-dark-visual-linux.png index faa263c..bbc81d6 100644 Binary files a/tests/e2e/visual.spec.ts-snapshots/workbench-dark-visual-linux.png and b/tests/e2e/visual.spec.ts-snapshots/workbench-dark-visual-linux.png differ diff --git a/tests/e2e/visual.spec.ts-snapshots/workbench-forced-colors-selection-focus-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/workbench-forced-colors-selection-focus-visual-linux.png index c7a4415..35df3d0 100644 Binary files a/tests/e2e/visual.spec.ts-snapshots/workbench-forced-colors-selection-focus-visual-linux.png and b/tests/e2e/visual.spec.ts-snapshots/workbench-forced-colors-selection-focus-visual-linux.png differ diff --git a/tests/e2e/visual.spec.ts-snapshots/workbench-light-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/workbench-light-visual-linux.png index 8d30563..b2d70d1 100644 Binary files a/tests/e2e/visual.spec.ts-snapshots/workbench-light-visual-linux.png and b/tests/e2e/visual.spec.ts-snapshots/workbench-light-visual-linux.png differ diff --git a/tests/e2e/visual.spec.ts-snapshots/workbench-narrow-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/workbench-narrow-visual-linux.png index 6ef9793..51d4d8d 100644 Binary files a/tests/e2e/visual.spec.ts-snapshots/workbench-narrow-visual-linux.png and b/tests/e2e/visual.spec.ts-snapshots/workbench-narrow-visual-linux.png differ diff --git a/tests/e2e/visual.spec.ts-snapshots/workspace-picker-dark-390-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/workspace-picker-dark-390-visual-linux.png new file mode 100644 index 0000000..1005cad Binary files /dev/null and b/tests/e2e/visual.spec.ts-snapshots/workspace-picker-dark-390-visual-linux.png differ diff --git a/tests/e2e/visual.spec.ts-snapshots/workspace-picker-light-1440-visual-linux.png b/tests/e2e/visual.spec.ts-snapshots/workspace-picker-light-1440-visual-linux.png new file mode 100644 index 0000000..e8f5e7f Binary files /dev/null and b/tests/e2e/visual.spec.ts-snapshots/workspace-picker-light-1440-visual-linux.png differ diff --git a/tests/e2e/workbench-chrome.spec.ts b/tests/e2e/workbench-chrome.spec.ts index 0503192..81eee8f 100644 --- a/tests/e2e/workbench-chrome.spec.ts +++ b/tests/e2e/workbench-chrome.spec.ts @@ -1,3 +1,4 @@ +import { activeWorkspaceTab } from './support'; import { test, expect, @@ -47,9 +48,11 @@ test('@critical keeps primary controls reachable across widths, narrow panes and exact: true, }); // Begin from a known closed tool before viewport changes can auto-collapse it. - await page - .getByRole('button', { name: 'Collapse Inspector', exact: true }) - .click(); + const closeInspection = page.getByRole('button', { + name: 'Collapse Inspector', + exact: true, + }); + if (await closeInspection.isVisible()) await closeInspection.click(); for (const width of [1440, 1200, 1000, 900, 768, 600, 390, 1440]) { await page.setViewportSize({ width, height: 900 }); if (width === 390) { @@ -71,15 +74,10 @@ test('@critical keeps primary controls reachable across widths, narrow panes and true, ); } - for (const name of [ - 'Diagram view', - 'Requirements table', - 'Traceability matrix', - ]) { - const button = header.getByRole('button', { name, exact: true }); + for (const name of ['Open workspace tab', 'Inspect selection']) { + const button = page.getByRole('button', { name, exact: true }); await button.focus(); await expect.poll(() => controlReachable(button)).toBe(true); - expect(await fits(button, header), `${name} fits at ${width}`).toBe(true); } expect(await diagramCamera(page)).toEqual(camera); expect(await editor!.evaluate((element) => element.isConnected)).toBe(true); @@ -90,7 +88,7 @@ test('@critical keeps primary controls reachable across widths, narrow panes and for (const name of [ 'Apply source', 'Discard draft', - 'Traceability matrix', + 'Open workspace tab', ]) { const button = page.getByRole('button', { name, exact: true }); await button.focus(); @@ -98,7 +96,7 @@ test('@critical keeps primary controls reachable across widths, narrow panes and expect( await fits( button, - name === 'Traceability matrix' ? header : sourcePane, + name === 'Open workspace tab' ? header.locator('..') : sourcePane, ), ).toBe(true); } @@ -117,7 +115,7 @@ test('keeps canvas controls keyboard reachable at the vertical minimum', async ( .getByRole('button', { name: 'Show source and model', exact: true }) .click(); const saved = (await downloadProject(page)).bundle; - await dragSeparator(page, 'Resize Source and Diagram', 'y', 2000); + await dragSeparator(page, 'Resize Source and Diagram', 'y', -2000); for (const name of ['Zoom in', 'Zoom out', 'Fit view', 'Read at 100%']) { const button = page.getByRole('button', { name, exact: true }); await button.focus(); @@ -133,27 +131,22 @@ test('@critical distinguishes persistent selection from keyboard focus in forced await page.emulateMedia({ forcedColors: 'active', reducedMotion: 'reduce' }); await page.goto('/app'); await importWorkshop(page); - const group = page.getByRole('group', { - name: 'Model representation', - exact: true, - }); - const selected = group.getByRole('button', { - name: 'Diagram view', - exact: true, - }); - const focused = group.getByRole('button', { - name: 'Requirements table', + const selected = activeWorkspaceTab(page); + const focused = page.getByRole('button', { + name: 'Open workspace tab', exact: true, }); await focused.focus(); await expect(focused).toBeFocused(); - await expect(selected).toHaveAttribute('aria-pressed', 'true'); - await expect(focused).toHaveAttribute('aria-pressed', 'false'); + await expect(selected).toHaveAttribute('aria-selected', 'true'); + await expect(focused).toHaveAttribute('aria-expanded', 'false'); const border = (button: Locator) => button.evaluate((element) => parseFloat(getComputedStyle(element).borderBottomWidth), ); - expect(await border(selected)).toBeGreaterThan(await border(focused)); + expect(await border(selected.locator('..'))).toBeGreaterThan( + await border(focused), + ); expect( await focused.evaluate((element) => parseFloat(getComputedStyle(element).outlineWidth), diff --git a/tests/e2e/workspace.spec.ts b/tests/e2e/workspace.spec.ts index c4919e8..c506dec 100644 --- a/tests/e2e/workspace.spec.ts +++ b/tests/e2e/workspace.spec.ts @@ -1,3 +1,4 @@ +import { activeWorkspaceTab } from './support'; import { fillSource, readSource, @@ -5,7 +6,7 @@ import { test, expect, openWorkshop, - selectModelElement, + inspectModelElement, modelTreeItem, startExample, openView, @@ -24,16 +25,18 @@ test('@critical loads real source-defined views and keeps the view stable when c await expect( page.getByRole('textbox', { name: 'SysML source' }), ).toHaveSource(/package WorkshopViews/); - const header = page.getByRole('group', { name: 'Model header', exact: true }); - const view = header.getByRole('combobox', { - name: 'Named view', - exact: true, - }); + const view = activeWorkspaceTab(page); await expect(view).toBeVisible(); - await expect(view).toHaveValue('WorkshopViews::overview'); + await expect(view).toHaveAttribute( + 'title', + 'view:' + 'WorkshopViews::overview', + ); await expect(diagramNode(page, 'Workshop::Motor')).toBeVisible(); await openView(page, 'compressor'); - await expect(view).toHaveValue('WorkshopViews::compressor'); + await expect(view).toHaveAttribute( + 'title', + 'view:' + 'WorkshopViews::compressor', + ); await expect( page.getByRole('textbox', { name: 'SysML source' }), ).toHaveSource(/package WorkshopViews/); @@ -75,7 +78,8 @@ test('@critical uses Toolkit rename, updates both references, and supports exact const source = page.getByRole('textbox', { name: 'SysML source' }); const original = await readSource(source); const renamed = original.replaceAll('Motor', 'Drive'); - await selectModelElement(page, 'Workshop::Motor'); + await inspectModelElement(page, 'Workshop::Motor'); + await page.getByText('Edit properties', { exact: true }).click(); await page.getByRole('textbox', { name: 'Name', exact: true }).fill('Drive'); await page .getByRole('button', { name: 'Review rename', exact: true }) @@ -103,7 +107,7 @@ test('@critical creates a native view declaration through a reviewed transaction page, }) => { await openWorkshop(page); - await selectModelElement(page, 'Workshop::Compressor'); + await inspectModelElement(page, 'Workshop::Compressor'); await page .getByRole('button', { name: 'New view of selection', exact: true }) .click(); @@ -118,11 +122,12 @@ test('@critical creates a native view declaration through a reviewed transaction await expect( page.getByRole('button', { name: 'CompressorDetail', exact: true }), ).toBeVisible(); - const view = page - .getByRole('group', { name: 'Model header', exact: true }) - .getByRole('combobox', { name: 'Named view', exact: true }); + const view = activeWorkspaceTab(page); await expect(view).toBeVisible(); - await expect(view).toHaveValue('Workshop::CompressorDetail'); + await expect(view).toHaveAttribute( + 'title', + 'view:' + 'Workshop::CompressorDetail', + ); await expect(diagramNode(page, 'primary : Motor')).toBeVisible(); await expect(diagramNode(page, 'standby : Motor')).toBeVisible(); const bundle = (await downloadProject(page)).bundle; @@ -215,7 +220,8 @@ test('@critical cancels a reviewed rename without changing source, references or }) => { await openWorkshop(page); const before = (await downloadProject(page)).bundle; - await selectModelElement(page, 'Workshop::Motor'); + await inspectModelElement(page, 'Workshop::Motor'); + await page.getByText('Edit properties', { exact: true }).click(); await page.getByRole('textbox', { name: 'Name', exact: true }).fill('Drive'); await page .getByRole('button', { name: 'Review rename', exact: true })