Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .claude/skills/add-feature/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ description: Use when adding or changing a DevNotes feature end to end (core ser

# Add a feature

1. Read the matching section of `docs/architecture.md` (headings are named in `CLAUDE.md`), the plan's section for the screen, the nearest existing feature of the same shape, and, for a screen that existed before 1.0.0, its Angular twin at the `angular-reference` tag (`git show angular-reference:src/app/…`; same look, same behaviour). Copy the layout; do not invent a new one.
1. Read the matching section of `docs/architecture.md` (headings are named in `CLAUDE.md`), the nearest existing feature of the same shape, and, for a screen that existed before 1.0.0, its Angular twin at the `angular-reference` tag (`git show angular-reference:src/app/…`; same look, same behaviour). Copy the layout; do not invent a new one.
2. Decide the side: data processing, filtering, rules and validation are the **core** (`crates/engine/src/<feature>/{model,store}.rs`, service functions in `<feature>.rs`). The interface describes and displays.
3. Schema change? Run `database-migration` first.
4. The call: one function in `crates/ui/src/api/<feature>.rs`, the only place that names the engine, returning a `Pending` from the right `Backend` queue (`db` for anything touching the library or the index, `compute` for pure work, `spawn` for the network). A new `ErrorCode` gets its sentence in the UI's exhaustive `match` and its key in `fr.json` **and** `en.json`.
5. The screen: run `egui-ui`. State in `AppState`, actions applied in `apply`, keys through `keys::dispatch`, widgets from `widgets/`, colours and gaps from `theme::tokens`, every string a key in both locales.
6. Something asked of the OS (a dialog, the clipboard, the tray)? Run `platform-integration`.
7. Sealed data (titles, bodies, names, attachments) touched? Run `devnotes-security-review`.
8. Tests with the code: Rust inline or `crates/engine/tests/`; kittest over a real core (`testing::backend`/`unlocked`); an e2e scenario if a user journey changes (`desktop-e2e-testing`).
9. Update `docs/architecture.md` and, only if a new trap exists, one line of `CLAUDE.md`.
9. Update `docs/architecture.md` and, only if a new trap exists, one line of `CLAUDE.md`. What the user sees: `docs/content/fr` and `docs/content/en` (`docs/content/README.md` says how), and, when they show the screen that changed, the README's GIFs (`docs/gifs/`, by `app::screens` then `--example tours`) and the site's scenes (`website/`, skill `marketing-site`). Publishing them is automatic.
10. Finish with `verify-change`, including a look at the window. Report what ran and what did not.
2 changes: 1 addition & 1 deletion .claude/skills/desktop-e2e-testing/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description: Use when writing, running or debugging an end-to-end scenario of th
# Desktop e2e

- Build the flavour first, every time `crates/` changed: `cargo build -p app --features e2e --target-dir target/e2e` (its own target directory: no other build overwrites it). Then `cargo test -p e2e --test NN_name` for one scenario, `cargo test -p e2e` for all of them, one file after the other — what CI runs on each OS, from the start of the run. `cargo test --workspace` runs with `--exclude e2e`.
- A scenario is `e2e/tests/NN_name.rs` (Annex D of the plan keeps the old numbers and names), one `#[test]` of named `step`s. It launches its own application on its own `tempfile` profile, seeds its own state, and must pass alone. There are no groups to keep (plan D31): a new file is picked up by its name.
- A scenario is `e2e/tests/NN_name.rs`, one `#[test]` of named `step`s. It launches its own application on its own `tempfile` profile, seeds its own state, and must pass alone. There are no groups to keep (D31): a new file is picked up by its name.
- Drive it through `e2e::App`: `wait_for`, `has`, `click`, `fill`, `type_text`, `press` (a physical key: the area keys read the position), `eventually`, `capture`, `relaunch` (a real restart through `--action quit`), `quit`. Add a method there before reaching for the protocol in a scenario.
- Wait on conditions (`eventually`), never a duration: `std::thread::sleep` is refused by `e2e/clippy.toml`; the one exception, asserting that **nothing** happens, carries an `#[expect]` saying so. `Settle` waits for egui, not for the core: its answer comes frames later, which is why `eventually` reads again.
- Address controls by `author_id` (the old `data-testid` names), never by text: the language is the machine's. Missing one? Give the widget its id through `widgets::address` / `widgets::interact`.
Expand Down
22 changes: 11 additions & 11 deletions .claude/skills/egui-ui/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,35 +5,35 @@ description: Use when writing or reviewing the egui interface (crates/ui, crates

# egui UI

Sources of truth: `../../../docs/egui-migration/egui-migration-plan.md` (§ 3.3–3.8 architecture, § 5 visual parity, § 8
tests), then `docs/architecture.md` as sections are ported. The look to reproduce is the Angular
Source of truth: `docs/architecture.md` (« Decisions », « Interface (egui) », « Backend and events »,
« Testing »). The look to reproduce, for a screen that existed there, is the Angular
application, whole at the `angular-reference` tag (its `src/` and `e2e/`, e.g. `git show angular-reference:src/app/…`,
D32): read a screen's component and its SCSS before porting it, and its captures (§ 5.2).
D32): read a screen's component and its SCSS before changing it, and its captures.

## Rules

- **Keep it simple.** Write the plain version first; a helper, trait or generic comes at the second
real use. Small functions, names that say what things are, early returns over nesting.
- The UI thread does no I/O, crypto or waiting: every call to the core goes `api/` → `Backend` →
`Pending` (§ 3.3) — `db`, the core's single ordered queue, for anything that touches the database
`Pending` — `db`, the core's single ordered queue, for anything that touches the database
or the index (reads included); `compute` for pure work; `spawn` for the network (D11). Never
`block_on`, never a lock taken while drawing. Only exception: a pure core function whose input
the screen bounds, under 1 ms, called directly but still through `api/` (D12). Every concurrency
rule is in § 3.3.6 of the plan; one that is not there does not exist.
rule is in `docs/architecture.md` → "The concurrency rules"; one that is not there does not exist.
- A data rule (what a `{{field}}`, a variable name, a heading is) belongs to the core: `text`,
`richtext`, `drawing` take its result as an argument and never redefine it (D10).
- Drawing reads a screen's state (`&…State`) and may change its view (`&mut …View`: text being
typed, editor buffers, open menus, scroll, gestures). It pushes `Action`s; state changes only in
`AppState::apply` (§ 3.4, D13).
`AppState::apply` (D13).
- Keys: a focused widget consumes what it handles; everything else goes through `keys::dispatch`
(modal, then area, then application). No screen reads shortcuts on its own (§ 3.12, D14).
(modal, then area, then application). No screen reads shortcuts on its own (D14).
- Anything longer than ~100 rows is virtualised; a costly `LayoutJob` is cached, and any cache
holding library content lives in `LibraryCaches` (§ 3.6, D17).
holding library content lives in `LibraryCaches` (D17).
- Colours, spacing and durations come from `theme::tokens`: no hex or millisecond literal in a
widget (§ 3.7).
widget.
- Every interactive widget has an accessible name and carries, as its AccessKit `author_id`, the
`data-testid` its Angular twin had (§ 3.12, § 8.2).
- No user-visible string in code: an `i18n` key and its params (§ 3.11).
`data-testid` its Angular twin had.
- No user-visible string in code: an `i18n` key and its params.
- **Widgets go through `widgets::interact`** (at least 24 × 24, role and name, `author_id`, focus
ring); `Ui::interact` is refused elsewhere by `crates/ui/clippy.toml`. A label or frame that is
not clickable gets its id with `widgets::address`.
Expand Down
2 changes: 1 addition & 1 deletion .claude/skills/marketing-site/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ description: Use when planning or building the DevNotes marketing/showcase websi

Load `frontend-design` and follow its plan → review → build → critique process. Then:

1. Ground it in the product: read `README.md`, the three tours (`docs/tour-notes.gif`, `docs/tour-tools.gif`, `docs/tour-http.gif`), `docs/mockups/` and the app's real tokens (`crates/ui/src/theme/tokens.rs`: palette, amber accent, density, dark base). The site should feel made by the same hands as the app, not from a template.
1. Ground it in the product: read `README.md`, the three tours (`docs/gifs/`) and the app's real tokens (`crates/ui/src/theme/tokens.rs`: palette, amber accent, density, dark base). The site should feel made by the same hands as the app, not from a template.
2. Real content only: encrypted multi-library vault, snippets with `{{fields}}`, Markdown notes, todo lists, canvas/board, quick-paste palette, HTTP/JSON/tools. Show real UI captures or live demos, not icons in cards.
3. Avoid: identical feature cards, SaaS hero with gradient and big stat, fade-up on every section, decorative blobs. One memorable element; the rest stays quiet.
4. It is an Angular project of its own in `website/`, outside the Cargo workspace: its own `package.json` and lockfile, `npm ci` from `website/`, and a dependency the site alone needs is still one the user approves first. It imports nothing from the application: the design tokens are a copy of `crates/ui/src/theme/tokens.rs` (`scripts/tokens.test.mjs` keeps them equal). The in-app desktop rules (egui, no router) do not apply there. A workflow publishes the build to the site's own repository; the public URL is a build input, never hard-coded, and canonical URLs, the sitemap and Open Graph tags are built from it.
Expand Down
2 changes: 1 addition & 1 deletion .claude/skills/performance-profiling/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: Use when a DevNotes operation feels slow (query_notes, search, boar

# Performance profiling

1. Measure first; no optimisation without a number. Rust: `cargo bench -p engine` (criterion, 8000 notes of ~13 kB; not in CI). Compare with `--save-baseline main` then `--baseline main`. Interface: `DEVNOTES_PERF=<profile> cargo test --release -p ui --lib app::perf -- --nocapture` (the journeys of plan § 6.3), `app --features profiling` with `puffin_viewer` for egui's frames, `e2e/examples/footprint.rs` for memory and idle CPU.
1. Measure first; no optimisation without a number. Rust: `cargo bench -p engine` (criterion, 8000 notes of ~13 kB; not in CI). Compare with `--save-baseline main` then `--baseline main`. Interface: `DEVNOTES_PERF=<profile> cargo test --release -p ui --lib app::perf -- --nocapture` (its journeys), `app --features profiling` with `puffin_viewer` for egui's frames, `e2e/examples/footprint.rs` for memory and idle CPU.
2. Known facts: one lock serialises commands, and `query_notes` holds it for ~90 % of its cost; lists send previews (`PREVIEW_LINES`); side tables are read by bound ids up to 500, else by subquery; decrypting sealed fields dominates.
3. Fix at the owning layer (the core for data; a `QueryCell` compared by value, one call in flight; virtualise past ~100 rows; cache a costly `LayoutJob`; nothing costly in the frame).
4. Keep `autobenches = false`, `bench = false` and no `Drop` on `Corpus` (load-bearing).
Expand Down
6 changes: 3 additions & 3 deletions .claude/skills/platform-integration/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ description: Use when adding or changing what DevNotes asks of the operating sys

# Platform integration

`crates/platform` is the one place that names a native crate (plan § 3.10). Neither egui nor the core appears there; the interface asks it through plain functions and traits.
`crates/platform` is the one place that names a native crate. Neither egui nor the core appears there; the interface asks it through plain functions and traits.

1. **Safe APIs only** (D7): `unsafe_code` is forbidden in every crate. A native need without a safe crate is a decision for the plan, not an `unsafe` block.
1. **Safe APIs only** (D7): `unsafe_code` is forbidden in every crate. A native need without a safe crate is a decision (`docs/architecture.md` → "Decisions"), not an `unsafe` block.
2. **One module per subject** (`paths`, `window`, `instance`, `motion`, `dialog`…), its OS differences behind `cfg(target_os)` inside it. What a screen calls is a trait when a test must fake it (`dialog::FileDialog`, the clipboard, the window): the fake answers, it never reimplements a rule. What only a desktop can run goes in the module's `system.rs`, out of Sonar's coverage and on the manual checklist (`docs/recette/recette.html`); everything a test can reach stays beside it.
3. **A new native crate** goes through `dependency-audit` first (licence in `deny.toml`'s allow list, advisories, maintenance), pinned exactly. Do not bump one as part of a feature.
4. **Start-up order is load-bearing** (`crates/app/src/main.rs`): script host, arguments, instance claim (fails closed: one process per profile, D16), logger, panic hook (location and thread, never the message, D18), preferences, then the window — created hidden, shown by the first frame, eframe persistence off.
5. **Traps**: under native Wayland winit 0.30 drops files and cannot hide the window, so X11 is taken when `DISPLAY` exists (D15); on Windows a named-pipe `PermissionDenied` means the profile is taken; half-written files are staged then renamed.
6. **The `e2e` flavour** (`--features e2e`) adds eframe's inspection port, the software adapter and two doors — `--action <name>` and `DEVNOTES_E2E_DIALOG` — and nothing else; it takes no global key. A release build of it does not compile. Never widen it.
7. Test in the module: a temporary directory for anything on disk; a real second process only where the subject is processes (`instance`).

**Verify**: `cargo clippy --workspace --all-targets --all-features -- -D warnings`, `cargo test --workspace --exclude e2e`, then run the app on a temporary profile (`cargo run -p app -- --profile <dir>`) on each OS the change touches, and say which ones did not run. Reference: plan § 3.10, § 3.13; `docs/architecture.md` → "The binary, its profile and its window".
**Verify**: `cargo clippy --workspace --all-targets --all-features -- -D warnings`, `cargo test --workspace --exclude e2e`, then run the app on a temporary profile (`cargo run -p app -- --profile <dir>`) on each OS the change touches, and say which ones did not run. Reference: `docs/architecture.md` → "The binary, its profile and its window".
1 change: 1 addition & 0 deletions .claude/skills/release-packaging/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ description: Use when building the desktop executable/installer, preparing a ver
- Release notes come from PR labels; PR bodies need `Closes #N`. The newest `CHANGELOG.md` section is generated; do not hand-edit it.
- A version on its own branch (`dev/x.y.z`): PRs are squashed into it, `main` is merged into it to catch up, and it reaches `main` by a merge commit (`git merge --no-ff`), never a squash — the notes read what that merge brings. From the branch, `node scripts/release-notes.mjs generate --version x.y.z` prints what the version holds so far and writes nothing.
- Never commit signing keys (`*.key`, `*.pfx`, `.tauri/` are ignored). Never trigger a release, tag or push unless the user asks.
- The site follows by itself: `website.yml` publishes it at the end of the release (its download page names the latest one). Before a release, `docs/content/` says what the version does, and `checkedOn` in `index.json` names it once the pages were read against the application.
- Before a release: `verify-change` (all rows), then `dependency-audit`.
5 changes: 2 additions & 3 deletions .claude/skills/rust-guidelines/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ rendered book, not at these files). Read the `<why>` before applying a rule: the
## Order of precedence

1. `CLAUDE.md`, `.claude/rules/security.md`, `docs/architecture.md` and the local skills.
2. `../../../docs/egui-migration/egui-migration-plan.md` for work on the migration.
3. These guidelines.
2. These guidelines.

Keep it simple: a guideline is a reason to write less, plainer code, never a licence to add a
layer. Apply it to the code you are changing; do not sweep the codebase unasked.
Expand All @@ -25,7 +24,7 @@ layer. Apply it to the code you are changing; do not sweep the codebase unasked.
| --------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| M-ERRORS-CANONICAL-STRUCTS, M-APP-ERROR | Errors stay `AppError { code, params, detail }` with `ErrorCode` (→ "Error contract"); no `anyhow`, no backtraces in answers. |
| M-INTEGRATION-TESTS | Unit tests stay inline `#[cfg(test)] mod tests` at the bottom of the file; `tests/` holds the integration binaries, as today. |
| M-SMALLER-CRATES | The crates are the ones the migration plan lists (§ 3.1); a new crate is a decision, not a reflex. |
| M-SMALLER-CRATES | The crates are the ones `docs/architecture.md` lists (« Overview »); a new crate is a decision, not a reflex. |
| M-MODULE-DOCS, M-CANONICAL-DOCS | Comments record decisions, not narration (`CLAUDE.md`): short doc comments, no essays. |
| M-LOG-STRUCTURED | Logging stays on `log`; what matters here is the redaction part — never log note content, passphrases, keys or tokens. |
| M-STATIC-VERIFICATION | The lint set is the project's (`unsafe_code` forbidden, `clippy::pedantic` denied); an extra lint is a proposal to the user. |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/packages.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Packages

# The packages a release publishes, proven before a release depends on them (plan § 4.3 point 5):
# The packages a release publishes, proven before a release depends on them:
# built and signed as `release.yml` builds them, but with a key made for the run; installed on a
# clean runner as 1.0.0; offered 1.0.1 by a `latest.json` served on the runner, first altered by
# one byte — refused, nothing changes — then whole — installed. Both versions package the same
Expand Down
5 changes: 1 addition & 4 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@ coverage
target
.angular
package-lock.json
# Maquette statique de référence : conservée telle quelle, hors périmètre du formatage.
docs/mockups/*
# La feuille de recette : une page autonome, ses cas sur une ligne de données.
docs/recette/*
docs/egui-migration/*
# The documentation is written by hand, without a formatter: its own checks read it.
docs/content/fr
docs/content/en
Expand All @@ -21,7 +18,7 @@ website/src/app/docs/generated
.claude/skills/core-web-vitals
.claude/skills/accessibility

# Written by `npm run golden` on `angular-reference`, byte for byte.
# Test data, compared byte for byte.
golden/*/
# Prettier itself, copied by `npm run prettier`: kept as published.
crates/text/prettier
Loading
Loading