M1.12: notifications as toasts
The host publishes picker, command-line and pump errors as notification events (Engine::notify, same id sequence) instead of stderr, keeps notifications and watchFailed published before engine_ready and replays them after the state replay, so startup warnings (corrupt settings, journal entries) reach the UI. ipc.ts announces engine_ready once all subscriptions started together are registered. Frontend: notifications store and NotificationStack (bottom right, info auto-dismissed after 5 s, warnings/errors stay, close button and Escape, at most 5 visible with "+n more", role status/alert); watchFailed maps to a warning toast; failed commands without their own UI raise an error toast. Catalog keys notification.settings.*, project.*, vfs.*, watch.*, command.* plus the runtime allow-list. Docs updated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
7b7273a947
commit
f41df518b5
21 changed files with 1178 additions and 94 deletions
|
|
@ -5,17 +5,20 @@
|
|||
*
|
||||
* Shortcuts come from the engine's command specs (see `shortcuts.ts`); the
|
||||
* area listens on the window in the capture phase so they also work while
|
||||
* CodeMirror has the focus.
|
||||
* CodeMirror has the focus. A keymap that cannot be loaded raises an
|
||||
* error toast.
|
||||
*/
|
||||
import { onBeforeUnmount, onMounted } from "vue";
|
||||
import { t } from "../../i18n";
|
||||
import { useEditorStore } from "../../stores/editor";
|
||||
import { useNotificationsStore } from "../../stores/notifications";
|
||||
import ClosePrompt from "./ClosePrompt.vue";
|
||||
import CodeEditor from "./CodeEditor.vue";
|
||||
import EditorTabs from "./EditorTabs.vue";
|
||||
import { commandFor, loadEditorKeymap, type EditorKeymap } from "./shortcuts";
|
||||
|
||||
const editor = useEditorStore();
|
||||
const notifications = useNotificationsStore();
|
||||
|
||||
/** Keymap loaded from the engine, empty until loaded. */
|
||||
let keymap: EditorKeymap = [];
|
||||
|
|
@ -52,7 +55,7 @@ onMounted(() => {
|
|||
if (result.ok) {
|
||||
keymap = result.value;
|
||||
} else {
|
||||
editor.lastError = result.error;
|
||||
notifications.notifyError("listCommands", result.error);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue