Repository navigation
feat(gui): Svelte file operations + toasts (#217) - #225
Merged
Merged
Conversation
Closes #217 (file-operations half; editing landed in #224). Part of epic #214, strangler-on-main: React still ships; Svelte stays behind the dev-only entry and out of the production bundle (unchanged at 595.75 kB). - file-operations.svelte.ts: new/open/openRecent/save/saveAs/exportGcode against projectSession, reusing commands (save/load/planWind), @tauri-apps/plugin-dialog, WindDefinitionSchema validation, and recentFiles. Dirty prompt preserved; a failed save keeps the doc dirty; declined prompt / cancelled dialog leave it untouched. Errors notify + return false (no unhandled rejections from handlers). - notifications.svelte.ts runes store + Toasts.svelte renderer (self-contained scoped styles), replacing the Zustand toastStore + ToastContainer; wired into App.svelte. (Toast portion of #220, brought forward as a file-ops dependency.) - MenuBar File/Edit items enabled + wired; keyboard shortcuts Ctrl/Cmd+N/O/S, +Shift+S, +E, +D, Delete (skipped while typing; Alt excluded so AltGr is safe). - Domain/state split: ProjectDocument + createEmptyDocument extracted to a plain types/document.ts (shared by tsc-checked modules); added windDefinitionToDocument. 696 tests; coverage 83.0/72.6/81.7/82.x. Adversarially reviewed (a toast-styling defect — the Svelte entry never imported ToastContainer.css — caught and fixed with self-contained scoped styles + a Toasts render test). Closes #217. Refs #214
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #217 (the file-operations half; the editing half landed in #224). Part of epic #214 (strangler-on-
main: React still ships; Svelte stays behind the dev-only entry and out ofvite build— unchanged at 595.75 kB).What changed
src/services/file-operations.svelte.ts:newProject/openProject/openRecent/saveProject/saveProjectAs/exportGcode, ported from the ReactcreateFileOperationsagainstprojectSession. Reuses the existingcommands(saveWindFile / loadWindFile / planWind),@tauri-apps/plugin-dialog, theWindDefinitionSchemaruntime validation, andrecentFilesunchanged.markSavedonly on success).falseinstead of throwing across the event-handler boundary — no unhandled rejections from menu/keyboard handlers (the menurun()and the keyboard helper also swallow stray dialog rejections).notifications.svelte.tsrunes store (replaces the Zustand toast store) +Toasts.svelterenderer, wired intoApp.svelte. (This is the toast portion of Migrate dialogs, toasts, chrome & theme to Svelte #220, done early; the dialogs/theme remain in Migrate dialogs, toasts, chrome & theme to Svelte #220.)ProjectDocument+createEmptyDocumentextracted to a plainsrc/types/document.tsso tsc-checked modules (converters, the service) share the type; the runes session re-exports them. AddedwindDefinitionToDocument(reusesconvertWindSchemaToLayer).Verification
tsc,svelte-check(0/0), 693 vitest tests (+13: 9-case file-ops service, notifications, converter round-trip, menu wiring), coverage 82.2/72.3/80.8/81.8 (> 60/65/50/60), stylelint,lint:css:vars,vite build, bundle budget.@tauri-apps/plugin-dialogare all out of the rollup input).Notes for reviewers
@hello-pangea/dnd,zustand,react*etc. all still inpackage.json— removed at the Cutover: remove React, swap toolchain, docs/ADR, merge to main #221 cutover.Closes #217. Part of #214.