Skip to content

[2678] Add support for experimental read-only textual representation - #2681

Open
gcoutable wants to merge 1 commit into
mainfrom
gco/enh/create-empty-textual-representation
Open

gcoutable wants to merge 1 commit into
mainfrom
gco/enh/create-empty-textual-representation

Conversation

@gcoutable

@gcoutable gcoutable commented Nov 26, 2026 •

Copy link
Copy Markdown
Member

PLEASE READ ALL ITEMS AND CHECK ONLY RELEVANT CHECKBOXES BELOW

Auto review

  • Have you reviewed this PR? Please do a first quick review, It is very useful to detect typos and missing copyrights, check comments, check your code... The reviewer will thank you for that :)

Project management

  • Has the pull request been added to the relevant milestone?
  • Have the queue: and review-window: labels been added to the pull request? (In case of doubt, start with the labels queue: triage and review-window: unscheduled)
  • Have the relevant issues been added to the pull request?
  • Have the relevant labels been added to the issues? (package:, type:)
  • Have the relevant issues been added to the same project milestone as the pull request?

Changelog and release notes

  • Has the CHANGELOG.adoc + doc/content/modules/user-manual/pages/release-notes/YYYY.MM.0.adoc been updated to reference the relevant issues?
  • Have the relevant API breaks been described in the CHANGELOG.adoc?
  • Are the new / upgraded dependencies mentioned in the relevant section of the CHANGELOG.adoc?
  • In case of a change with a visual impact, are there any screenshots in the doc/content/modules/user-manual/pages/release-notes/YYYY.MM.0.adoc?
  • In case of a key change, has the change been added to Key highlights section in doc/content/modules/user-manual/pages/release-notes/YYYY.MM.0.adoc?

Documentation

  • Have you included an update of the documentation in your pull request? Please ask yourself if an update (installation manual, user manual, developer manual...) is needed and add one accordingly.

Tests

  • Is the code properly tested? Any pull request (fix, enhancement or new feature) should come with a test (or several). It could be unit tests, integration tests or cypress tests depending on the context. Only doc and releng pull request do not need for tests.

@gcoutable gcoutable added this to the 2026.12.0 milestone Nov 26, 2026
@gcoutable gcoutable added queue: triage A reviewer needs to evaluate the capacity to review this PR review-window: unscheduled The PR is not scheduled for review labels Nov 26, 2026
@gcoutable gcoutable linked an issue Nov 26, 2026 that may be closed by this pull request
@gcoutable
gcoutable force-pushed the gco/enh/create-empty-textual-representation branch 2 times, most recently from c2ec421 to 15f2b6c Compare November 26, 2026 15:12
It displays sample SysML text in a syntax-highlighted editor.

Bug: #2678
Signed-off-by: Guillaume Coutable <guillaume.coutable@obeo.fr>
@gcoutable
gcoutable force-pushed the gco/enh/create-empty-textual-representation branch from 15f2b6c to 9efd304 Compare November 26, 2026 16:24
@gcoutable
gcoutable marked this pull request as ready for review November 26, 2026 16:24

export const TextualViewRepresentation = forwardRef<WorkbenchMainRepresentationHandle, RepresentationComponentProps>(
(
{ representationId }: RepresentationComponentProps,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Deleting a textual view leaves its editor tab open

Create and open a textual view on a part. In a second browser tab on the same project, delete the part. In the first tab, the view disappears from Explorer while its editor tab stays open and keeps displaying the sample text.

  • Cause — The textual editor renders from the representation ID alone. It ignores onRepresentationUnavailable, and the workbench relies on the active editor to report when its representation disappears.
  • Fix — Watch the representation's availability and call onRepresentationUnavailable when its metadata disappears. Cover deletion of the owning element while the editor is open.
  • If skipped — Users can keep viewing or return to a tab for a deleted representation until they close it or reload the workbench.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The subscription does not exist yet.
Thus, I cannot rely on the complete state of the subscription.
I will add a check on representation metadata every 5 seconds to close the editor if the representation has been deleted elsewhere.

.descriptionId(description.getId())
.iconURLs(List.of())
.build();
this.metadataPersistenceService.save(input, editingContext, metadata, createRepresentationInput.objectId());

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Textual views are dropped from project archives and cannot be duplicated

Enable the experiment and create a textual view on a part. Right-click the view in Explorer and choose Duplicate representation. The action returns an error. Download the project as a ZIP and import it again. The part is present, but its textual view is missing.

  • Cause — Creation saves only representation metadata. Sirius Web's duplication and project export paths both require a stored representation content record.
  • Fix — Persist a minimal textual representation record and register its deserializer so it survives project export and import. The editor can still render the sample text from the frontend.
  • If skipped — The visible Duplicate action fails, and project archives silently omit textual views and their names.

Comment thread CHANGELOG.adoc
Imported reference spellings remain available while the model is loaded. After a reload, serialization uses the stored model.
Downstream callers can migrate from the deprecated `SysMLElementSerializer` to `SysONTextSerializer` for SysON model elements.
- https://github.com/eclipse-syson/syson/issues/2590[#2590] [diagrams] Add `Redefine a nested feature` tool in diagrams.
- https://github.com/eclipse-syson/syson/issues/2678[#2678] [textual-view] Add support for an experimental read-only textual representation displaying sample SysML text in a syntax-highlighted editor.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Append the textual view entry to the end of New features

Don't let your ai agent do that, or fix it yourself.

This is valid for every Pr now and in the future.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Also don't forget to edit the release note and the documentation (in the next PR probably)

"@lexical/rich-text": "0.42.0",
"@lexical/selection": "0.42.0",
"@lexical/utils": "0.42.0",
"@monaco-editor/react": "4.7.0",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

List the new Monaco dependencies in the changelog

Compare the added dependencies in package.json with the v2026.12.0 Dependency update section. The package adds @monaco-editor/react 4.7.0 and monaco-editor 0.55.1, but neither appears in that section.

  • Cause — The changelog describes the editor feature under New features and omits the dependency additions.
  • Fix — Append one entry naming both packages and versions to the Dependency update section.
  • If skipped — Downstream maintainers reviewing the changelog will miss two new frontend dependencies.

@AxelRICHARD AxelRICHARD added queue: in-review The PR is being reviewed, the PR author must not update the PR review-window: week 3 The PR is scheduled for review in the third week of the iteration and removed queue: triage A reviewer needs to evaluate the capacity to review this PR review-window: unscheduled The PR is not scheduled for review labels Nov 27, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

queue: in-review The PR is being reviewed, the PR author must not update the PR review-window: week 3 The PR is scheduled for review in the third week of the iteration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create an empty textual representation

2 participants