0.9.3: Graph from Source on main.archify works again
On a main.archify page in Source, Graph built the Graph page but the host held it back until Source closed, so nothing happened, and Model then showed the held Graph page. Switching between the model and its graph now leaves Source first, and the page forgets Source when Graph replaces it, so Model on the Graph page comes back to the model.
This commit is contained in:
1 parent
a5a9f92e75
commit
2726a66113
6 files changed
+22
-4
No files matched your search
@@ -1,5 +1,9 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 0.9.3 — 2026-11-04
|
||||||
|
|
||||||
|
- Fixed: on a `main.archify` page in Source, **Graph** did nothing, and **Model** then showed the Graph page instead of the model. Graph now leaves Source and opens at once, and **Model** on the Graph page comes back to the model, not to Source.
|
||||||
|
|
||||||
## 0.9.2 — 2026-10-27
|
## 0.9.2 — 2026-10-27
|
||||||
|
|
||||||
- **Source view.** Every Archify page can show its file's YAML in place: **Diagram | Graph | Source** on diagrams (the old **Diagram | Graph** switch, now on every diagram; Graph only inside a model), **Model | Graph | Source** on `main.archify`, **View | Source** on registry and decision pages, and Source on the Graph page too. The YAML opens in an editor inside the page, under its toolbar and heading, in the page's own colours: line numbers, folding, brackets, multiple cursors, undo and redo, ⌘S/Ctrl+S saves. Problems are underlined as you type, listed under the editor (click the count to go to the next one) and counted on the **Source** segment, also while the picture shows. Completion and hover come from the schema of the file, with nothing else installed. Edits go to the VS Code document, so the tab's dirty dot, save, Git and the text editor stay in step. **Diagram** (or **Model**, **View**) brings the picture back as it was left; anything rendered meanwhile shows then.
|
- **Source view.** Every Archify page can show its file's YAML in place: **Diagram | Graph | Source** on diagrams (the old **Diagram | Graph** switch, now on every diagram; Graph only inside a model), **Model | Graph | Source** on `main.archify`, **View | Source** on registry and decision pages, and Source on the Graph page too. The YAML opens in an editor inside the page, under its toolbar and heading, in the page's own colours: line numbers, folding, brackets, multiple cursors, undo and redo, ⌘S/Ctrl+S saves. Problems are underlined as you type, listed under the editor (click the count to go to the next one) and counted on the **Source** segment, also while the picture shows. Completion and hover come from the schema of the file, with nothing else installed. Edits go to the VS Code document, so the tab's dirty dot, save, Git and the text editor stay in step. **Diagram** (or **Model**, **View**) brings the picture back as it was left; anything rendered meanwhile shows then.
|
||||||
|
|||||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "archify-vscode-ext",
|
"name": "archify-vscode-ext",
|
||||||
"version": "0.9.2",
|
"version": "0.9.3",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "archify-vscode-ext",
|
"name": "archify-vscode-ext",
|
||||||
"version": "0.9.2",
|
"version": "0.9.3",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@codemirror/autocomplete": "^6.20.4",
|
"@codemirror/autocomplete": "^6.20.4",
|
||||||
|
|||||||
+1
-1
@@ -2,7 +2,7 @@
|
|||||||
"name": "archify-vscode-ext",
|
"name": "archify-vscode-ext",
|
||||||
"displayName": "Archify Diagram Viewer",
|
"displayName": "Archify Diagram Viewer",
|
||||||
"description": "Archify diagrams in VS Code. Write diagrams as .archify files in YAML: they open as the interactive diagram, with live updates, validation, templates and completion. Also previews Archify's own JSON files (*.architecture.json, …) and opens rendered Archify HTML.",
|
"description": "Archify diagrams in VS Code. Write diagrams as .archify files in YAML: they open as the interactive diagram, with live updates, validation, templates and completion. Also previews Archify's own JSON files (*.architecture.json, …) and opens rendered Archify HTML.",
|
||||||
"version": "0.9.2",
|
"version": "0.9.3",
|
||||||
"publisher": "root-at-skic",
|
"publisher": "root-at-skic",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"sponsor": {
|
"sponsor": {
|
||||||
|
|||||||
@@ -165,6 +165,10 @@ class DiagramPreview implements vscode.Disposable {
|
|||||||
|
|
||||||
/** Switches a main.archify editor between its model page and the Graph page. */
|
/** Switches a main.archify editor between its model page and the Graph page. */
|
||||||
setGraph(on: boolean, query?: string): void {
|
setGraph(on: boolean, query?: string): void {
|
||||||
|
// Leaving Source for another page: drop what it held, or that page would
|
||||||
|
// wait for a sourceClose that never comes and show up later instead.
|
||||||
|
this.heldHtml = undefined;
|
||||||
|
this.source?.leave();
|
||||||
this.graph = on;
|
this.graph = on;
|
||||||
this.graphQuery = query;
|
this.graphQuery = query;
|
||||||
const modes = this.graphModes();
|
const modes = this.graphModes();
|
||||||
|
|||||||
@@ -76,6 +76,11 @@ export class SourceSession implements vscode.Disposable {
|
|||||||
this.post({ type: 'setView', view: 'source' });
|
this.post({ type: 'setView', view: 'source' });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** The page is being replaced by another one (the Graph page): Source is no longer shown. */
|
||||||
|
leave(): void {
|
||||||
|
this.setShown(false);
|
||||||
|
}
|
||||||
|
|
||||||
/** Handles a Source message from the page; false for any other message. */
|
/** Handles a Source message from the page; false for any other message. */
|
||||||
handle(message: { type?: string }): boolean {
|
handle(message: { type?: string }): boolean {
|
||||||
if (!isSourceMessage(message)) return false;
|
if (!isSourceMessage(message)) return false;
|
||||||
|
|||||||
+6
-1
@@ -704,7 +704,12 @@ function bridgeScript(options: PageOptions): string {
|
|||||||
}
|
}
|
||||||
var name = (src && src.left) || sw.left;
|
var name = (src && src.left) || sw.left;
|
||||||
var left = segment(name, name === 'View' ? 'Show the page' : 'Show the ' + name.toLowerCase(), function () { setSource(false); });
|
var left = segment(name, name === 'View' ? 'Show the page' : 'Show the ' + name.toLowerCase(), function () { setSource(false); });
|
||||||
if (sw) segment('Graph', 'Open the model as one graph, with a query box', function () { post({ type: 'showGraph', query: sw.query }); });
|
if (sw) segment('Graph', 'Open the model as one graph, with a query box', function () {
|
||||||
|
// On main.archify the Graph page replaces this one; coming back must
|
||||||
|
// show the model, not Source. Other pages open the graph beside them.
|
||||||
|
if (sourceOn && config.model) vscode.setState(Object.assign({}, vscode.getState() || {}, { sourceView: false }));
|
||||||
|
post({ type: 'showGraph', query: sw.query });
|
||||||
|
});
|
||||||
var source = src ? segment('Source', 'Edit the YAML of this file, checked as you type', function () { setSource(true); }) : null;
|
var source = src ? segment('Source', 'Edit the YAML of this file, checked as you type', function () { setSource(true); }) : null;
|
||||||
if (source) {
|
if (source) {
|
||||||
var badge = el('span', 'archify-source-badge');
|
var badge = el('span', 'archify-source-badge');
|
||||||
|
|||||||
Reference in new issue
Block a user