@hydranium/glsp-client-theia 1.0.0-next.19 → 1.0.0-next.192

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/README.md +36 -13
  2. package/lib/browser/action-dispatcher.d.ts.map +1 -1
  3. package/lib/browser/action-dispatcher.js.map +1 -1
  4. package/lib/browser/client-contribution.d.ts +82 -25
  5. package/lib/browser/client-contribution.d.ts.map +1 -1
  6. package/lib/browser/client-contribution.js +218 -53
  7. package/lib/browser/client-contribution.js.map +1 -1
  8. package/lib/browser/diagram-loader.d.ts +15 -6
  9. package/lib/browser/diagram-loader.d.ts.map +1 -1
  10. package/lib/browser/diagram-loader.js +17 -9
  11. package/lib/browser/diagram-loader.js.map +1 -1
  12. package/lib/browser/diagram-only-marker-manager.d.ts.map +1 -1
  13. package/lib/browser/diagram-only-marker-manager.js.map +1 -1
  14. package/lib/browser/diagram-widget.d.ts +31 -24
  15. package/lib/browser/diagram-widget.d.ts.map +1 -1
  16. package/lib/browser/diagram-widget.js +50 -24
  17. package/lib/browser/diagram-widget.js.map +1 -1
  18. package/lib/browser/glsp-client-theia-module.d.ts.map +1 -1
  19. package/lib/browser/glsp-client-theia-module.js +2 -0
  20. package/lib/browser/glsp-client-theia-module.js.map +1 -1
  21. package/lib/browser/glsp-client.d.ts +17 -0
  22. package/lib/browser/glsp-client.d.ts.map +1 -0
  23. package/lib/browser/glsp-client.js +23 -0
  24. package/lib/browser/glsp-client.js.map +1 -0
  25. package/lib/browser/glsp-diagram-manager.d.ts +44 -0
  26. package/lib/browser/glsp-diagram-manager.d.ts.map +1 -1
  27. package/lib/browser/glsp-diagram-manager.js +99 -0
  28. package/lib/browser/glsp-diagram-manager.js.map +1 -1
  29. package/lib/browser/glsp-message-service.d.ts +8 -0
  30. package/lib/browser/glsp-message-service.d.ts.map +1 -1
  31. package/lib/browser/glsp-message-service.js +8 -0
  32. package/lib/browser/glsp-message-service.js.map +1 -1
  33. package/lib/browser/glsp-saveable.d.ts +66 -0
  34. package/lib/browser/glsp-saveable.d.ts.map +1 -0
  35. package/lib/browser/glsp-saveable.js +109 -0
  36. package/lib/browser/glsp-saveable.js.map +1 -0
  37. package/lib/browser/glsp-theia-frontend-module.d.ts.map +1 -1
  38. package/lib/browser/glsp-theia-frontend-module.js +1 -0
  39. package/lib/browser/glsp-theia-frontend-module.js.map +1 -1
  40. package/lib/browser/hidden-bounds-updater.d.ts +2 -4
  41. package/lib/browser/hidden-bounds-updater.d.ts.map +1 -1
  42. package/lib/browser/hidden-bounds-updater.js +7 -3
  43. package/lib/browser/hidden-bounds-updater.js.map +1 -1
  44. package/lib/browser/hydranium-glsp-diagram-configuration.d.ts.map +1 -1
  45. package/lib/browser/hydranium-glsp-diagram-configuration.js.map +1 -1
  46. package/lib/browser/index.d.ts +4 -0
  47. package/lib/browser/index.d.ts.map +1 -1
  48. package/lib/browser/index.js +3 -0
  49. package/lib/browser/index.js.map +1 -1
  50. package/lib/browser/status-overlay.d.ts +23 -0
  51. package/lib/browser/status-overlay.d.ts.map +1 -0
  52. package/lib/browser/status-overlay.js +52 -0
  53. package/lib/browser/status-overlay.js.map +1 -0
  54. package/lib/node/connection-container-module.js.map +1 -1
  55. package/lib/node/glsp-server-connection-handler.d.ts +11 -10
  56. package/lib/node/glsp-server-connection-handler.d.ts.map +1 -1
  57. package/lib/node/glsp-server-connection-handler.js +12 -15
  58. package/lib/node/glsp-server-connection-handler.js.map +1 -1
  59. package/lib/testing/bind-recorder.js.map +1 -1
  60. package/package.json +28 -26
  61. package/src/browser/client-contribution.ts +243 -54
  62. package/src/browser/diagram-loader.ts +18 -11
  63. package/src/browser/diagram-widget.ts +58 -27
  64. package/src/browser/glsp-client-theia-module.ts +3 -1
  65. package/src/browser/glsp-client.ts +20 -0
  66. package/src/browser/glsp-diagram-manager.ts +113 -1
  67. package/src/browser/glsp-message-service.ts +8 -0
  68. package/src/browser/glsp-saveable.ts +110 -0
  69. package/src/browser/glsp-theia-frontend-module.ts +2 -1
  70. package/src/browser/hidden-bounds-updater.ts +5 -6
  71. package/src/browser/index.ts +8 -0
  72. package/src/browser/status-overlay.ts +43 -0
  73. package/src/node/glsp-server-connection-handler.ts +12 -14
  74. package/style/diagram-loading.css +2 -5
@@ -26,8 +26,7 @@ export interface DiagramLoadFailure {
26
26
  readonly error: unknown;
27
27
  /**
28
28
  * Whether the `severity: 'ERROR'` {@link StatusAction} reached the action
29
- * dispatcher — i.e. whether GLSP's `StatusOverlay` is now displaying this
30
- * failure.
29
+ * dispatcher. It says nothing about whether a status overlay shows it.
31
30
  *
32
31
  * `false` means the report itself failed, which happens when the action
33
32
  * dispatcher is the thing that could not initialize. A consumer that covers
@@ -110,10 +109,20 @@ export declare class HydraniumDiagramLoader extends DiagramLoader {
110
109
  protected reportLoadFailure(err: unknown): Promise<boolean>;
111
110
  /**
112
111
  * The sentence a failed load is reported with, on every surface that reports
113
- * it, and the only seam an adopter rewords or localizes it at. Public
114
- * because the canvas overlay is one of those surfaces and lives in another
115
- * class: it renders this failure exactly when the `StatusAction` did not
116
- * land, so a second copy of the sentence there could only ever drift unseen.
112
+ * it. Public because the canvas overlay is one of those surfaces and lives in
113
+ * another class, where a second copy of the sentence would drift.
114
+ *
115
+ * **The seam and the catalogue key answer different questions, so it carries
116
+ * both.** Overriding this method changes the WORDING for every user of one
117
+ * adopter's product; the key is what gives a reader the sentence in their own
118
+ * language, and no override can supply that without an adopter writing a
119
+ * subclass per locale — which is the thing a catalogue exists to avoid. Two
120
+ * of the three surfaces this reaches are user-visible, so the audience
121
+ * triage answers it: a host-bound string a user sees takes an inline key.
122
+ *
123
+ * The Output-channel line is therefore localized too, which is deliberate
124
+ * rather than overlooked — the alternative is a second English copy of one
125
+ * sentence, and the reason for a single source here has not changed.
117
126
  */
118
127
  loadFailureLabel(err: unknown): string;
119
128
  /** Render a thrown value as a message. Shared so the channel line, the status
@@ -1 +1 @@
1
- {"version":3,"file":"diagram-loader.d.ts","sourceRo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;;;;;;;;;OAWG;IACH,SAAS,CAAC,MAAM,CAAC,OAAO,EAAE,kBAAkB,GAAG,IAAI,CAMlD;IAED;;;;;;;;;;;OAWG;IACH,UAAgB,iBAAiB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAUhE;IAED;;;;;;;;;;;;;;;;OAgBG;IACH,gBAAgB,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAErC;IAED;qFACiF;IACjF,SAAS,CAAC,WAAW,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAE1C;CACH"}
@@ -21,6 +21,7 @@ exports.HydraniumDiagramLoader = void 0;
21
21
  const client_1 = require("@eclipse-glsp/client");
22
22
  const browser_1 = require("@hydranium/client-theia/lib/browser");
23
23
  const protocol_1 = require("@hydranium/protocol");
24
+ const core_1 = require("@theia/core");
24
25
  const inversify_1 = require("@theia/core/shared/inversify");
25
26
  /**
26
27
  * Diagram loader that never lets a load failure vanish.
@@ -75,10 +76,7 @@ let HydraniumDiagramLoader = class HydraniumDiagramLoader extends client_1.Diagr
75
76
  this.settle({ status: 'loaded' });
76
77
  }
77
78
  catch (err) {
78
- // Report first, settle second, and carry whether the report landed: a
79
- // consumer that uncovers the canvas on settle then finds the error
80
- // already on the status overlay — or learns that it has to render the
81
- // failure itself because nothing else can.
79
+ // Report first, settle second, and carry whether the report landed.
82
80
  const surfaced = await this.reportLoadFailure(err);
83
81
  this.settle({ status: 'failed', error: err, surfaced });
84
82
  }
@@ -128,13 +126,23 @@ let HydraniumDiagramLoader = class HydraniumDiagramLoader extends client_1.Diagr
128
126
  }
129
127
  /**
130
128
  * The sentence a failed load is reported with, on every surface that reports
131
- * it, and the only seam an adopter rewords or localizes it at. Public
132
- * because the canvas overlay is one of those surfaces and lives in another
133
- * class: it renders this failure exactly when the `StatusAction` did not
134
- * land, so a second copy of the sentence there could only ever drift unseen.
129
+ * it. Public because the canvas overlay is one of those surfaces and lives in
130
+ * another class, where a second copy of the sentence would drift.
131
+ *
132
+ * **The seam and the catalogue key answer different questions, so it carries
133
+ * both.** Overriding this method changes the WORDING for every user of one
134
+ * adopter's product; the key is what gives a reader the sentence in their own
135
+ * language, and no override can supply that without an adopter writing a
136
+ * subclass per locale — which is the thing a catalogue exists to avoid. Two
137
+ * of the three surfaces this reaches are user-visible, so the audience
138
+ * triage answers it: a host-bound string a user sees takes an inline key.
139
+ *
140
+ * The Output-channel line is therefore localized too, which is deliberate
141
+ * rather than overlooked — the alternative is a second English copy of one
142
+ * sentence, and the reason for a single source here has not changed.
135
143
  */
136
144
  loadFailureLabel(err) {
137
- return `Diagram failed to load: ${this.formatError(err)}`;
145
+ return core_1.nls.localize('hydranium/glsp-client-theia/diagram-load-failed', 'Diagram failed to load: {0}', this.formatError(err));
138
146
  }
139
147
  /** Render a thrown value as a message. Shared so the channel line, the status
140
148
  * overlay and any consumer rendering {@link DiagramLoadFailure.error} agree. */
@@ -1 +1 @@
1
- {"version":3,"file":"diagram-loader.js","sourceRoot":"","sources":["../../src/browser/diagram-loader.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;;;;;;;;;;AAElF,iDAA+F;AAC/F,iEAAoE;AACpE,kDAA+C;AAC/C,4DAAkE;AAkClE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEI,IAAM,sBAAsB,GAA5B,MAAM,sBAAuB,SAAQ,sBAAa;IACZ,OAAO,CAAiB;IAE/C,OAAO,GAAG,IAAI,mBAAQ,EAAsB,CAAC;IACtD,OAAO,CAAsB;IAEvC;;;+DAG2D;IAC3D,IAAI,WAAW;QACZ,OAAO,IAAI,CAAC,OAAO,CAAC;IACvB,CAAC;IAED;uEACmE;IACnE,eAAe;QACZ,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;IAC/B,CAAC;IAEQ,KAAK,CAAC,IAAI,CAAC,OAA+B;QAChD,IAAI,CAAC;YACF,MAAM,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YA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,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IAC3D,CAAC;CACH,CAAA;;AApG4C;IAAzC,IAAA,kBAAM,EAAC,uBAAa,CAAC;8BAA8B,uBAAa;uDAAC;iCADxD,sBAAsB;IADlC,IAAA,sBAAU,GAAE;GACA,sBAAsB,CAqGlC"}
@@ -1 +1 @@
1
- {"version":3,"file":"diagram-only-marker-manager.d.ts","sourceRoot":"","sources":["../../src/browser/diagram-only-marker-manager.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,qBAAqB,EAAE,KAAK,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAG1E;;;;;;;;;;;;;;GAcG;AACH,qBACa,yBAA0B,SAAQ,qBAAqB;IACjE,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI;CAG7E"}
1
+ {"version":3,"file":"diagram-only-marker-manager.d.ts","sourceRoot":"","sources":["../../src/browser/diagram-only-marker-manager.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,qBAAqB,EAAE,KAAK,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAG1E;;;;;;;;;;;;;;GAcG;AACH,qBACa,yBAA0B,SAAQ,qBAAqB;IACjE,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAE1E;CACH"}
@@ -1 +1 @@
1
- {"version":3,"file":"diagram-only-marker-manager.js","sourceRoot":"","sources":["../../src/browser/diagram-only-marker-manager.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;;;;;;;AAElF,iDAA0E;AAC1E,4DAA0D;AAE1D;;;;;;;;;;;;;;GAcG;AAEI,IAAM,yBAAyB,GAA/B,MAAM,yBAA0B,SAAQ,8BAAqB;IACjE,UAAU,CAAC,QAAkB,EAAE,OAAgB,EAAE,UAAmB;QACjE,6DAA6D;IAChE,CAAC;CACH,CAAA;AAJY,8DAAyB;oCAAzB,yBAAyB;IADrC,IAAA,sBAAU,GAAE;GACA,yBAAyB,CAIrC"}
1
+ {"version":3,"file":"diagram-only-marker-manager.js","sourceRoot":"","sources":["../../src/browser/diagram-only-marker-manager.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;;;;;;;AAElF,iDAA0E;AAC1E,4DAA0D;AAE1D;;;;;;;;;;;;;;GAcG;AAEI,IAAM,yBAAyB,GAA/B,MAAM,yBAA0B,SAAQ,8BAAqB;IACjE,UAAU,CAAC,QAAkB,EAAE,OAAgB,EAAE,UAAmB;QACjE,6DAA6D;IAChE,CAAC;CACH,CAAA;;oCAJY,yBAAyB;IADrC,IAAA,sBAAU,GAAE;GACA,yBAAyB,CAIrC"}
@@ -6,8 +6,10 @@
6
6
  *
7
7
  * SPDX-License-Identifier: MIT
8
8
  ********************************************************************************/
9
- import { GLSPDiagramWidget } from '@eclipse-glsp/theia-integration';
9
+ import { GLSPDiagramWidget, type GLSPDiagramWidgetOptions } from '@eclipse-glsp/theia-integration';
10
10
  import { type Message } from '@theia/core/lib/browser';
11
+ import { Emitter, type Event } from '@theia/core';
12
+ import { type Container } from '@theia/core/shared/inversify';
11
13
  import { type DiagramLoadOutcome, HydraniumDiagramLoader } from './diagram-loader';
12
14
  import '../../style/diagram-loading.css';
13
15
  /** Class on the overlay root. Adopters style / override via this contract. */
@@ -24,30 +26,37 @@ export declare const DIAGRAM_LOADING_FAILED_CLASS = "hydranium-diagram-loading-f
24
26
  * model to read as a broken editor rather than a slow one.
25
27
  *
26
28
  * **How the pending state is sourced.** From {@link HydraniumDiagramLoader}, not
27
- * from `actionDispatcher.onceModelInitialized()`. The loader settles on failure
28
- * as well as on success, and it does so even when its own error-reporting
29
- * dispatch throws; `onceModelInitialized()` simply never settles on a failed
30
- * load. That distinction is not academic here: this overlay is opaque and covers
31
- * the widget node, while GLSP's `StatusOverlay` — where the loader reports the
32
- * failure — mounts *inside* the diagram's base div. Keyed on model
33
- * initialization, a failed load would leave a spinner turning on top of the
34
- * error message explaining it. Keyed on the loader, exactly one component decides
35
- * whether the canvas is pending and the two mechanisms compose instead of
36
- * competing.
29
+ * from `actionDispatcher.onceModelInitialized()`: the loader settles on failure
30
+ * as well as on success, even when its own error report throws, while
31
+ * `onceModelInitialized()` never settles on a failed load and would leave the
32
+ * spinner turning for good.
37
33
  *
38
- * **The one case where this overlay reports the failure itself.** When
39
- * `DiagramLoadFailure.surfaced` is `false` the loader could not dispatch its
40
- * `StatusAction` — the action dispatcher was what failed — so the status overlay
41
- * shows nothing. Uncovering the canvas would then leave a blank diagram whose only
42
- * explanation is a line in the Output channel. In that case, and only that case,
43
- * the overlay stays up and swaps the spinner for the error text.
34
+ * A failed load keeps the overlay up with the error and a Retry, which asks for
35
+ * a fresh widget through {@link onDidRequestReopen}.
44
36
  *
45
37
  * Bound unconditionally by `AbstractHydraniumGlspTheiaFrontendModule`. To opt out,
46
38
  * override {@link showLoadingOverlay} to a no-op; to change what is rendered,
47
39
  * override {@link createLoadingOverlay} or {@link loadingLabel}.
40
+ *
41
+ * Its saveable is a {@link HydraniumGlspSaveable}, which keeps a pending save
42
+ * dirty, so Theia's exit check still counts it; see {@link createSaveable}.
48
43
  */
49
44
  export declare class HydraniumGlspDiagramWidget extends GLSPDiagramWidget {
50
45
  protected loadingOverlay?: HTMLElement;
46
+ protected readonly reopenRequestEmitter: Emitter<void>;
47
+ /** Fires when this diagram asks to be replaced by a fresh widget, as its
48
+ * Retry does; `AbstractHydraniumGlspDiagramManager` reopens it. A load is
49
+ * not repeated in place, since GLSP's model source registers its handlers
50
+ * once per load. */
51
+ readonly onDidRequestReopen: Event<void>;
52
+ /**
53
+ * Replaces the saveable GLSP's `configure` builds inline, with no factory
54
+ * seam. The widget factory calls `configure` before the widget reaches the
55
+ * shell, so Theia only ever tracks this one.
56
+ */
57
+ configure(options: GLSPDiagramWidgetOptions, diContainer: Container): void;
58
+ /** The widget's saveable. Override to change how saves and dirty state behave. */
59
+ protected createSaveable(): GLSPDiagramWidget['saveable'];
51
60
  protected onAfterAttach(msg: Message): void;
52
61
  dispose(): void;
53
62
  /**
@@ -59,13 +68,7 @@ export declare class HydraniumGlspDiagramWidget extends GLSPDiagramWidget {
59
68
  * rather than creating and immediately removing one, so there is no flash.
60
69
  */
61
70
  protected showLoadingOverlay(): void;
62
- /**
63
- * Take the overlay down, or keep it as the failure's only reporter.
64
- *
65
- * The overlay is retained ONLY for a failure the loader could not surface;
66
- * anything else uncovers the canvas, so a load that failed *and was reported*
67
- * reveals GLSP's status overlay rather than double-reporting on top of it.
68
- */
71
+ /** Take the overlay down, or keep it as the failure's report. */
69
72
  protected onLoadSettled(outcome: DiagramLoadOutcome): void;
70
73
  /**
71
74
  * Repurpose the pending overlay in place as a failure report: same node, so
@@ -78,6 +81,10 @@ export declare class HydraniumGlspDiagramWidget extends GLSPDiagramWidget {
78
81
  * is a no-op rather than a fallback wording.
79
82
  */
80
83
  protected showLoadFailure(error: unknown): void;
84
+ /** Ask for a fresh widget, after a failed load. */
85
+ protected retryLoad(): void;
86
+ /** Build the failure overlay's Retry button, which calls {@link retryLoad}. */
87
+ protected createRetryButton(): HTMLElement;
81
88
  protected hideLoadingOverlay(): void;
82
89
  /** Build the overlay DOM. Override to change the wording or add content; the
83
90
  * root must carry {@link DIAGRAM_LOADING_CLASS} for the shipped styling, and
@@ -1 +1 @@
1
- {"version":3,"file":"diagram-widget.d.ts","sourceRoot":"","sources":["../../src/browser/diagram-widget.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAGlF,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAGpE,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAEvD,OAAO,EAAE,KAAK,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAInF,O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SAAS,CAGzE;CACH"}
@@ -17,8 +17,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  exports.HydraniumGlspDiagramWidget = exports.DIAGRAM_LOADING_FAILED_CLASS = exports.DIAGRAM_LOADING_CLASS = void 0;
18
18
  const client_1 = require("@eclipse-glsp/client");
19
19
  const theia_integration_1 = require("@eclipse-glsp/theia-integration");
20
+ const core_1 = require("@theia/core");
20
21
  const inversify_1 = require("@theia/core/shared/inversify");
21
22
  const diagram_loader_1 = require("./diagram-loader");
23
+ const glsp_saveable_1 = require("./glsp-saveable");
22
24
  // Shipped by this package rather than left to adopters: an overlay whose
23
25
  // stylesheet was forgotten is an unstyled div in normal flow, which is a silent
24
26
  // failure. Adopters override individual rules from their own stylesheet.
@@ -37,30 +39,45 @@ exports.DIAGRAM_LOADING_FAILED_CLASS = `${exports.DIAGRAM_LOADING_CLASS}-failed`
37
39
  * model to read as a broken editor rather than a slow one.
38
40
  *
39
41
  * **How the pending state is sourced.** From {@link HydraniumDiagramLoader}, not
40
- * from `actionDispatcher.onceModelInitialized()`. The loader settles on failure
41
- * as well as on success, and it does so even when its own error-reporting
42
- * dispatch throws; `onceModelInitialized()` simply never settles on a failed
43
- * load. That distinction is not academic here: this overlay is opaque and covers
44
- * the widget node, while GLSP's `StatusOverlay` — where the loader reports the
45
- * failure — mounts *inside* the diagram's base div. Keyed on model
46
- * initialization, a failed load would leave a spinner turning on top of the
47
- * error message explaining it. Keyed on the loader, exactly one component decides
48
- * whether the canvas is pending and the two mechanisms compose instead of
49
- * competing.
42
+ * from `actionDispatcher.onceModelInitialized()`: the loader settles on failure
43
+ * as well as on success, even when its own error report throws, while
44
+ * `onceModelInitialized()` never settles on a failed load and would leave the
45
+ * spinner turning for good.
50
46
  *
51
- * **The one case where this overlay reports the failure itself.** When
52
- * `DiagramLoadFailure.surfaced` is `false` the loader could not dispatch its
53
- * `StatusAction` — the action dispatcher was what failed — so the status overlay
54
- * shows nothing. Uncovering the canvas would then leave a blank diagram whose only
55
- * explanation is a line in the Output channel. In that case, and only that case,
56
- * the overlay stays up and swaps the spinner for the error text.
47
+ * A failed load keeps the overlay up with the error and a Retry, which asks for
48
+ * a fresh widget through {@link onDidRequestReopen}.
57
49
  *
58
50
  * Bound unconditionally by `AbstractHydraniumGlspTheiaFrontendModule`. To opt out,
59
51
  * override {@link showLoadingOverlay} to a no-op; to change what is rendered,
60
52
  * override {@link createLoadingOverlay} or {@link loadingLabel}.
53
+ *
54
+ * Its saveable is a {@link HydraniumGlspSaveable}, which keeps a pending save
55
+ * dirty, so Theia's exit check still counts it; see {@link createSaveable}.
61
56
  */
62
57
  let HydraniumGlspDiagramWidget = class HydraniumGlspDiagramWidget extends theia_integration_1.GLSPDiagramWidget {
63
58
  loadingOverlay;
59
+ reopenRequestEmitter = new core_1.Emitter();
60
+ /** Fires when this diagram asks to be replaced by a fresh widget, as its
61
+ * Retry does; `AbstractHydraniumGlspDiagramManager` reopens it. A load is
62
+ * not repeated in place, since GLSP's model source registers its handlers
63
+ * once per load. */
64
+ onDidRequestReopen = this.reopenRequestEmitter.event;
65
+ /**
66
+ * Replaces the saveable GLSP's `configure` builds inline, with no factory
67
+ * seam. The widget factory calls `configure` before the widget reaches the
68
+ * shell, so Theia only ever tracks this one.
69
+ */
70
+ configure(options, diContainer) {
71
+ super.configure(options, diContainer);
72
+ this.saveable.dispose();
73
+ this.saveable = this.createSaveable();
74
+ this.toDispose.push(this.saveable);
75
+ this.toDispose.push(this.reopenRequestEmitter);
76
+ }
77
+ /** The widget's saveable. Override to change how saves and dirty state behave. */
78
+ createSaveable() {
79
+ return new glsp_saveable_1.HydraniumGlspSaveable(this.actionDispatcher, this.diContainer.get(client_1.EditorContextService));
80
+ }
64
81
  onAfterAttach(msg) {
65
82
  // Before `super`, which is what starts the load on first attach — so the
66
83
  // overlay is already up when the round trip begins.
@@ -94,15 +111,9 @@ let HydraniumGlspDiagramWidget = class HydraniumGlspDiagramWidget extends theia_
94
111
  // outcome it cannot report, which is the safe reading.
95
112
  loader.onceLoadSettled().then(outcome => this.onLoadSettled(outcome), () => this.hideLoadingOverlay());
96
113
  }
97
- /**
98
- * Take the overlay down, or keep it as the failure's only reporter.
99
- *
100
- * The overlay is retained ONLY for a failure the loader could not surface;
101
- * anything else uncovers the canvas, so a load that failed *and was reported*
102
- * reveals GLSP's status overlay rather than double-reporting on top of it.
103
- */
114
+ /** Take the overlay down, or keep it as the failure's report. */
104
115
  onLoadSettled(outcome) {
105
- if (outcome.status === 'failed' && !outcome.surfaced) {
116
+ if (outcome.status === 'failed') {
106
117
  this.showLoadFailure(outcome.error);
107
118
  return;
108
119
  }
@@ -129,6 +140,21 @@ let HydraniumGlspDiagramWidget = class HydraniumGlspDiagramWidget extends theia_
129
140
  if (label) {
130
141
  label.textContent = loader.loadFailureLabel(error);
131
142
  }
143
+ overlay.appendChild(this.createRetryButton());
144
+ }
145
+ /** Ask for a fresh widget, after a failed load. */
146
+ retryLoad() {
147
+ if (this.hydraniumDiagramLoader?.loadOutcome?.status === 'failed') {
148
+ this.reopenRequestEmitter.fire();
149
+ }
150
+ }
151
+ /** Build the failure overlay's Retry button, which calls {@link retryLoad}. */
152
+ createRetryButton() {
153
+ const button = document.createElement('button');
154
+ button.className = `theia-button ${exports.DIAGRAM_LOADING_CLASS}-retry`;
155
+ button.textContent = core_1.nls.localize('hydranium/glsp-client-theia/diagram-load-retry', 'Retry');
156
+ button.addEventListener('click', () => this.retryLoad());
157
+ return button;
132
158
  }
133
159
  hideLoadingOverlay() {
134
160
  this.loadingOverlay?.remove();
@@ -1 +1 @@
1
- {"version":3,"file":"diagram-widget.js","sourceRoot":"","sources":["../../src/browser/diagram-widget.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;;;;;;;AAElF,iDAAqD;AACrD,uEAAoE;AAIpE,4DAA0D;AAC1D,qDAAmF;AACnF,yEAAyE;AACzE,gFAAgF;AAChF,yEAAyE;AACzE,2CAAyC;AAEzC,8EAA8E;AACjE,QAAA,qBAA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1 +1 @@
1
- {"version":3,"file":"glsp-client-theia-module.d.ts","sourceRoot":"","sources":["../../src/browser/glsp-client-theia-module.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAqB,KAAK,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AACnG,OAAO,EAAE,KAAK,cAAc,EAAgE,MAAM,sBAAsB,CAAC;AAMzH;;;;;qEAKqE;AACrE,MAAM,WAAW,4BAA4B;IAC1C,QAAQ,CAAC,aAAa,EAAE,oBAAoB,CAAC;CAC/C;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,4BAA4B,GAAG,IAAI,CAQhH"}
1
+ {"version":3,"file":"glsp-client-theia-module.d.ts","sourceRoot":"","sources":["../../src/browser/glsp-client-theia-module.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAqB,KAAK,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AACnG,OAAO,EAAE,KAAK,cAAc,EAA+E,MAAM,sBAAsB,CAAC;AAOxI;;;;;qEAKqE;AACrE,MAAM,WAAW,4BAA4B;IAC1C,QAAQ,CAAC,aAAa,EAAE,oBAAoB,CAAC;CAC/C;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,4BAA4B,GAAG,IAAI,CAShH"}
@@ -13,6 +13,7 @@ const browser_1 = require("@hydranium/client-theia/lib/browser");
13
13
  const client_1 = require("@eclipse-glsp/client");
14
14
  const action_dispatcher_1 = require("./action-dispatcher");
15
15
  const diagram_loader_1 = require("./diagram-loader");
16
+ const status_overlay_1 = require("./status-overlay");
16
17
  const glsp_message_service_1 = require("./glsp-message-service");
17
18
  const hidden_bounds_updater_1 = require("./hidden-bounds-updater");
18
19
  /**
@@ -41,6 +42,7 @@ function createGlspClientTheiaModule(context, options) {
41
42
  rebind(client_1.GLSPActionDispatcher).toService(action_dispatcher_1.HydraniumGlspActionDispatcher);
42
43
  rebind(client_1.DiagramLoader).to(diagram_loader_1.HydraniumDiagramLoader).inSingletonScope();
43
44
  rebind(client_1.GLSPHiddenBoundsUpdater).to(hidden_bounds_updater_1.HydraniumHiddenBoundsUpdater).inSingletonScope();
45
+ rebind(client_1.StatusOverlay).to(status_overlay_1.HydraniumStatusOverlay).inSingletonScope();
44
46
  (0, glsp_message_service_1.bindHydraniumGlspMessageService)(bind, isBound, rebind);
45
47
  }
46
48
  //# sourceMappingURL=glsp-client-theia-module.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"glsp-client-theia-module.js","sourceRoot":"","sources":["../../src/browser/glsp-client-theia-module.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;AAsClF,kEAQC;AA5CD,iEAAmG;AACnG,iDAAyH;AACzH,2DAAoE;AACpE,qDAA0D;AAC1D,iEAAyE;AACzE,mEAAuE;AAYvE;;;;;;;;;;;;;;;;;;GAkBG;AACH,SAAgB,2BAA2B,CAAC,OAAuB,EAAE,OAAqC;IACvG,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;IAC1C,IAAA,2BAAiB,EAAC,IAAI,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;IAC/C,IAAI,CAAC,iDAA6B,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IAChE,MAAM,CAAC,6BAAoB,CAAC,CAAC,SAAS,CAAC,iDAA6B,CAAC,CAAC;IACtE,MAAM,CAAC,sBAAa,CAAC,CAAC,EAAE,CAAC,uCAAsB,CAAC,CAAC,gBAAgB,EAAE,CAAC;IACpE,MAAM,CAAC,gCAAuB,CAAC,CAAC,EAAE,CAAC,oDAA4B,CAAC,CAAC,gBAAgB,EAAE,CAAC;IACpF,IAAA,sDAA+B,EAAC,IAAI,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;AAC1D,CAAC"}
1
+ {"version":3,"file":"glsp-client-theia-module.js","sourceRoot":"","sources":["../../src/browser/glsp-client-theia-module.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;AAElF,iEAAmG;AACnG,iDAAwI;AACxI,2DAAoE;AACpE,qDAA0D;AAC1D,qDAA0D;AAC1D,iEAAyE;AACzE,mEAAuE;AAYvE;;;;;;;;;;;;;;;;;;GAkBG;AACH,qCAA4C,OAAuB,EAAE,OAAqC;IACvG,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;IAC1C,IAAA,2BAAiB,EAAC,IAAI,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;IAC/C,IAAI,CAAC,iDAA6B,CAAC,CAAC,MAAM,EAAE,CAAC,gBAAgB,EAAE,CAAC;IAChE,MAAM,CAAC,6BAAoB,CAAC,CAAC,SAAS,CAAC,iDAA6B,CAAC,CAAC;IACtE,MAAM,CAAC,sBAAa,CAAC,CAAC,EAAE,CAAC,uCAAsB,CAAC,CAAC,gBAAgB,EAAE,CAAC;IACpE,MAAM,CAAC,gCAAuB,CAAC,CAAC,EAAE,CAAC,oDAA4B,CAAC,CAAC,gBAAgB,EAAE,CAAC;IACpF,MAAM,CAAC,sBAAa,CAAC,CAAC,EAAE,CAAC,uCAAsB,CAAC,CAAC,gBAAgB,EAAE,CAAC;IACpE,IAAA,sDAA+B,EAAC,IAAI,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;AAC1D,CAAC"}
@@ -0,0 +1,17 @@
1
+ /********************************************************************************
2
+ * Copyright (c) 2026 CrossBreeze, EclipseSource and others.
3
+ *
4
+ * This program and the accompanying materials are made available under the
5
+ * terms of the MIT License which is available in the project root.
6
+ *
7
+ * SPDX-License-Identifier: MIT
8
+ ********************************************************************************/
9
+ import { BaseJsonrpcGLSPClient, type DisposeClientSessionParameters } from '@eclipse-glsp/client';
10
+ /** The GLSP client of `HydraniumGlspClientContribution`. */
11
+ export declare class HydraniumGlspClient extends BaseJsonrpcGLSPClient {
12
+ /** Resolves at once when the connection is gone: the session went with its
13
+ * server, and upstream would throw, which a diagram disposed after its
14
+ * client was lost logs as an error. */
15
+ disposeClientSession(params: DisposeClientSessionParameters): Promise<void>;
16
+ }
17
+ //# sourceMappingURL=glsp-client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"glsp-client.d.ts","sourceRoot":"","sources":["../../src/browser/glsp-client.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAElF,OAAO,EAAE,qBAAqB,EAAE,KAAK,8BAA8B,EAAE,MAAM,sBAAsB,CAAC;AAElG,4DAA4D;AAC5D,qBAAa,mBAAoB,SAAQ,qBAAqB;IAC3D;;4CAEwC;IAC/B,oBAAoB,CAAC,MAAM,EAAE,8BAA8B,GAAG,OAAO,CAAC,IAAI,CAAC,CAEnF;CACH"}
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ /********************************************************************************
3
+ * Copyright (c) 2026 CrossBreeze, EclipseSource and others.
4
+ *
5
+ * This program and the accompanying materials are made available under the
6
+ * terms of the MIT License which is available in the project root.
7
+ *
8
+ * SPDX-License-Identifier: MIT
9
+ ********************************************************************************/
10
+ Object.defineProperty(exports, "__esModule", { value: true });
11
+ exports.HydraniumGlspClient = void 0;
12
+ const client_1 = require("@eclipse-glsp/client");
13
+ /** The GLSP client of `HydraniumGlspClientContribution`. */
14
+ class HydraniumGlspClient extends client_1.BaseJsonrpcGLSPClient {
15
+ /** Resolves at once when the connection is gone: the session went with its
16
+ * server, and upstream would throw, which a diagram disposed after its
17
+ * client was lost logs as an error. */
18
+ disposeClientSession(params) {
19
+ return this.isConnectionActive() ? super.disposeClientSession(params) : Promise.resolve();
20
+ }
21
+ }
22
+ exports.HydraniumGlspClient = HydraniumGlspClient;
23
+ //# sourceMappingURL=glsp-client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"glsp-client.js","sourceRoot":"","sources":["../../src/browser/glsp-client.ts"],"names":[],"mappings":";AAAA;;;;;;;kFAOkF;;;AAElF,iDAAkG;AAElG,4DAA4D;AAC5D,yBAAiC,SAAQ,8BAAqB;IAC3D;;4CAEwC;IAC/B,oBAAoB,CAAC,MAAsC;QACjE,OAAO,IAAI,CAAC,kBAAkB,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;IAC7F,CAAC;CACH"}
@@ -8,6 +8,9 @@
8
8
  ********************************************************************************/
9
9
  import { GLSPDiagramManager } from '@eclipse-glsp/theia-integration';
10
10
  import { type GLSPDiagramLanguage } from '@eclipse-glsp/theia-integration/lib/common';
11
+ import { type GLSPDiagramWidget } from '@eclipse-glsp/theia-integration/lib/browser';
12
+ import { type WidgetOpenerOptions } from '@theia/core/lib/browser';
13
+ import { type Disposable } from '@theia/core';
11
14
  /**
12
15
  * `GLSPDiagramManager` subclass that derives the language-correlated getters
13
16
  * (`fileExtensions`, `diagramType`, `contributionId`, `iconClass`) from a
@@ -37,10 +40,51 @@ export declare abstract class AbstractHydraniumGlspDiagramManager extends GLSPDi
37
40
  protected abstract readonly managerLabel: string;
38
41
  /** Optional icon-class override; takes precedence over the language's `iconClass`. */
39
42
  protected readonly customIconClass?: string;
43
+ protected clientListeners?: Disposable;
44
+ /** The reopens asked for so far, which run one at a time. */
45
+ protected reopening: Promise<void>;
40
46
  get fileExtensions(): string[];
41
47
  get diagramType(): string;
42
48
  get contributionId(): string;
43
49
  get iconClass(): string;
44
50
  get label(): string;
51
+ createWidget(options?: unknown): Promise<GLSPDiagramWidget>;
52
+ /**
53
+ * Reopen every diagram once its client is lost, since none of them has a
54
+ * server behind it any more, and a failed one once a client starts.
55
+ */
56
+ protected listenToClient(): void;
57
+ protected reopenAll(which: (widget: GLSPDiagramWidget) => boolean): void;
58
+ protected loadFailed(widget: GLSPDiagramWidget): boolean;
59
+ /**
60
+ * Replace `widget` with a fresh one for the same diagram, in the same tab
61
+ * position and with its viewport: a new container, client id and load.
62
+ * Reopens run one at a time, since each places its replacement next to a
63
+ * neighbour that a reopen running alongside could take out of the layout.
64
+ */
65
+ reopen(widget: GLSPDiagramWidget): Promise<void>;
66
+ /** Taken down as a close does, but without its save prompt, since a dirty
67
+ * diagram whose server is gone has nothing to save to. */
68
+ protected replaceWidget(widget: GLSPDiagramWidget): Promise<void>;
69
+ /**
70
+ * Drops a `selection` key that is present but `undefined` before the base
71
+ * class reads it.
72
+ *
73
+ * Without this, opening a diagram from Theia's file picker throws and the
74
+ * editor never leaves "Loading diagram…". Upstream's
75
+ * `OptionsWithSelection.is` tests `'selection' in options`, which is true for
76
+ * a key explicitly set to `undefined`, and the branch it guards then calls
77
+ * `Object.keys` on that value. Theia's own `QuickFileOpenService` always sets
78
+ * the key — its `buildOpenerOptions` returns `{ selection: range }`, and
79
+ * `range` is `undefined` unless the query carried a `:line:column` suffix —
80
+ * so the crash is reached by the ordinary act of opening a diagram by name.
81
+ *
82
+ * Normalising the OPTIONS rather than rebinding
83
+ * `TheiaOpenerOptionsNavigationService`: the service is shared by every
84
+ * diagram type in the container, so replacing it would make one adopter's
85
+ * fix silently global, and the guard belongs where the value enters rather
86
+ * than where it is consumed. The base method stays the single implementation.
87
+ */
88
+ protected handleNavigations(widget: GLSPDiagramWidget, options?: WidgetOpenerOptions): boolean;
45
89
  }
46
90
  //# sourceMappingURL=glsp-diagram-manager.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"glsp-diagram-manager.d.ts","sourceRoot":"","sources":["../../src/browser/glsp-diagram-manager.ts"],"names":[],"mappings":"AAAA;;;;;;;kFAOkF;AAGlF,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,4CAA4C,CAAC;AAGtF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,8BACsB,mCAAoC,SAAQ,kBAAkB;IACjF,8EAA8E;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C,SAAS,EAAE,OAAO,CAAC,IAAI,CAAC,CAAqB;IAEvD,IAAa,cAAc,IAAI,MAAM,EAAE,CAEtC;IAED,IAAa,WAAW,IAAI,MAAM,CAEjC;IAED,IAAa,cAAc,IAAI,MAAM,CAEpC;IAED,IAAa,SAAS,IAAI,MAAM,CAE/B;IAED,IAAI,KAAK,IAAI,MAAM,CAElB;IAEc,YAAY,CAAC,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAOzE;IAED;;;OAGG;IACH,SAAS,CAAC,cAAc,IAAI,IAAI,CAY/B;IAED,SAAS,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC,MAAM,EAAE,iBAAiB,KAAK,OAAO,GAAG,IAAI,CAIvE;IAED,SAAS,CAAC,UAAU,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAGvD;IAED;;;;;OAKG;IACH,MAAM,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAI/C;IAED;+DAC2D;IAC3D,UAAgB,aAAa,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAqBtE;IAED;;;;;;;;;;;;;;;;;;OAkBG;IACH,UAAmB,iBAAiB,CAAC,MAAM,EAAE,iBAAiB,EAAE,OAAO,CAAC,EAAE,mBAAmB,GAAG,OAAO,CAMtG;CACH"}
@@ -17,7 +17,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  exports.AbstractHydraniumGlspDiagramManager = void 0;
18
18
  const client_1 = require("@eclipse-glsp/client");
19
19
  const theia_integration_1 = require("@eclipse-glsp/theia-integration");
20
+ const core_1 = require("@theia/core");
20
21
  const inversify_1 = require("@theia/core/shared/inversify");
22
+ const client_contribution_1 = require("./client-contribution");
23
+ const diagram_loader_1 = require("./diagram-loader");
24
+ const diagram_widget_1 = require("./diagram-widget");
21
25
  /**
22
26
  * `GLSPDiagramManager` subclass that derives the language-correlated getters
23
27
  * (`fileExtensions`, `diagramType`, `contributionId`, `iconClass`) from a
@@ -43,6 +47,9 @@ const inversify_1 = require("@theia/core/shared/inversify");
43
47
  let AbstractHydraniumGlspDiagramManager = class AbstractHydraniumGlspDiagramManager extends theia_integration_1.GLSPDiagramManager {
44
48
  /** Optional icon-class override; takes precedence over the language's `iconClass`. */
45
49
  customIconClass;
50
+ clientListeners;
51
+ /** The reopens asked for so far, which run one at a time. */
52
+ reopening = Promise.resolve();
46
53
  get fileExtensions() {
47
54
  return [...this.diagramLanguage.fileExtensions];
48
55
  }
@@ -58,6 +65,98 @@ let AbstractHydraniumGlspDiagramManager = class AbstractHydraniumGlspDiagramMana
58
65
  get label() {
59
66
  return this.managerLabel;
60
67
  }
68
+ async createWidget(options) {
69
+ this.listenToClient();
70
+ const widget = await super.createWidget(options);
71
+ if (widget instanceof diagram_widget_1.HydraniumGlspDiagramWidget) {
72
+ widget.onDidRequestReopen(() => void this.reopen(widget));
73
+ }
74
+ return widget;
75
+ }
76
+ /**
77
+ * Reopen every diagram once its client is lost, since none of them has a
78
+ * server behind it any more, and a failed one once a client starts.
79
+ */
80
+ listenToClient() {
81
+ if (this.clientListeners) {
82
+ return;
83
+ }
84
+ const contribution = this.diagramServiceProvider.getGLSPClientContribution(this.contributionId);
85
+ this.clientListeners =
86
+ contribution instanceof client_contribution_1.HydraniumGlspClientContribution
87
+ ? new core_1.DisposableCollection(contribution.onDidLoseClient(() => this.reopenAll(() => true)), contribution.onDidStartClient(() => this.reopenAll(widget => this.loadFailed(widget))))
88
+ : new core_1.DisposableCollection();
89
+ }
90
+ reopenAll(which) {
91
+ for (const widget of this.all.filter(which)) {
92
+ void this.reopen(widget);
93
+ }
94
+ }
95
+ loadFailed(widget) {
96
+ const loader = widget.diContainer.get(client_1.DiagramLoader);
97
+ return loader instanceof diagram_loader_1.HydraniumDiagramLoader && loader.loadOutcome?.status === 'failed';
98
+ }
99
+ /**
100
+ * Replace `widget` with a fresh one for the same diagram, in the same tab
101
+ * position and with its viewport: a new container, client id and load.
102
+ * Reopens run one at a time, since each places its replacement next to a
103
+ * neighbour that a reopen running alongside could take out of the layout.
104
+ */
105
+ reopen(widget) {
106
+ const reopened = this.reopening.then(() => this.replaceWidget(widget));
107
+ this.reopening = reopened.catch(() => undefined);
108
+ return reopened;
109
+ }
110
+ /** Taken down as a close does, but without its save prompt, since a dirty
111
+ * diagram whose server is gone has nothing to save to. */
112
+ async replaceWidget(widget) {
113
+ if (widget.isDisposed) {
114
+ return;
115
+ }
116
+ const tabBar = this.shell.getTabBarFor(widget);
117
+ const titles = tabBar?.titles ?? [];
118
+ const index = titles.indexOf(widget.title);
119
+ // ponytail: a diagram alone in its tab bar reopens where a new one opens,
120
+ // since its split closes with it; restore the dock layout if that matters.
121
+ const neighbour = index > 0 ? titles[index - 1].owner : titles[index + 1]?.owner;
122
+ const mode = this.shell.activeWidget === widget ? 'activate' : tabBar?.currentTitle === widget.title ? 'reveal' : 'open';
123
+ // Detached before the dispose, as a close does: the widget stores its
124
+ // viewport on detach, and its dispose empties the container it reads.
125
+ widget.parent = null;
126
+ widget.dispose();
127
+ const options = {
128
+ mode,
129
+ editMode: widget.options.editMode,
130
+ widgetOptions: neighbour ? { ref: neighbour, mode: index > 0 ? 'tab-after' : 'tab-before' } : undefined
131
+ };
132
+ await this.open(widget.uri, options);
133
+ }
134
+ /**
135
+ * Drops a `selection` key that is present but `undefined` before the base
136
+ * class reads it.
137
+ *
138
+ * Without this, opening a diagram from Theia's file picker throws and the
139
+ * editor never leaves "Loading diagram…". Upstream's
140
+ * `OptionsWithSelection.is` tests `'selection' in options`, which is true for
141
+ * a key explicitly set to `undefined`, and the branch it guards then calls
142
+ * `Object.keys` on that value. Theia's own `QuickFileOpenService` always sets
143
+ * the key — its `buildOpenerOptions` returns `{ selection: range }`, and
144
+ * `range` is `undefined` unless the query carried a `:line:column` suffix —
145
+ * so the crash is reached by the ordinary act of opening a diagram by name.
146
+ *
147
+ * Normalising the OPTIONS rather than rebinding
148
+ * `TheiaOpenerOptionsNavigationService`: the service is shared by every
149
+ * diagram type in the container, so replacing it would make one adopter's
150
+ * fix silently global, and the guard belongs where the value enters rather
151
+ * than where it is consumed. The base method stays the single implementation.
152
+ */
153
+ handleNavigations(widget, options) {
154
+ if (options && 'selection' in options && options.selection === undefined) {
155
+ const { selection: _dropped, ...rest } = options;
156
+ return super.handleNavigations(widget, rest);
157
+ }
158
+ return super.handleNavigations(widget, options);
159
+ }
61
160
  };
62
161
  exports.AbstractHydraniumGlspDiagramManager = AbstractHydraniumGlspDiagramManager;
63
162
  exports.AbstractHydraniumGlspDiagramManager = AbstractHydraniumGlspDiagramManager = __decorate([