Skip to content
Open
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 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/` (its home says which page holds what; 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`); a step of an e2e journey if a nominal path changes (`desktop-e2e-testing`).
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.
9. Update the page of `docs/architecture/` the change belongs to 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 @@ -5,7 +5,7 @@ description: Use when writing, running or debugging an end-to-end journey of the

# Desktop e2e

`CONTRIBUTING.md` → "The end-to-end journeys" says how to run, watch, mend and extend them; `docs/architecture.md` → "The journeys, on the assembled window" lists the fourteen and what the driver does. What is worth knowing before touching one:
`CONTRIBUTING.md` → "The end-to-end journeys" says how to run, watch, mend and extend them; `docs/architecture/testing.md` → "The journeys, on the assembled window" lists the fourteen and what the driver does. What is worth knowing before touching one:

- 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 journey, `cargo test -p e2e` for all — what CI runs on each OS. `cargo test --workspace` runs with `--exclude e2e`.
- A journey is `e2e/tests/NN_name.rs`: one `#[test]` of named `step`s, what the person does then what they see. A nominal path goes into the journey it belongs to, as a step; a new file only for a new goal (15 at most). Branches, edge cases and error codes are unit tests'.
Expand Down
2 changes: 1 addition & 1 deletion .claude/skills/devnotes-security-review/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ Checklist on the change (`git diff main...`, and `git diff HEAD` for what is not
6. **Dependencies**: see `dependency-audit` if `Cargo.toml`/`package.json` changed.
7. Report findings by severity with file:line; state what you did not check. Do not auto-fix crypto findings.

Reference: `docs/architecture.md` → "Encryption at rest".
Reference: `docs/architecture/libraries.md` → "Encryption at rest".
4 changes: 2 additions & 2 deletions .claude/skills/egui-ui/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: Use when writing or reviewing the egui interface (crates/ui, crates

# egui UI

Source of truth: `docs/architecture.md` (« Decisions », « Interface (egui) », « Backend and events »,
Source of truth: `docs/architecture/` (« 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 changing it, and its captures.
Expand All @@ -19,7 +19,7 @@ D32): read a screen's component and its SCSS before changing it, and its capture
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 `docs/architecture.md` → "The concurrency rules"; one that is not there does not exist.
rule is in `docs/architecture/backend.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
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 @@ -9,4 +9,4 @@ description: Use when a DevNotes operation feels slow (query_notes, search, boar
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).
5. Report before/after numbers on the same machine; update the table in `docs/architecture.md` → "Benchmarks" only for durable changes.
5. Report before/after numbers on the same machine; update the table in `docs/architecture/testing.md` → "Benchmarks" only for durable changes.
4 changes: 2 additions & 2 deletions .claude/skills/platform-integration/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ description: Use when adding or changing what DevNotes asks of the operating sys

`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 (`docs/architecture.md` → "Decisions"), 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/decisions.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: `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/engine.md` → "The binary, its profile and its window".
6 changes: 3 additions & 3 deletions .claude/skills/rust-guidelines/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,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.
1. `CLAUDE.md`, `.claude/rules/security.md`, `docs/architecture/` and the local skills.
2. These guidelines.

Keep it simple: a guideline is a reason to write less, plainer code, never a licence to add a
Expand All @@ -22,9 +22,9 @@ layer. Apply it to the code you are changing; do not sweep the codebase unasked.

| Guideline | Here |
| --------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| M-ERRORS-CANONICAL-STRUCTS, M-APP-ERROR | Errors stay `AppError { code, params, detail }` with `ErrorCode` (→ "Error contract"); no `anyhow`, no backtraces in answers. |
| M-ERRORS-CANONICAL-STRUCTS, M-APP-ERROR | Errors stay `AppError { code, params, detail }` with `ErrorCode` (→ "Errors are codes"); 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 `docs/architecture.md` lists (« Overview »); a new crate is a decision, not a reflex. |
| M-SMALLER-CRATES | The crates are the ones `docs/architecture/overview.md` lists; 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/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ jobs:

- *stop-the-run

# The showcase site (docs/architecture.md → "The website"): its own project and lockfile. The
# The showcase site (docs/architecture/website.md → "The website"): its own project and lockfile. The
# build fetches the latest release and asks GitHub for every download link.
website:
name: Website
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Website

# devnotes.fr: the site built from `website/` and `docs/content/`, pushed as the whole content of
# one commit to the `main` of `vmillet-dev/devnotes-website`, whose webhook deploys it
# (docs/architecture.md → "The website"). Two things change what it shows: a push to `main` that
# (docs/architecture/website.md → "The website"). Two things change what it shows: a push to `main` that
# touches its sources, and a release, whose files the download page names. The second needs the
# run that follows `Release`: what that workflow pushes with its own token triggers nothing.
on:
Expand Down
8 changes: 4 additions & 4 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# CLAUDE.md

Guidance for Claude Code in this repository. `docs/architecture.md` is the detailed reference (headings quoted as → "Heading"): read the relevant section before a structural change and keep it in sync. Not this file, not the README. The decisions taken for the egui application (D1–D33) are its « Decisions » section; a decision is changed there first, never silently in code.
Guidance for Claude Code in this repository. `docs/architecture/` is the detailed reference, a wiki of pages by area whose home (`README.md` there) says what each page holds; a section is named by its heading after an arrow, unique across the pages, and `scripts/architecture-links.mjs` checks every such name: read the relevant section before a structural change and keep it in sync. Not this file, not the README. The decisions taken for the egui application (D1–D33) are its `decisions.md`; a decision is changed there first, never silently in code.

## Project

Expand Down Expand Up @@ -82,16 +82,16 @@ Principles:

### Behaviours every screen keeps

Read at the `angular-reference` tag; the egui mechanism is in `docs/architecture.md` (→ "Backend and events").
Read at the `angular-reference` tag; the egui mechanism is in `docs/architecture/` (→ "Backend and events").

- Writes are not optimistic: persist, adopt the answer, bump the revision; nothing reloads a view by hand. Time comes from an injectable clock.
- Creating a note writes nothing until worth keeping. Editor drafts are keyed on note id and committed on blur and every closing path. → "Creating a note writes nothing".
- No router: areas, list view and board are state; an area keeps its state when not shown. Area keys are read by physical key (AZERTY). → "No router".
- `null` space = "all spaces". Nothing corpus-wide runs before saying what it touches (count from Rust). Sections are exhaustive and local-day based; search debounce 150 ms; "À trier" ends at `endOfLocalDay`; `pinnedFirst` is the user's choice.
- Every library operation reports through the status notifier, even when nothing changed.
- A card is two layers (→ "A card is two layers"). Every drag is a pointer gesture plus a keyboard twin. The board dims, never narrows; gestures commit on release, snapped to `GRID_PX`, saved debounced. Escape falls through modal → overlay → selection → search → up a folder level. The canvas keyboard is one table (`CANVAS_KEYS`); arrangement is the library's (`devnotes.notes.arrangement`). → "The board: the second view of a space", "Descending into a folder".
- A preference is applied on a button (only theme and density preview before Apply). Global shortcuts are first come, first served, stored under W3C `code` names and recorded as the system hears them (the character typed, the position on macOS). The window starts hidden and is shown when ready; its geometry is remembered without visibility. A silenced update is a version written down (`skippedUpdate`). → "Preferences", "Shortcuts: two vocabularies, two storage paths", "Window geometry".
- Theming: `ui::theme::tokens` (copied from the reference's `styles.scss`; text sizes, gaps and radii are its role scales `font`, `gap`, `radius`, each role defined once), read through `theme::palette(ctx)` / `theme::spacing(ctx)`; no colour, gap, radius, text-size or duration literal elsewhere (held by sweep tests). Dark the base, light with its own amber; text ≥ 4.5:1, held by a Rust test. Accessibility: 24×24 targets, destructive controls red at rest, modals stacked by the rungs of `dialog.model.ts`. → "Theming", "Accessibility", "The modal frame".
- A preference is applied on a button (only theme and density preview before Apply). Global shortcuts are first come, first served, stored under W3C `code` names and recorded as the system hears them (the character typed, the position on macOS). The window starts hidden and is shown when ready; its geometry is remembered without visibility. A silenced update is a version written down (`skippedUpdate`). → "Preferences", "Shortcuts: two vocabularies, two storage paths", "The binary, its profile and its window".
- Theming: `ui::theme::tokens` (copied from the reference's `styles.scss`; text sizes, gaps and radii are its role scales `font`, `gap`, `radius`, each role defined once), read through `theme::palette(ctx)` / `theme::spacing(ctx)`; no colour, gap, radius, text-size or duration literal elsewhere (held by sweep tests). Dark the base, light with its own amber; text ≥ 4.5:1, held by a Rust test. Accessibility: 24×24 targets, destructive controls red at rest, modals stacked by the rungs of `dialog.model.ts`. → "Theming", "Accessibility", "The widget kit".

### Tests

Expand Down
Loading
Loading