Skip to content

feat(core,app): page switches, page deletion and per-profile global pages (#156) - #208

Merged
q-horde merged 8 commits into
epic/180-betafrom
feature/156-page-switches-management
Oct 30, 2026
Merged

q-horde merged 8 commits into
epic/180-betafrom
feature/156-page-switches-management

Conversation

@q-horde

@q-horde q-horde commented Oct 30, 2026 •

Copy link
Copy Markdown

Summary

Slice 10 of the beta epic #180 (plan QUB-633, revision 2). A page can be switched off with enabled = false: it keeps its keys and gets no index. An app profile can leave out the global pages with global_pages = false in [profile]. The app adds, renames, reorders, switches and deletes pages through the round-trip editor, with an undo.

Closes #156

Changes

  • Core, profile and state (profile.rs, state.rs, schemas/profile.schema.json): enabled on a [[pages]] entry and global_pages in [profile], both default true. PageList::of skips disabled pages and keeps the context page whatever its flag. It starts at index 1 for a profile with global_pages = false; the global profile ignores the field. Without a context page, the first enabled page is the context page. state::page_list exposes the list for the shared fixture.
  • Core, editor (edit.rs): ProfileDocument::edit_page takes a PageEdit (add, rename, move, enable, delete) and answers the page's new number and the inverse edit. A move swaps the tables' places in the file, so a page takes its comments and keys along. EditError::Protected refuses disabling the context page and deleting the only enabled page. ProfileFields gains global_pages.
  • Client (editor.rs, profiles.rs): Editor::edit_page (snapshot, then the atomic write) and Editor::restore. restore only accepts a snapshot from the editor's own directory and of the same profile; it is the undo of a delete. ProfileSummary gains disabled and global_pages.
  • Fixtures (tests/protocol-fixtures/editor/): pages.json with pages.toml and pages.1.toml to pages.6.toml, one file per step; page-list.json, the cases both page_list and the app's pageList must give; a third header step global_pages (terminal.global.toml).
  • App:
    • Shell commands edit_page and restore_profile.
    • lib/profiles.ts: pageList and contextPage follow PageList::of.
    • Tab strip: muted disabled pages with a switch; a working +.
    • Profiles screen: a page list with name, On, Up, Down, Delete, + page and an Undo, plus a "Show the global pages" checkbox for app profiles.
    • Mock: applies the page edits and the restore in memory.
  • Docs:

Automated checks

  • just fmt-check
  • just lint (clippy -D warnings)
  • just test (833 passed, 1 skipped)
  • just deny (advisories, bans, licenses, sources ok)
  • just app-test (svelte-check 0 errors, vitest 2692 passed, audit clean, app deny ok)
  • Documentation updated in this PR

User test

Owner, host, the daemon, the app (docs/beta-test.md, section 5, block #208).

  • In the app, switch apps off on the global profile: the tab goes muted, the pad's left button skips it (general, then nothing), the file has enabled = false on that page with its keys intact. Switch it on: back.
  • Set global_pages = false on the VS Code profile in the app: under VS Code the left button does nothing at index 1; Konsole still has the global pages.
  • Add a page to the Konsole profile, rename it tools, move it up, delete it: the file after each step differs only in that page; the pad follows (the new page reachable with the right button).
  • Try to disable or delete the only enabled page of a profile: the controls are inactive with the hint.

Notes for reviewer

  • Context page rule: without a page named context, the context page is now the first enabled page, not the first page; a page named context that is disabled is still the context page and stays in the list. The editor refuses enabled = false on it; the loader does not, so a hand edit has no effect rather than an error.
  • Undo of a delete goes through the snapshot (restore_profile); the other page ops undo by the inverse edit the answer carries. The Profiles screen keeps one level of undo; a header write clears it, as a restore would roll that write back too.
  • Inline pages = [...] arrays: rename and enable work; add, move and delete answer the editor's Shape error ("edit in a text editor").
  • Known gaps, not in this slice: deleting the page the shell has pinned does not move the pin; a profile with no pages still gets no tab of its own in the app while the daemon lists its (missing) context page at index 1, as before this slice.
  • The Tauri shell compiles only in the CI app job; the sandbox has no webkit2gtk.
  • Under heavy load one full vitest run timed out six tests at 5 s; they pass alone and in a second full run.

Signed-off-by: Jade (q-horde) <bot@qubernetic.com>
Signed-off-by: Jade (q-horde) <bot@qubernetic.com>
@codecov

codecov Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.20290% with 16 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
crates/keyvo-core/src/edit.rs 93.19% 13 Missing ⚠️
crates/keyvo-client/src/editor.rs 93.18% 3 Missing ⚠️

📢 Thoughts on this report? Let us know!

Signed-off-by: Jade (q-horde) <bot@qubernetic.com>
Signed-off-by: Jade (q-horde) <bot@qubernetic.com>
Signed-off-by: Jade (q-horde) <bot@qubernetic.com>
Signed-off-by: Jade (q-horde) <bot@qubernetic.com>
Signed-off-by: Jade (q-horde) <bot@qubernetic.com>
Signed-off-by: Jade (q-horde) <bot@qubernetic.com>
@q-horde
q-horde marked this pull request as ready for review October 30, 2026 18:32
@q-horde
q-horde requested a review from q-soriarty as a code owner October 30, 2026 18:32
@q-horde
q-horde merged commit a313198 into epic/180-beta Oct 30, 2026
6 checks passed
@q-horde
q-horde deleted the feature/156-page-switches-management branch October 30, 2026 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant