Repository navigation
feat(gui): Svelte layer list + layer editors (#217) - #224
Merged
Merged
Conversation
Layer-editing half of #217 (file ops follow in a second PR). 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). - project-session.svelte.ts gains the layer ops deferred from #215: add / remove / update / reorder / duplicate / selectLayer + a selectedLayer derived. Selection is session-only (never dirties the document). - LayerList.svelte replaces LayerStack + LayerRow and drops @hello-pangea/dnd from the Svelte path: native HTML5 drag for pointer + ArrowUp/Down on the drag handle for keyboard reorder. Add (type picker) / select / duplicate / remove at parity. (@hello-pangea/dnd stays in package.json until the React app is removed at #221.) - Hoop / Skip / Helical editors ported, reusing helicalValidation.ts unchanged: debounced + on-blur + on-mount validation (via $effect, matching React's validate-on-store-value model), backend-error precedence, integer parsing for pattern/skip, the coprime cross-field rule, and the geometry hint. - Editors reuse the single NumberField primitive (now with an optional tooltip). - Wired into the #216 shell: list in the left inspector, selected editor in the right Layer Properties inspector. 680 tests; coverage 83.7/74.3/81.7/82.6. Adversarially reviewed (mount-validation parity, coprime/aliasing guards folded in). Refs #214, refs #217
CameronBrooks11
added a commit
that referenced
this pull request
Jun 26, 2026
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.
Part of #217 (project & layer editing). This is the layer-editing half — layer list + reordering + the three layer editors. File operations (open/save/export + dirty prompt) follow in a second PR that closes #217. Part of epic #214 (strangler-on-
main: React still ships; Svelte stays behind the dev-only entry and out ofvite build).What changed
project-session.svelte.tsgains the layer operations deferred from Svelte 5 foundation + config-forms vertical slice (decision gate) #215:addLayer/removeLayer/updateLayer/reorderLayers/duplicateLayer/selectLayer, plus aselectedLayerderived. Selection is session-only (never dirties the document); document mutations bump the revision.LayerList.sveltereplacesLayerStack+LayerRowand drops@hello-pangea/dnd: reordering is native HTML5 drag for pointer plus ArrowUp/Down on the drag handle for keyboard accessibility. Add (type picker) / select / duplicate / remove all ported at parity.HoopLayerEditor/SkipLayerEditor/HelicalLayerEditorported to Svelte, reusing the framework-agnostichelicalValidation.tsunchanged: debounced live + on-blur validation, backend-error precedence, integer parsing for pattern/skip, the coprime cross-field rule (editing pattern or skip re-validates both), and the geometry hint (skip≥pattern / circuit-divisibility). The circuit-mismatch messaging the issue calls out is intact.NumberFieldprimitive (now with an optionaltooltip) instead of a second numeric-input component.@hello-pangea/dndStill in
package.jsonbecause the live ReactLayerStackstill uses it; no Svelte file imports it. It's removed at the #221 cutover when React goes.Verification
tsc,svelte-check(0 errors), 678 vitest tests (+15), coverage 83.7/74.4/81.6/82.7 (> 60/65/50/60), stylelint,lint:css:vars,vite build, bundle budget.index-*.jsstill 595.75 kB (Svelte not in the rollup input).Notes for reviewers
http://localhost:5173/index.svelte.html→ Prepare workspace → Layers.Part of #214, part of #217.