App Settings: default Slot order (#99) #131

Merged
crowmaki merged 2 commits from issue-99-app-settings-slot-order into main 2026-10-09 22:47:37 +00:00
Owner

Closes #99

What

An App settings dialog, outside any Project, whose first page edits the app-wide default Slot order (reference_category_order in <config_dir>/defaults.json). New Projects copy it at creation; existing Projects keep their own.

  • Opens from File → App settings… and from an App settings… button on the start screen.
  • The Slot order rows (drag + ↑/↓, DragList + categoryLabel) moved into a shared SlotOrderEditor.svelte, used by both Project settings → Slot order and the new dialog.
  • Core: AppDefaults::save writes atomically (write + fsync defaults.json.partial, then rename); AppDefaults::save_reference_category_order refuses an order that doesn't name each category once (ReferenceCategory::check_order, now shared with the per-Project setter).
  • RPC: default_reference_category_order / set_default_reference_category_order. Never touches the open session, so nothing lands in a Project's undo log.
  • ADR-0006 gains a line on App settings.

Tests

  • crates/studio-core/tests/app_defaults.rs: AppDefaults save/load round-trip (no leftover temp file); a new Project copies the edited order while an existing one keeps its own; bad orders (missing, duplicate, extra) are refused and leave the file unchanged.
  • src-tauri/tests/smoke.rs: the two RPCs through the adapter, then new_project picks up the order.
  • cargo test --workspace --all-features, bun test src, bun run check all pass.

Checked in the running app: ↑/↓ and drag both save to defaults.json, a Project seeded afterwards had the new order, editing defaults afterwards left it alone, and the undo label stayed unchanged.

Screenshots

Start screen with the new entry point:
Start screen

App settings from the start screen (after moving Board up):
App settings from the start screen

File menu inside a Project:
File menu

App settings over a Project whose own Slot order (copied at creation) stays as it was:
App settings inside a Project

Closes #99 ## What An **App settings** dialog, outside any Project, whose first page edits the app-wide default **Slot order** (`reference_category_order` in `<config_dir>/defaults.json`). New Projects copy it at creation; existing Projects keep their own. - Opens from **File → App settings…** and from an **App settings…** button on the start screen. - The Slot order rows (drag + ↑/↓, `DragList` + `categoryLabel`) moved into a shared `SlotOrderEditor.svelte`, used by both Project settings → Slot order and the new dialog. - Core: `AppDefaults::save` writes atomically (write + fsync `defaults.json.partial`, then rename); `AppDefaults::save_reference_category_order` refuses an order that doesn't name each category once (`ReferenceCategory::check_order`, now shared with the per-Project setter). - RPC: `default_reference_category_order` / `set_default_reference_category_order`. Never touches the open session, so nothing lands in a Project's undo log. - ADR-0006 gains a line on App settings. ## Tests - `crates/studio-core/tests/app_defaults.rs`: `AppDefaults` save/load round-trip (no leftover temp file); a new Project copies the edited order while an existing one keeps its own; bad orders (missing, duplicate, extra) are refused and leave the file unchanged. - `src-tauri/tests/smoke.rs`: the two RPCs through the adapter, then `new_project` picks up the order. - `cargo test --workspace --all-features`, `bun test src`, `bun run check` all pass. Checked in the running app: ↑/↓ and drag both save to `defaults.json`, a Project seeded afterwards had the new order, editing defaults afterwards left it alone, and the undo label stayed unchanged. ## Screenshots Start screen with the new entry point: ![Start screen](https://git.crowmaki.me/attachments/e7d7bc86-ec63-454b-90ec-f0f8c62c9cb9) App settings from the start screen (after moving Board up): ![App settings from the start screen](https://git.crowmaki.me/attachments/ead14e75-0f10-4250-b867-45fd839fb512) File menu inside a Project: ![File menu](https://git.crowmaki.me/attachments/22fe5f7a-676b-4bf7-a590-522c52c6ee7c) App settings over a Project whose own Slot order (copied at creation) stays as it was: ![App settings inside a Project](https://git.crowmaki.me/attachments/830f2cd9-d2d3-4cbe-92ae-0dbee72ea811)
An App settings dialog, reachable from File and the start screen, edits the
category order new Projects copy from defaults.json. Saving validates the
order and writes the file atomically; existing Projects keep their own.

Co-Authored-By: Claude <noreply@anthropic.com>
Flush defaults.json before the rename, share the category list and parsing,
and note App settings in ADR-0006.

Co-Authored-By: Claude <noreply@anthropic.com>
crowmaki deleted branch issue-99-app-settings-slot-order 2026-10-09 22:47:38 +00:00
Sign in to join this conversation.
No description provided.