Skip to content

Feat column hover highlight - #15

Merged
dbose merged 5 commits into
mainfrom
feat-column-hover-highlight
Sep 12, 2026
Merged

dbose merged 5 commits into
mainfrom
feat-column-hover-highlight

Conversation

@dbose

@dbose dbose commented Sep 12, 2026

Copy link
Copy Markdown
Owner

Canvas interaction & toolbar (earlier commits)

Column hover highlight — hovering a column highlights the joined columns at both ends of a relationship.
Toolbar grouped by role, with icons — the Model toolbar reorganized into role groups.
Top-bar search restored — search on the Model canvas, with the matches framed/fit into view.

Import/Export interchange (0cb14cf)

Brought the ImportExportMenu (Export: SQL DDL / Mermaid / DBML / CSV / ODCS / Cypher; Import wizard: SQL DDL / Mermaid erDiagram / JSON Schema) to the architect canvas, so it reaches the VS Code embedded surface. Styles extracted to ImportExportMenu.css so it renders correctly in both surfaces. Fixed the direct-write fingerprint race (applyImportBatch, fpRef, poll guard) so a multi-op import doesn't 409.

VS Code "Import to Model" (1b33c58)

New command modelith.import → "Modelith: Import to Model", on the right-click menu for .sql/.mmd. It reveals the embedded canvas with ?import=1, which auto-opens the same Import wizard. No second UI; server-side parse/validation shared. Direct-write (you review the git diff).

VS Code build/publish tooling (e6e2622)

vscode:prepublish (fresh minified bundle on package/publish), npm run watch, npm run publish.
.vscodeignore fix (**/*.map) — stopped a 1.36 MB sourcemap shipping; .vsix went 358 KB → 98 KB.
F5 launch target repointed to demo/ibor/model; PUBLISHING.md gained a "Test locally" section.

Checklist

  • Tests pass locally (uv run pytest)
  • Lint passes (uv run ruff check packages/)
  • Docs or the README updated if behavior changed
  • The change fits the git-native, stateless design (git stays the source of truth)

dbose and others added 5 commits September 11, 2026 12:10
The toolbar ran view controls, reference panels, and interchange together in one
undifferentiated row. Split it into three sets divided by thin rules: view controls
(Re-layout, Fit) with arrange/frame icons, the Ontology/Layers panel toggles, and
Export/Import with down/up icons and a dimmed dropdown caret. Presentation only —
same handlers — so the controls read as distinct kinds of action at a glance.
Two things about searching the model view:

- Regression fix: ModelWorkspace held its own query state hardwired to "" and passed
  that to the canvas, so the top-bar search never highlighted/dimmed entities in the
  Model view (it only filtered the Terms glossary). Thread SmeApp's real query into
  ModelWorkspace and drop the dead local state.

- New: in a large model the matched entities may be off-screen, so highlighting alone
  is not enough. On a query change, pan and zoom the canvas to frame just the matches
  (like Fit, scoped to the hits). Bounds are computed from the matched nodes'
  positions via getRectOfNodes + fitBounds rather than fitView({nodes}), because with
  onlyRenderVisibleElements an off-screen node has no measured size for fitView to
  bound.

Verified: searching an attribute like "legal_name" highlights its entity, dims the
rest, and zooms in to frame it.
The VS Code extension embeds the architect canvas (mdl serve at /, App.tsx), not the
SME Studio app, so the interchange menu added to the Studio Model toolbar was absent
there. The shared ModelCanvas enhancements (attribute-anchored relationships,
both-ends hover highlight, search highlight + fit-to-matches) already reached VS Code
because both surfaces mount ModelCanvas; Import/Export was the one gap.

- Add ImportExportMenu to the architect TopBar. It is direct-write here (no review
  screen), so the import button reads "Import" and applies to the working tree, then
  the shell refreshes.
- Make the component self-contained across surfaces: its styles move to
  ImportExportMenu.css (imported by the component) so it renders in the architect
  canvas, which does not load sme.css. A buttonClass prop matches each host toolbar
  (tool-btn vs erd-action ghost); submitLabel and an applyBatch hook adapt behaviour.
- Fix a direct-write import race: exec sent the stale view fingerprint for every
  command in a batch, 409-ing every op after the first. exec now threads the
  fingerprint from each response and holds it against the 3s poll, and the import
  applies its whole change list through a fingerprint-less batch (the stale-model
  guard is for a human's view-then-act, not a machine's own sequential batch).

Verified end to end on mdl serve: Export lists all six formats styled; a two-table
DDL with a FK imports cleanly (both entities, the relationship, both PK groups land
and mdl validate passes) with no console errors; the SME Export/Import menu still
renders correctly. tsc + vite build clean; 580 passed, 1 skipped; ruff clean.
The architect canvas gained an Import wizard (SQL DDL / Mermaid erDiagram /
JSON Schema); this surfaces it in VS Code without a second UI. The command
reveals the embedded canvas with ?import=1, which pops the same wizard open
on load — one component, identical behaviour everywhere, server-side parsing
and validation shared.

Import writes to the working tree (direct-write, like the CLI): you review
the git diff and commit yourself, so the button reads "Import" not
"Import & review".

Right-click a .sql or .mmd file → "Modelith: Import to Model"; JSON Schema
stays available in the wizard for palette invocation (kept off the menu so
every .json file doesn't sprout the entry). Read-only canvas mode declines
with a hint.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
dist/ stays gitignored (build output, not source); make both consumers of
the bundle build it on demand instead:

- vscode:prepublish builds a fresh minified bundle, so `vsce package` and
  `vsce publish` never ship a stale dist/.
- `npm run watch` (esbuild --watch) for local iteration; `npm run publish`
  for the marketplace.
- .vscodeignore: `**/*.map` (was `*.map`, which missed dist/extension.js.map
  — a 1.36 MB sourcemap was shipping), plus drop .vscode/ and PUBLISHING.md
  from the package. Packaged .vsix went 358 KB -> 98 KB.
- launch.json F5 target points at demo/ibor/model (a real model) instead of
  a missing /tmp path, so F5 opens a host ready to test the import flow.
- PUBLISHING.md gains a "Test locally" section (F5 + install-from-vsix).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@dbose
dbose merged commit 5d776da into main Sep 12, 2026
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant