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
2 changes: 1 addition & 1 deletion .claude/skills/add-feature/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ description: Use when adding or changing a DevNotes feature end to end (core ser
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`).
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.
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/bug-investigation/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: Use when a DevNotes bug, crash, wrong result or flaky test must be

# Bug investigation

1. Reproduce first, with the smallest input: a failing Rust test, a kittest test or an e2e scenario. No repro → say so and list what is missing.
1. Reproduce first, with the smallest input: a failing Rust test, a kittest test or a step of an e2e journey. No repro → say so and list what is missing.
2. Locate the owner: rules and data are the core (`crates/engine`), display is `crates/ui`. Check `CLAUDE.md` "Things that will bite you" for the matching trap before theorising (the db queue and the lock, `updated_at`, previews vs full body, `Engine::write` and the index, state vs view, the keyboard order, `LibraryCaches`, e2e waits).
3. State the root cause with evidence (file:line, log, failing assertion). Do not fix symptoms or add retries/sleeps.
4. Smallest fix at the owning layer; no unrelated refactors or dependency bumps.
Expand Down
21 changes: 12 additions & 9 deletions .claude/skills/desktop-e2e-testing/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
---
name: desktop-e2e-testing
description: Use when writing, running or debugging an end-to-end scenario of the assembled egui app (e2e/, driven through egui_inspection). Not for screen or widget tests (kittest, egui-ui), nor the website.
description: Use when writing, running or debugging an end-to-end journey of the assembled egui app (e2e/, driven through egui_inspection). Not for screen or widget tests (kittest, egui-ui), nor the website.
---

# 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`, 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`.
- What the protocol cannot reach goes through the flavour's two doors: a global action is `--action <name>` from a second launch; a file dialog answers `DEVNOTES_E2E_DIALOG` (`platform::dialog::from_scenario`). A file dropped from the explorer is not injectable: go through « Joindre ».
- A failure leaves `failure.png` and the application's log in `target/e2e/scenarios/<scenario>/`: read them before changing the scenario, and decide whether the app or the test is wrong. CI uploads the same folder per platform.
- Never point a scenario at a real profile: `--profile` is always a temporary directory. The inspection port has no authentication; the flavour never becomes a release.
`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 thirteen 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'.
- It is written on the SDK (`e2e/src/sdk/`, one file per area) alone: no `author_id`, coordinate or duration. An act it lacks is a method of its area, with a line of doc; an expectation carries the sentence of what the person would see.
- Inside the SDK: `expect` (reads the tree until it holds), `click`, `fill`, `fill_nth` and `replace` (wait for the keyboard), `click_until` (a click the screen can lose), `place` (waits for a control to hold still), `reach` and `scroll_to`. Wait on what the act changes, not on what was already there: the last answer, a toast, a row of the same name. `std::thread::sleep` is refused by `e2e/clippy.toml`.
- Controls are addressed by `author_id`, never by a translated text: the language is the machine's (CI runs in English). A journey that must read a word chooses its language first (`prefs().choose_language`). Missing an id? Give the widget one through `widgets::address` / `widgets::interact`.
- The window is 1440 × 900 at most (`window().widen()`), 1280 wide under CI's Xvfb, 1024 × 768 on Windows after a full screen: call `widen()` again after a presentation, and click what is in view.
- What the protocol cannot reach goes through the flavour's doors: a global action is `--action <name>` from a second launch; a file dialog answers the path `files().answer` wrote; updates come from `App::open_before_an_update`'s server. A file dropped from the explorer is not injectable: go through *Attach*.
- A failure leaves `failure.png` and the application's log in `target/e2e/scenarios/<journey>/`: read them before changing the step, and decide whether the application or the journey is wrong. CI uploads the same folder per platform.
- Never point a journey at a real profile. The inspection port has no authentication; the flavour never becomes a release.
- Lint: `cargo clippy --workspace --all-targets --all-features -- -D warnings`.
2 changes: 1 addition & 1 deletion .claude/skills/verify-change/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Run from the repo root; pick by what changed, and report only what actually ran.
| `scripts/**`, `.github/**` | `node --test "scripts/*.test.mjs"` |
| `docs/content/**` | `npm run docs` from `website/`, `cargo test -p engine docs`, `cargo test -p ui docs_quotes` |
| `website/**` | from `website/`: `npm run lint`, `npm run test:scripts`, `npm test`, `npm run build`, and a look at the built page |
| A user journey, anything the assembled app does | `cargo build -p app --features e2e --target-dir target/e2e`, then `cargo test -p e2e` (or `--test NN_name` for the scenario it touches) (`desktop-e2e-testing`) |
| A user journey, anything the assembled app does | `cargo build -p app --features e2e --target-dir target/e2e`, then `cargo test -p e2e` (or `--test NN_name` for the journey it touches) (`desktop-e2e-testing`) |
| Anything visible | `cargo run -p app -- --profile <temp dir>` and a screenshot, both themes; or the kittest captures: `DEVNOTES_CAPTURES=<dir> cargo test -p ui app::captures` |
| Dependencies | `dependency-audit`; the licence must be in `deny.toml` |

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ jobs:
save-if: 'true'

# The capture needs a rendered window, which xvfb gives; maximising one is a window
# manager's answer (`44_window_controls`), which openbox gives.
# manager's answer (journey 13), which openbox gives.
- name: X server
if: runner.os == 'Linux'
run: sudo apt-get install -y --no-install-recommends xvfb openbox
Expand Down
8 changes: 4 additions & 4 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Principles:
- Cargo workspace: `cargo check|build|test --workspace`, `cargo clippy --workspace --all-targets --all-features -- -D warnings` (⚠️ `--all-features` is what compiles the `e2e` flavour), `cargo fmt --all --check`, `cargo bench -p engine` (not in CI; `autobenches = false` is load-bearing; → "Benchmarks"). Every external dependency is declared once, in the root `[workspace.dependencies]`; a crate takes it with `dep.workspace = true` and adds only its own features (D33). Toolchain pinned in `rust-toolchain.toml`; `unsafe_code` forbidden in every crate (D7), `clippy::pedantic` denied.
- No Node project at the root: the release scripts have no dependency. `node --test "scripts/*.test.mjs"` · `cargo run -p app --example icons` (writes `crates/app/icons/`; ⚠️ small `.ico` sizes come from `icons/source/`) · `node scripts/prettier.mjs` (copies the Prettier it pins into `crates/text/prettier/`, the formatter compiled in). Markdown, JSON and YAML have no formatter. The request-script libraries are bundled by `crates/engine/sandbox/build.mjs`, from that folder's own `package.json`.
- Website (`website/`, Angular, devnotes.fr; its own `package.json`, outside the Cargo workspace): from `website/`, `npm ci` · `npm start` (port 4300) · `npm run build` (fetches the latest release, prerenders to `website/dist/`, checks every page and its download links) · `npm test` · `npm run lint` · `npm run test:scripts`. `website.yml` publishes it when `website/` or `docs/content/` changes on `main`, and after each release. → "The website".
- E2E: `cargo build -p app --features e2e --target-dir target/e2e`, then `cargo test -p e2e` (the driver is `e2e/` at the root; all scenarios, one after the other; `--test 01_first_launch` for one; `cargo test --workspace --exclude e2e` otherwise). `01`–`35` are the WebdriverIO scenarios ported, the rest are this application's own. → "The scenarios, on the assembled window".
- E2E: `cargo build -p app --features e2e --target-dir target/e2e`, then `cargo test -p e2e` (thirteen journeys in `e2e/tests/`, one after the other; `--test 01_first_day` for one; `cargo test --workspace --exclude e2e` otherwise). A journey is written on the SDK (`e2e/src/sdk/`) alone, with no `author_id`, coordinate or duration of its own (`CONTRIBUTING.md`). → "The journeys, on the assembled window".
- Release is a `workflow_dispatch` after a version bump; the version is `[workspace.package] version` in `Cargo.toml` alone (D27), so a bump touches `Cargo.toml` and `Cargo.lock` (`cargo update --workspace`); `scripts/version.mjs` refuses a release where they disagree. `release.yml` runs `prepare` (checks, changelog written, nothing pushed) → `package` (`package.yml`: a job a system, one action a format under `.github/actions/package/`, signed and checked) → `finalize` (commit, tag, atomic push, release page): ⚠️ the irreversible last, so a failed release leaves nothing to undo. `packages.yml` calls `package.yml` on pull requests, then installs and updates. ⚠️ A version branch (`dev/x.y.z`) reaches `main` by a merge commit, never a squash: the release notes read what the merge brings. → "Releasing", `docs/releasing.md`.

## Things that will bite you
Expand Down Expand Up @@ -96,13 +96,13 @@ Read at the `angular-reference` tag; the egui mechanism is in `docs/architecture
### Tests

- State is tested against the real core on a temporary library; only the platform (dialogs, window, clipboard, notifications, clock) is faked, and no fake reimplements a core rule. → "Testing".
- ⚠️ An e2e scenario runs alone on a virgin profile, seeds its own state, waits on conditions (`eventually`), never durations, and addresses controls by `author_id` (the old `data-testid` names). → "One application per run, one run per scenario".
- ⚠️ An e2e journey runs alone on a virgin profile and acts through the SDK, which waits on conditions, never durations, and addresses controls by `author_id` (the old `data-testid` names). → "The journeys, on the assembled window".

## Tickets and pull requests

- **A pull request's title is its changelog entry** (`scripts/release-notes.mjs`), and a ticket's title is where it comes from: both say **what changes, factually and briefly** — `<Area>: <what now happens>`, the area in one or two words (a head of three words or more before `: ` is all the notes keep; ⚠️ never a commit kind — `CI`, `Docs`, `Test`, `Build`, `Fix`, `Security`… is read as a prefix and dropped), then the control, the action, the result; ≤ 70 characters. No figure of speech, no implementation detail, no « of our own ». ✗ « Search the code through a bar of our own » → ✓ « Code editor: new find-and-replace bar with match count and options ».
- **A ticket wears one section label**: `enhancement`, `change`, `bug` or `removal` for what someone using the application sees (the update prompt shows them), `security`, `documentation` for the guides and the README, `website` for the site and its pages (both on the release page alone, never in the application), or `refactor`/`test` for the rest, a fix to the CI or the tests included; a pull request that closes no ticket wears it itself. ⚠️ Without one, the release notes file it under « Under the hood » without a word.
- **A ticket's body opens on its context, then its change**: `**Context** —` what the application does today and where it was seen or who asked; `**Change** —` what will be different, in a sentence or two; then `**To do**` and `**Tests**` (naming the e2e scenario). A milestone's description lists what it changes, plainly.
- **A ticket's body opens on its context, then its change**: `**Context** —` what the application does today and where it was seen or who asked; `**Change** —` what will be different, in a sentence or two; then `**To do**` and `**Tests**` (naming the e2e journey and its step). A milestone's description lists what it changes, plainly.
- **No other software in a title, a description or a milestone**, unless the feature reads, writes or plugs into it (an import format, an extension's host): never a comparison with another product.

## Security and verification
Expand All @@ -113,4 +113,4 @@ Read at the `angular-reference` tag; the egui mechanism is in `docs/architecture

## Claude Code setup

- `.claude/skills/` is versioned. Local: `add-feature`, `egui-ui`, `platform-integration`, `database-migration`, `devnotes-security-review`, `verify-change`, `desktop-e2e-testing` (the `e2e/` driver), `backup-restore`, `bug-investigation`, `release-packaging`, `marketing-site`, `performance-profiling`, `dependency-audit`. Vendored, unmodified and pinned in `.claude/skills/PROVENANCE.md`: `frontend-design`, `webapp-testing` (`anthropics/skills`); `seo`, `core-web-vitals`, `accessibility` (`addyosmani/web-quality-skills`); `rust-guidelines` (`microsoft/rust-guidelines`, its `SKILL.md` ours). A vendored skill is generic: where it disagrees with this file or a local skill, the project wins. `frontend-design`, `webapp-testing`, `seo`, `core-web-vitals` and `accessibility` are for the website. `.claude/settings.json` holds the permission rules that back `.claude/rules/security.md`; `settings.local.json`, `launch.json` and `.mcp.json` stay local.
- `.claude/skills/` is versioned. Local: `add-feature`, `egui-ui`, `platform-integration`, `database-migration`, `devnotes-security-review`, `verify-change`, `desktop-e2e-testing` (the `e2e/` journeys and their SDK), `backup-restore`, `bug-investigation`, `release-packaging`, `marketing-site`, `performance-profiling`, `dependency-audit`. Vendored, unmodified and pinned in `.claude/skills/PROVENANCE.md`: `frontend-design`, `webapp-testing` (`anthropics/skills`); `seo`, `core-web-vitals`, `accessibility` (`addyosmani/web-quality-skills`); `rust-guidelines` (`microsoft/rust-guidelines`, its `SKILL.md` ours). A vendored skill is generic: where it disagrees with this file or a local skill, the project wins. `frontend-design`, `webapp-testing`, `seo`, `core-web-vitals` and `accessibility` are for the website. `.claude/settings.json` holds the permission rules that back `.claude/rules/security.md`; `settings.local.json`, `launch.json` and `.mcp.json` stay local.
Loading
Loading