From 97b85f677276496055d38162b7b8de46aa44de31 Mon Sep 17 00:00:00 2001 From: Iliyan Velichkov Date: Wed, 15 Jul 2026 15:28:49 +0300 Subject: [PATCH] fix(intent-editor): keep Generate clickable after a cross-model failure MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Generate was gated on `issues.length`, but a cross-model "target cannot be resolved" error is a generate-time issue thrown by CrossModelSupport, not a parse-time one — the live/debounced parse never re-produces it, so it stayed pinned and the button was permanently disabled. This forced users to close and reopen the intent file (or find the non-obvious Refresh button) to retry after generating the dependency project. Drop the issues gate (`ng-disabled="state.isBusy"` only): the backend re-parses and re-validates on every /generate call, so the gate was UX polish, not a safety guard — a bad buffer just fails gracefully and re-shows its issues. Clear the pinned issues on a successful generate so a stale cross-model message disappears once the retry succeeds. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../resources/META-INF/dirigible/editor-intent/editor.html | 2 +- .../META-INF/dirigible/editor-intent/js/editor.js | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/components/ui/editor-intent/src/main/resources/META-INF/dirigible/editor-intent/editor.html b/components/ui/editor-intent/src/main/resources/META-INF/dirigible/editor-intent/editor.html index 576a3b5881d..900a9e77905 100644 --- a/components/ui/editor-intent/src/main/resources/META-INF/dirigible/editor-intent/editor.html +++ b/components/ui/editor-intent/src/main/resources/META-INF/dirigible/editor-intent/editor.html @@ -158,7 +158,7 @@ - + diff --git a/components/ui/editor-intent/src/main/resources/META-INF/dirigible/editor-intent/js/editor.js b/components/ui/editor-intent/src/main/resources/META-INF/dirigible/editor-intent/js/editor.js index 099303f936d..81a4a3b9aec 100644 --- a/components/ui/editor-intent/src/main/resources/META-INF/dirigible/editor-intent/js/editor.js +++ b/components/ui/editor-intent/src/main/resources/META-INF/dirigible/editor-intent/js/editor.js @@ -248,9 +248,9 @@ editorView.controller('IntentEditorController', ($scope, $http, ViewParameters, // Re-parse and re-validate the current buffer on demand. Generate resolves cross-model // dependencies against other projects' already-generated .model files; when one is missing it - // fails with issues that stay pinned (blocking Generate) until the buffer is re-parsed. After - // generating the dependency project, Refresh clears those stale issues and re-renders — no browser - // reload needed. + // fails with issues that stay pinned in the strip until the buffer is re-parsed (Generate itself + // stays clickable — it re-validates server-side). After generating the dependency project, + // Refresh clears those stale issues and re-renders — no browser reload needed. $scope.refresh = () => { refreshPreview().then(() => { statusBarHub.showMessage('Re-validated the intent'); @@ -319,6 +319,7 @@ editorView.controller('IntentEditorController', ($scope, $http, ViewParameters, dialogHub.showBusyDialog('Generating model files'); $http.post(`${GENERATE_URL}?workspace=${encodeURIComponent(location.workspace)}&project=${encodeURIComponent(location.project)}&path=${encodeURIComponent(location.path)}`) .then((response) => { + $scope.issues = []; // a successful generate clears any pinned cross-model issue from a prior attempt const written = (response.data.written || []).length; const scrubbed = (response.data.scrubbed || []).length; const plan = response.data.codeGenerations || [];