Skip to content

Add graphical model view - #21

Open
e-filchenko-bosh wants to merge 9 commits into
eclipse-esmf:mainfrom
bci-oss:add-graphical-model-view
Open

Add graphical model view#21
e-filchenko-bosh wants to merge 9 commits into
eclipse-esmf:mainfrom
bci-oss:add-graphical-model-view

Conversation

@e-filchenko-bosh

Copy link
Copy Markdown
Contributor

Description

Adds the Graphical View user interface to the Semantic Models VS Code extension.

The change includes:

  • Open Graphical View command for Turtle files;
  • editor-title button and editor context-menu entry;
  • one Graphical View panel per Turtle document;
  • secure SVG rendering with zoom, scroll restoration, and last-good-result retention;
  • safe navigation from supported diagram headers and attribute rows to local Turtle source locations;
  • support for multilingual preferredName and description rows;
  • packaged local webview assets, including DOMPurify, font files, and the editor-title icon.

Dependencies

  • Requires the matching Graphical View LSP implementation from esmf-sdk.

Additional notes:

  • The view is read-only. It does not support diagram editing, remote navigation, arbitrary SVG links, or live updates while typing.


const packageJson = JSON.parse(readFileSync(join(extensionRoot, 'package.json'), 'utf8'));
if (packageJson.dependencies?.dompurify !== '3.4.13') {
throw new Error('DOMPurify must remain pinned exactly to 3.4.13.');

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the logic behind this validation? potential unexpected behavior from modifying library version?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DOMPurify is part of the webview security boundary because it sanitizes the server-generated SVG before it is added to the DOM. Changing its version may affect both security and SVG compatibility. The exact version and SHA-256 checks ensure that such updates are reviewed and tested intentionally

Comment thread src/webview/webview.js Outdated
@e-filchenko-bosh

Copy link
Copy Markdown
Contributor Author

@gjavakhadze
I also added a clearer visual presentation for status and error messages in the Graphical View, as we discussed earlier. Thanks for the suggestion

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.

2 participants