From a44dc74fc0d9b52c95b1648a70f76fa5478514bb Mon Sep 17 00:00:00 2001 From: Martin Ball <98639962+benandez@users.noreply.github.com> Date: Thu, 26 Nov 2026 00:19:22 +0000 Subject: [PATCH 1/3] #7822: Spec, plan and ADR for closing document windows (#7840) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Agreed rules for every close path (window close, File › Close, quit, one-document hosts, automation), who owns the Save prompt, and the order of work: craft-libs hidden root and test kit, repin, then the WordCraft fix. Adds Document window and Save prompt to the glossary. Co-authored-by: Claude Opus 5.5 --- GLOSSARY.md | 13 ++++++ docs/adr/0001-hidden-root-window.md | 14 +++++++ docs/plans/multi-window-close.md | 38 ++++++++++++++++++ docs/specs/multi-window-close.md | 62 +++++++++++++++++++++++++++++ 4 files changed, 127 insertions(+) create mode 100644 docs/adr/0001-hidden-root-window.md create mode 100644 docs/plans/multi-window-close.md create mode 100644 docs/specs/multi-window-close.md diff --git a/GLOSSARY.md b/GLOSSARY.md index 9d1ec531ed..75607f0737 100644 --- a/GLOSSARY.md +++ b/GLOSSARY.md @@ -66,3 +66,16 @@ _Avoid_: Tofu, box, notdef character A picture the document refers to that the output cannot include: its part is absent, its data cannot be decoded, its format is unsupported, or it is linked from outside the file. _Avoid_: Broken image, dropped image + +## Windows + +**Document window**: +A top-level window showing one open document. A document can be shown in several document windows +at once (View › New Window); each window shows exactly one. +_Avoid_: Viewport (that is the framework's surface), root window, tab + +**Save prompt**: +The question "Save changes?" asked when the last document window showing a document with unsaved +changes is about to close. It belongs to that window and appears there; while it is up, the other +windows wait. +_Avoid_: Close guard, save dialog, unsaved-changes dialog diff --git a/docs/adr/0001-hidden-root-window.md b/docs/adr/0001-hidden-root-window.md new file mode 100644 index 0000000000..589e3e8271 --- /dev/null +++ b/docs/adr/0001-hidden-root-window.md @@ -0,0 +1,14 @@ +# The root window hides instead of taking over another document + +The first window an app opens is the framework's root window, and the app ends when it closes. WordCraft +used to keep it open when the user closed it with other document windows open: it switched to another +window's document and that window disappeared, so the window the user closed stayed and a different one +vanished (#7752). We decided instead that the root window hides (storytold/craft-libs#584) and adopts +nothing, so the window the user closes is always the one that goes, and the app ends only when the last +document window closes or the user quits. + +## Considered options + +- **Root takes over another document** (the old behaviour): no framework change, but it is the reported bug, + and the moved window loses its position and size. +- **Root shows no document and stays visible**: leaves an empty window the user did not ask for. diff --git a/docs/plans/multi-window-close.md b/docs/plans/multi-window-close.md new file mode 100644 index 0000000000..911525bee2 --- /dev/null +++ b/docs/plans/multi-window-close.md @@ -0,0 +1,38 @@ +# Implementation plan: closing document windows + +For [the specification](../specs/multi-window-close.md) (#7822, part of #7671). Steps run in order; each is +its own PR. + +## 1. craft-libs prerequisites (base `next`) + +- **Hidden root window** (storytold/craft-libs#584, [ADR 0001](../adr/0001-hidden-root-window.md)): the root + OS window can close or hide while document windows stay open, and adopts nothing. +- **Test kit with any number of windows** (C5-8): `craft_ui_test_kit::windows::Windows` keeps focus and close + events per child, so three-window tests can target one child. +- Not in scope: the cursor on non-root windows (C5-5, `cursor::image_target`) gets its own issue. + +## 2. Repin craft-libs in WordCraft + +Brings storytold/craft-libs#3290 (one modal stack across windows) and the two changes above. Stage 3 of +#7671 does this repin. + +## 3. WordCraft PR (Fixes #7822) + +Code is in `crates/ui-egui/src/` unless noted. + +| Spec rule | Change | +|---|---| +| 1 | Drop the root taking over another document (`settle_windows` in `windows.rs`); closing the root window closes it through step 1's hidden root. Rewrite `closing_a_window_asks_first_and_the_root_adopts_another`. | +| 2 | `other_window_on_document` filters windows by document (C5-6). | +| 3, 9 | `app::Closing` records the window that owns the prompt. Pumping, cancelling and closing the prompt use that window's dialog host, not the active one. | +| 4, 9 | `run` and `close_decision` check `closing` first: a close while one is running raises the prompt and returns, never calls `begin_closing` again. | +| 9 | Clearing `closing.prompt` in `sync_document` and `apply_close_answer` either continues the close or ends it, so no `Hold` is left with no prompt. `apply_close_answer` matches the guard's document, not the active one. | +| 5 | Cancelling Save As during a close cancels the close or quit (`continue_after_save`). | +| 7 | On one-document-at-a-time hosts, the root close acts on the active entry, not `root_key()`; the fallback layer keeps its close button (C5-1..3). | +| 8 | `file.close` takes `save`; `close_refused` names both options. `ui.closeWindow` takes `window` and defaults to `active_viewport()` (`control/handler.rs`). Update `docs/control-protocol.md` and `docs/mcp.md`. | +| — | `queue_for_window` repaints the target window (C5-7). | + +Tests: the table in the specification, in `windows/tests.rs` and `documents.rs`. + +Checks: `cargo fmt --all --check`, `cargo clippy -p wordcraft-ui-egui --all-targets -- -D warnings`, +`cargo test -p wordcraft-ui-egui`, `cargo xtask layers`, `cargo xtask wasm`. diff --git a/docs/specs/multi-window-close.md b/docs/specs/multi-window-close.md new file mode 100644 index 0000000000..65a968ccd0 --- /dev/null +++ b/docs/specs/multi-window-close.md @@ -0,0 +1,62 @@ +# Closing document windows + +Specification for #7822 (part of #7671). Terms are defined in [GLOSSARY.md](../../GLOSSARY.md): **Document +window**, **Save prompt**. The decision on the root window is [ADR 0001](../adr/0001-hidden-root-window.md). + +## Rules + +1. **A close acts on what its window shows.** Closing a document window (its ✕, the OS close, Ctrl+W or + Ctrl+F4, File › Close) acts only on the document that window shows. No other window changes what it + shows, and no other window disappears. This holds for the first window opened too. +2. **Another window on the same document.** When another document window still shows the document, the + window closes without a Save prompt. The Save prompt is asked only when the last window showing a + document with unsaved changes closes. +3. **The Save prompt belongs to its window.** It appears in the window being closed. While it is up, the + other windows wait; clicking one of them brings the prompt to the front. Its answer is taken from it + whichever window is active. +4. **One close at a time.** A second close request made while a Save prompt is up brings that prompt to the + front and is otherwise ignored, not queued. +5. **Answers.** + - Save: the document is saved, then the window closes. + - Don't Save: the window closes without saving. + - Cancel: nothing closes. + - Save on a never-saved document opens Save As; cancelling Save As cancels the whole close (or quit). +6. **Quit.** Quit asks about each document with unsaved changes in turn, in a window showing it. Save and + Don't Save move to the next; Cancel stops the quit and leaves every remaining window as it was. +7. **One document at a time.** On a host that draws one document at a time (the web app, a full-screen + window, a maximized window on Wayland), ✕, Ctrl+W and File › Close act on the document on screen, and + the most recently used other document is shown next. +8. **Automation follows the same rules.** Over the control channel and MCP: + - `file.close` on a document with unsaved changes needs `save: true` (save, then close) or `force: true` + (close without saving). With neither it closes nothing and returns "unsaved changes: pass save or force". + A close that rule 2 lets through needs neither. + - `ui.closeWindow` takes an optional `window` id and otherwise closes the active window, never the root. + - Automation never leaves a Save prompt waiting for an answer nobody will give. +9. **Nothing gets stuck.** After any answer, cancel, or the prompt's window closing, the app accepts the + next close or quit. In particular: + - a second close cannot replace the first and leave its prompt on screen unanswered; + - clearing the prompt always ends or continues the close, never leaves it half-done; + - cancelling the prompt works whichever window is active; + - an answer given while another window is active is still read; + - an answer over the control channel from another window does not cancel the close. + +## Tests + +One test per rule and per stuck path; unit tests under 100 ms, app-harness tests under 1 s (#7671). + +| Test | Rule | +|---|---| +| Closing the first window of three leaves the other two showing their own documents | 1 | +| Closing a middle window of three closes only its document | 1 | +| ✕ on one of two windows on a modified document asks nothing | 2 | +| ✕ on the last window of a modified document asks, in that window | 2, 3 | +| Clicking another window while the prompt is up raises the prompt | 3 | +| Answering the prompt while another window is active is read | 3, 9 | +| Ctrl+W and ✕ while a prompt is up leave one prompt, and its answer is read | 4, 9 | +| Save, Don't Save and Cancel each do what rule 5 says | 5 | +| Cancelling Save As cancels the close and the quit | 5, 6 | +| Quit with three modified documents asks three times; Cancel on the second keeps two | 6 | +| One-at-a-time host: ✕ closes the document on screen and shows the last used other one | 7 | +| `file.close` without `save`/`force` refuses; with each, saves or discards | 8 | +| `ui.closeWindow` closes the active window, or the one named by `window` | 8 | +| After each of the five stuck paths, a following close and quit both succeed | 9 | From 765abcc790bc7d851ddab377e1ca656dbee77b03 Mon Sep 17 00:00:00 2001 From: skylar taylor-barrick Date: Wed, 25 Nov 2026 19:52:59 -0600 Subject: [PATCH 2/3] Switch on supervised nightlies on the nightly-signer branch (#7839) Supervised nightly switch-on, merged under Skylar's explicit Nightly 758 override after green CI, CodeRabbit on this head with no open threads, Sonar passing, and an independent adversarial review with no blockers. --- .github/nightly-signing-policy.json | 10 +- .github/workflows/nightly-dispatch.yml | 72 ++++++ .github/workflows/nightly-sign.yml | 17 +- .github/workflows/nightly.yml | 8 +- docs/nightly-release-preparation.md | 104 +++++--- docs/releasing.md | 6 + packaging/nightly-release-tests.py | 343 ++++++++++++++++++++++++- 7 files changed, 509 insertions(+), 51 deletions(-) create mode 100644 .github/workflows/nightly-dispatch.yml diff --git a/.github/nightly-signing-policy.json b/.github/nightly-signing-policy.json index 8528aa8c28..6f8c47ef56 100644 --- a/.github/nightly-signing-policy.json +++ b/.github/nightly-signing-policy.json @@ -2,13 +2,13 @@ "schema": "craft-nightly-release-policy/v3", "repository": "storytold/wordcraft", "repository_id": 1408489772, - "producer_workflow_id": null, + "producer_workflow_id": 429734489, "producer_workflow_path": ".github/workflows/nightly.yml", - "producer_tooling_revision": "605d58766e8f536564da8fc81d3676ac86816dea", - "producer_workflow_ref": "storytold/craft-common-actions/.github/workflows/nightly-unsigned.yml@605d58766e8f536564da8fc81d3676ac86816dea", + "producer_tooling_revision": "be00e5ccd18b68e950c8a08532f2230e7c3d0cba", + "producer_workflow_ref": "storytold/craft-common-actions/.github/workflows/nightly-unsigned.yml@be00e5ccd18b68e950c8a08532f2230e7c3d0cba", "signer_workflow_path": ".github/workflows/nightly-sign.yml", - "signer_tooling_revision": "605d58766e8f536564da8fc81d3676ac86816dea", - "release_branch": "release", + "signer_tooling_revision": "be00e5ccd18b68e950c8a08532f2230e7c3d0cba", + "release_branch": "nightly-signer", "manual_actors": [ "bflatastic", "dylanmtaylor", diff --git a/.github/workflows/nightly-dispatch.yml b/.github/workflows/nightly-dispatch.yml new file mode 100644 index 0000000000..4444c7110b --- /dev/null +++ b/.github/workflows/nightly-dispatch.yml @@ -0,0 +1,72 @@ +name: Dispatch release-ref nightly + +# Transport only, never authorization. No checkout, payload parsing or release environment. +on: + workflow_run: + workflows: [WordCraft unsigned nightly] + types: [completed] + branches: [main] + +permissions: {} + +jobs: + dispatch: + # SOURCE PREPARATION: literal off until immutable shared tooling and policy qualification. + if: >- + false && github.repository == 'storytold/wordcraft' && + github.event_name == 'workflow_run' + runs-on: ubuntu-latest + timeout-minutes: 5 + permissions: + actions: write + steps: + - name: Dispatch only the exact completed producer run and attempt + shell: python + env: + GH_TOKEN: ${{ github.token }} + run: | + import json + import os + import urllib.request + + def require(value, message): + if not value: + raise RuntimeError(message) + + # These filters reduce noise; the protected signer-branch validator repeats admission + # against authenticated API metadata and required attestation/quality evidence. + require(os.environ.get('GITHUB_REPOSITORY') == 'storytold/wordcraft', 'wrong repository') + require(os.environ.get('GITHUB_EVENT_NAME') == 'workflow_run', 'wrong event') + with open(os.environ['GITHUB_EVENT_PATH'], encoding='utf-8') as stream: + event = json.load(stream) + require(event.get('action') == 'completed', 'producer is not complete') + require(event.get('repository', {}).get('full_name') == 'storytold/wordcraft', 'wrong event repository') + producer = event.get('workflow_run', {}) + require(producer.get('head_repository', {}).get('full_name') == 'storytold/wordcraft', 'foreign producer') + require(producer.get('path') == '.github/workflows/nightly.yml', 'wrong producer path') + require(producer.get('head_branch') == 'main', 'wrong producer branch') + require(producer.get('status') == 'completed' and producer.get('conclusion') == 'success', 'producer did not succeed') + # First scheduled attempt only; reviewed manual/re-run authority belongs to release policy. + require(producer.get('event') == 'schedule', 'not an automatic scheduled producer') + run_id, attempt = producer.get('id'), producer.get('run_attempt') + require(type(run_id) is int and run_id > 0, 'invalid producer run id') + require(type(attempt) is int and attempt == 1, 'invalid automatic producer attempt') + body = json.dumps({'ref': 'refs/heads/nightly-signer', 'inputs': { + 'producer_run_id': str(run_id), 'producer_run_attempt': str(attempt) + }}).encode('utf-8') + request = urllib.request.Request( + 'https://api.github.com/repos/storytold/wordcraft/actions/workflows/nightly-sign.yml/dispatches', + data=body, method='POST', headers={ + 'Authorization': 'Bearer ' + os.environ['GH_TOKEN'], + 'Accept': 'application/vnd.github+json', + 'Content-Type': 'application/json', + 'X-GitHub-Api-Version': '2022-11-28', + 'User-Agent': 'wordcraft-nightly-dispatch' + }) + class NoRedirect(urllib.request.HTTPRedirectHandler): + def redirect_request(self, req, fp, code, msg, headers, newurl): + raise RuntimeError('dispatch redirects are forbidden') + # One bounded request, no retry: duplicate transport is not publication authority. + with urllib.request.build_opener(NoRedirect()).open(request, timeout=20) as response: + require(response.status == 204, 'dispatch was not accepted') + print('Dispatched producer run/attempt to the release-ref validator; not a signing result.') diff --git a/.github/workflows/nightly-sign.yml b/.github/workflows/nightly-sign.yml index e2713f4d9a..d015dcf9e6 100644 --- a/.github/workflows/nightly-sign.yml +++ b/.github/workflows/nightly-sign.yml @@ -1,7 +1,8 @@ name: WordCraft release-ref nightly signer -# Enabled for supervised manual dispatch on release. Main/release contents must match. -# A reusable callee does not change context; this must be a real top-level release dispatch. +# Enabled for supervised manual dispatch on the dedicated nightly-signer branch, which only ever +# fast-forwards to reviewed main commits (never the stable release branch). +# A reusable callee does not change context; this must be a real top-level signer-branch dispatch. on: workflow_dispatch: inputs: @@ -22,21 +23,23 @@ concurrency: jobs: release: - # Actual context guards: official repository, manual dispatch, real release branch. + # Actual context guards: official repository, manual dispatch, real nightly-signer branch. if: >- github.repository == 'storytold/wordcraft' && github.event_name == 'workflow_dispatch' && - github.ref == 'refs/heads/release' && github.ref_type == 'branch' + github.ref == 'refs/heads/nightly-signer' && github.ref_type == 'branch' permissions: contents: write actions: read checks: read attestations: write id-token: write - uses: storytold/craft-common-actions/.github/workflows/nightly-release.yml@605d58766e8f536564da8fc81d3676ac86816dea + uses: storytold/craft-common-actions/.github/workflows/nightly-release.yml@be00e5ccd18b68e950c8a08532f2230e7c3d0cba with: - tooling-revision: 605d58766e8f536564da8fc81d3676ac86816dea + tooling-revision: be00e5ccd18b68e950c8a08532f2230e7c3d0cba + app-name: wordcraft producer_run_id: ${{ inputs.producer_run_id }} producer_run_attempt: ${{ inputs.producer_run_attempt }} # No secrets: inherit or raw platform values in this caller. Only the isolated native - # callee job may bind the existing release environment and export keys in its signing step. + # callee job may bind the existing release environment (which trusts release and + # nightly-signer) and export keys in its signing step. diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 3655418a90..64dc5098bd 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -22,13 +22,13 @@ jobs: actions: read attestations: write id-token: write - uses: storytold/craft-common-actions/.github/workflows/nightly-unsigned.yml@605d58766e8f536564da8fc81d3676ac86816dea + uses: storytold/craft-common-actions/.github/workflows/nightly-unsigned.yml@be00e5ccd18b68e950c8a08532f2230e7c3d0cba with: - tooling-revision: 605d58766e8f536564da8fc81d3676ac86816dea + tooling-revision: be00e5ccd18b68e950c8a08532f2230e7c3d0cba app-name: wordcraft manual-actors: '["bflatastic","dylanmtaylor","echelon","FredApps","skylartaylor"]' craft-fonts-ref: b076417b5880bd4154bd22f00695b1d28c6bea83 # One producer run builds every listed platform for one all-or-nothing release. The pin is the - # craft-common-actions main commit that merged #339 (bounded lineage compares), on top of the - # Linux/macOS signer (#342). + # craft-common-actions main commit that merged the exact-analysis admission (#371, after #370, + # #369 and #364). platforms: '["windows-x86_64","linux-x86_64","macos-aarch64"]' diff --git a/docs/nightly-release-preparation.md b/docs/nightly-release-preparation.md index 08d008f32a..5b2e6e6745 100644 --- a/docs/nightly-release-preparation.md +++ b/docs/nightly-release-preparation.md @@ -1,11 +1,12 @@ # Windows, Linux and macOS release-ref nightly: supervised manual go-live -**Enabled for supervised manual runs, not yet qualified.** The producer (`nightly.yml`, main) and the -signer (`nightly-sign.yml`, release) keep only their exact context guards and run when one of the reviewed -manual actors dispatches them. There is no schedule yet. The installed policy +**Enabled for supervised manual runs, not yet qualified.** The producer (`nightly.yml`, main) and +the signer (`nightly-sign.yml`, on the dedicated `nightly-signer` branch) keep only their exact +context guards and run when one of the reviewed manual actors dispatches them. +`nightly-dispatch.yml` stays literally off: it only forwards scheduled producers. There is no +schedule. The installed policy [`.github/nightly-signing-policy.json`](../.github/nightly-signing-policy.json) is the v3 policy. -Once `nightly.yml` lands on `main`, populate `producer_workflow_id` before promoting the policy to -`release` by reading: +Its `producer_workflow_id` is the registration of `nightly.yml` on main, read with: ```bash gh api repos/storytold/wordcraft/actions/workflows/nightly.yml --jq .id @@ -14,31 +15,57 @@ gh api repos/storytold/wordcraft/actions/workflows/nightly.yml --jq .id The callers pass no platform secrets. The unsigned reusable caller's maximum OIDC/attestation permissions are for its isolated attester; its compiler narrows to contents and Actions read only, with no OIDC, attestation write, release environment or platform signing secrets. -Shared tooling is pinned to `605d58766e8f536564da8fc81d3676ac86816dea`, the craft-common-actions -main commit that merged [#339](https://github.com/storytold/craft-common-actions/pull/339) (bounded -lineage compares and an issue reread at the end of candidate admission) on top of -[#342](https://github.com/storytold/craft-common-actions/pull/342) (policy v3, the `platforms` input -and the Linux and macOS legs). Both callers name it in `uses` and `tooling-revision`. A pin is reviewed -source availability, not provider, queue, native signing or crypto qualification. -Existing stable workflows are unchanged. +Shared tooling is pinned to `be00e5ccd18b68e950c8a08532f2230e7c3d0cba`, the craft-common-actions +main commit that merged [#371](https://github.com/storytold/craft-common-actions/pull/371) (the +candidate is admitted on the built commit's own Sonar analysis, not main's latest) after +[#370](https://github.com/storytold/craft-common-actions/pull/370) (the Windows and macOS nightly +registry rows for the 14 apps) and +[#369](https://github.com/storytold/craft-common-actions/pull/369) (shared helper checkouts kept out +of the app's clean-source check, and macOS on `macos-15`), following +[#364](https://github.com/storytold/craft-common-actions/pull/364) (the signer may run on the +policy's signer branch) and [#363](https://github.com/storytold/craft-common-actions/pull/363) (the +multi-app pipeline, which makes the signer's `app-name` input required and admits any reviewed +registry app), with #342 (`a4f6fd51`, policy v3 and the `platforms` input) and #339 (`605d5876`) +earlier. Both callers name it in `uses` and `tooling-revision`. A pin is reviewed source +availability, not provider, queue, native signing or crypto qualification. -**The shared-workflow port is a prerequisite.** At this pin both reusable workflows admit only -PhotoCraft: `nightly-unsigned.yml` requires `inputs.app-name == 'photocraft'` and -`github.repository == 'storytold/photocraft'` on its build jobs, and `nightly-release.yml` requires the -same repository in `validate` and every signing job (its concurrency group is -`craft-release-ref-signer-photocraft`). A WordCraft dispatch therefore builds and signs nothing until -`storytold/craft-common-actions` admits `storytold/wordcraft`. No dispatch can produce a release before -that port, and both callers' `uses`, `tooling-revision` and the policy pins must move to the same -reviewed revision together. The port is craft-common-actions #363 ("run the shared nightly pipeline for any -reviewed registry app"); until it merges these callers are inert. +**Registry admission.** Craft-common-actions #363 ("run the shared nightly pipeline for any reviewed +registry app") is in the pin, and `nightly-apps.json` admits `storytold/wordcraft`. Both callers' +`uses`, `tooling-revision` and the policy pins move together to the same reviewed revision. The +signer also requires the policy's `platforms` map to equal the app's admitted targets, so +WordCraft's `windows-x86_64` and `macos-aarch64` rows need the targets and entrypoints that a +craft-common-actions follow-up adds; until it merges, the first signer run stops at admission. **First runs.** The first runs are manual dispatches in this order: `nightly.yml` on main (only a -listed manual actor passes the producer's plan step), then `nightly-sign.yml` on `release` with that -producer run ID and attempt, by a listed manual actor. +listed manual actor passes the producer's plan step), then `nightly-sign.yml` on `nightly-signer` +with that producer run ID and attempt, by a listed manual actor. `nightly-dispatch.yml` only matters +once a schedule is approved. + +**Signer branch.** The signer runs on `refs/heads/nightly-signer`, not on the stable `release` +branch, so nightly signer files never need a stable release sync. The policy's `release_branch` +names it, the signer's guard requires it and the dispatcher targets it. The branch only +fast-forwards to reviewed main commits, through the settings script's `advance` (no queued signer +run, a trust-closure scan, then the full diff of `.github/` and `packaging/`), and the existing +`release` environment trusts it alongside `release`. Its trust closure is all of `.github/` and +`packaging/`, including `packaging/env.sh`, which `packaging/macos/import-cert.sh` sources with +the Apple keys. On that branch only the pinned `nightly-sign.yml` caller may reach an environment: +no app workflow binds one, nothing else calls `nightly-release.yml`, and the only caller of the +shared stable `release.yml` is `release.yml`, whose callee must carry the stable-only environment +guard. The contract tests check the in-repo part on every main PR; the settings scan also resolves +the callee. Stable releases still come only from `refs/heads/release`. History does not carry over +a switch between `release` and `nightly-signer`, so the switch happens before the first +publication. + +**Registry admission.** The signer requires the protected policy's `platforms` map to equal the +run app's admitted targets in craft-common-actions' `nightly-apps.json`, and it refuses rather +than sign a subset. WordCraft's row admits `linux-x86_64`; the matching `windows-x86_64` and +`macos-aarch64` targets and entrypoints are a craft-common-actions follow-up, and the first +signer run stops at admission until they merge. **Manual actors.** `bflatastic`, `dylanmtaylor`, `echelon`, `FredApps` and `skylartaylor`, in the producer's `manual-actors` and the policy's `manual_actors`. The list mirrors the release-managers -team (id 19837241), leaving out `echelon-robot`; update it by PR in both places when the team changes. +team (id 19837241), leaving out `echelon-robot`; update it by PR in both places when the team +changes. **Admission timing.** The candidate check reads the newest CI run on the candidate commit and main's latest finished Sonar analysis, so pick a quiet main, wait for its CI and SonarCloud analysis @@ -48,41 +75,45 @@ push lands a newer analysis. **Platform rows.** The producer caller lists `platforms: '["windows-x86_64","linux-x86_64","macos-aarch64"]'` on its single job: one producer run builds every listed platform for one all-or-nothing release (one failed or skipped platform stops -that night's release), and the release-ref signer admits platforms only from the protected policy, so +that night's release), and the signer admits platforms only from the protected policy, so there is no separate Linux or macOS caller job and the signer caller has no platform input. ## Installed policy values and their sources Read on 2026-11-24; re-read anything that may have moved (and fill in `producer_workflow_id` after -`nightly.yml` lands on `main`) before the policy is promoted to `release`. +`nightly.yml` lands on `main`) before `nightly-signer` is advanced to it. | Field | Value | Source | |---|---|---| | `repository_id` | `1408489772` | `gh api repos/storytold/wordcraft --jq .id` | -| `producer_workflow_id` | `null` (pending `main` registration) | Read via `gh api repos/storytold/wordcraft/actions/workflows/nightly.yml --jq .id` once `nightly.yml` reaches `main` | -| `producer_tooling_revision`, `signer_tooling_revision`, `producer_workflow_ref` | `605d5876…` (craft-common-actions #339) | The callers' pin | +| `producer_workflow_id` | `429734489` | `gh api repos/storytold/wordcraft/actions/workflows/nightly.yml --jq .id` | +| `producer_tooling_revision`, `signer_tooling_revision`, `producer_workflow_ref` | `be00e5cc…` (craft-common-actions #371 after #370, #369 and #364) | The callers' pin | | `manual_actors` / `automatic_signer_actors` | the five release managers / `[]` | release-managers team (id 19837241) members; equals the producer caller's `manual-actors` | | `max_age_seconds`, `max_artifact_bytes` | `86400`, `2147483648` | Go-live checklist | | `platforms` | three rows | Storytold stable signing identities (Windows Authenticode subject, Linux OpenPGP fingerprint, macOS Apple Team ID `DJ6XS33FX8`) | | `candidate_policy.required_workflows` | CI (`ci.yml`, workflow `380135788`), `gate / gate (ubuntu-24.04)` | Workflow list API; always-run main push gate job | | `candidate_policy.sonar` | `storytold` / `storytold_wordcraft`, app `12526` | `sonar-project.properties` | | Sonar conditions | `new_security_rating` accepted (max 5); the other five required | Standard Storytold SonarCloud quality gate | -| Sonar `issue_types` / `debt` | `VULNERABILITY`; `[]` | Refresh from SonarCloud before promoting policy to `release` | +| Sonar `issue_types` / `debt` | `VULNERABILITY`; `[]` | Refresh from SonarCloud before `nightly-signer` is advanced to it | The candidate check refuses whenever main's unresolved vulnerability set differs from `debt`, whether an issue is new or fixed, and whenever a required condition fails or a listed CI job is renamed. Refresh -those values in the same reviewed change that promotes the policy to `release`. +those values in the same reviewed change that `nightly-signer` is then advanced to. ## Ownership and interface - `.github/workflows/nightly.yml`: default-main registration of the unsigned producer, named `WordCraft unsigned nightly`, enabled for manual dispatch by `manual-actors`; no signing secrets may be passed or inherited. -- `.github/workflows/nightly-sign.yml`: top-level release registration, enabled for manual dispatch, - and identical on main and release after reviewed promotion. It rejects wrong repository/event/actual +- `.github/workflows/nightly-sign.yml`: top-level registration on `nightly-signer`, enabled for manual dispatch, + and only ever fast-forwards to reviewed main commits. It rejects wrong repository/event/actual branch, including same-name tags. Its constant whole-run concurrency (`wordcraft-nightly-release`, `queue: max`, `cancel-in-progress: false`) is distinct from stable. The caller itself passes no - credentials; only the shared callee's sign jobs bind the `release` environment. + credentials; only the shared callee's sign jobs bind the `release` environment, which trusts `release` and + `nightly-signer`. +- `.github/workflows/nightly-dispatch.yml`: transport only, never authorization. It is literally + off (`false &&`) and forwards only a first-attempt scheduled producer to `nightly-sign.yml` on + `nightly-signer`. No schedule is registered until activation is reviewed. - Shared reusable entrypoints are `nightly-unsigned.yml` and `nightly-release.yml` in `storytold/craft-common-actions`. Both must resolve to a **real reviewed public immutable commit**; the defining workflow SHA and tooling input must match. @@ -101,3 +132,10 @@ those values in the same reviewed change that promotes the policy to `release`. identical and equal to the reviewed release managers list, with `automatic_signer_actors` empty. - `.github/nightly-signing-policy.json` matches the `craft-nightly-release-policy/v3` schema, repository identity, platform trust anchors, CI workflow trigger, and `sonar-project.properties`. +- The signer guards `refs/heads/nightly-signer`, passes `app-name: wordcraft`, and the policy's + `release_branch` names it. +- A trust-closure scan reads every workflow: nothing binds an `environment`, only `nightly-sign.yml` + calls `nightly-release.yml` (at a full SHA), and the only caller of the shared stable `release.yml` + is `release.yml`. +- `nightly-dispatch.yml` keeps a literal-off guard, a `workflow_run`-only trigger and a + `refs/heads/nightly-signer` request. diff --git a/docs/releasing.md b/docs/releasing.md index 30dfdc0ae8..ef8a3ec327 100644 --- a/docs/releasing.md +++ b/docs/releasing.md @@ -22,6 +22,12 @@ synced from the release manager's machine. On the release branch, the shared wor macOS and Windows jobs if their signing credentials are missing. Local packaging can still produce unsigned builds with a warning. +The supervised nightly signer does not sign from `release`: it runs on `refs/heads/nightly-signer`, +which only ever fast-forwards to reviewed main commits, and the `release` environment trusts both +branches. Everything that can reach it is the trust closure: all of `.github/` and `packaging/`, +including `packaging/env.sh`, which `packaging/macos/import-cert.sh` sources with the Apple keys. +Stable releases still come only from `refs/heads/release`. + Local packaging: `packaging/macos/package.sh --arch universal`, `packaging/windows/package.ps1`, `packaging/linux/package.sh` (then `packaging/linux/flatpak-bundle.sh` for the Flatpak), `packaging/web/package.sh`. diff --git a/packaging/nightly-release-tests.py b/packaging/nightly-release-tests.py index fe5f308d3f..157e604fb0 100755 --- a/packaging/nightly-release-tests.py +++ b/packaging/nightly-release-tests.py @@ -9,6 +9,9 @@ import unittest ROOT = Path(__file__).resolve().parents[1] INSTALLED_POLICY = ROOT / ".github/nightly-signing-policy.json" +APP_NAME = "wordcraft" +PRODUCER_WORKFLOW_NAME = "WordCraft unsigned nightly" + def assert_nightly_serialization(source): """Fail closed unless this app's plain root concurrency block retains its contract. @@ -272,7 +275,7 @@ class NightlyEnabledCallers(unittest.TestCase): "github.ref_type == 'branch' && (github.event_name == 'schedule' || " "github.event_name == 'workflow_dispatch')", "nightly-sign.yml": "github.repository == 'storytold/wordcraft' && github.event_name == 'workflow_dispatch' && " - "github.ref == 'refs/heads/release' && github.ref_type == 'branch'", + "github.ref == 'refs/heads/nightly-signer' && github.ref_type == 'branch'", } def test_enabled_jobs_keep_exact_context_guards(self): @@ -329,7 +332,8 @@ class NightlyInstalledPolicy(unittest.TestCase): self.assertEqual(set(self.policy), self.EXPECTED_KEYS) self.assertEqual(self.policy["schema"], "craft-nightly-release-policy/v3") self.assertEqual(self.policy["repository"], "storytold/wordcraft") - self.assertEqual(self.policy["release_branch"], "release") + self.assertEqual(self.policy["release_branch"], SIGNER_BRANCH, + "the signer runs on its dedicated branch") self.assertIs(type(self.policy["repository_id"]), int) self.assertGreater(self.policy["repository_id"], 0) # producer_workflow_id is null until nightly.yml is registered on main, then a positive int. @@ -408,6 +412,341 @@ class NightlyInstalledPolicy(unittest.TestCase): self.assertIn(item["type"], sonar["issue_types"]) self.assertRegex(item["hash"], r"^[0-9a-f]{32}$") + def test_sonar_policy_keeps_the_shared_candidate_contract(self): + """The Sonar shape craft-common-actions' candidate contract() admits, refused here first. + + An empty issue scope, an accepted condition outside the reviewed issue types, a metric in both + lists, a missing live gate condition or a widened security bound is refused at admission, so + this suite must catch it before a nightly run can. `debt` stays empty, so any unresolved + vulnerability on main is still refused; accepting the new-code rating only records the + reviewed A threshold instead of demanding a clean rating the live gate does not. + """ + sonar = self.policy["candidate_policy"]["sonar"] + accepted = {"bugs": "BUG", "vulnerabilities": "VULNERABILITY", "code_smells": "CODE_SMELL", + "security_rating": "VULNERABILITY", "new_security_rating": "VULNERABILITY"} + gate = {"new_reliability_rating", "new_security_rating", "new_maintainability_rating", + "new_coverage", "new_duplicated_lines_density", "new_security_hotspots_reviewed"} + self.assertTrue(sonar["issue_types"], "an empty issue scope is refused as unreviewed") + self.assertEqual(len(sonar["issue_types"]), len(set(sonar["issue_types"]))) + metrics = {} + for field in ("accepted_conditions", "required_conditions"): + for condition in sonar[field]: + with self.subTest(field=field, metric=condition.get("metric")): + expected = {"metric", "comparator", "error_threshold"} + if field == "accepted_conditions": + expected.add("maximum") + self.assertEqual(set(condition), expected) + self.assertNotIn(condition["metric"], metrics, "one condition per gate metric") + metrics[condition["metric"]] = condition + self.assertIn(condition["comparator"], ("GT", "LT")) + self.assertRegex(condition["error_threshold"], r"^(?:0|[1-9][0-9]*)(?:\.[0-9]+)?$") + if field != "accepted_conditions": + continue + self.assertIn(condition["metric"], accepted, "an accepted metric outside the reviewed map") + self.assertIn(accepted[condition["metric"]], sonar["issue_types"], + "an accepted failure must lie inside the reviewed issue scope") + self.assertEqual(condition["comparator"], "GT") + self.assertRegex(condition["maximum"], r"^(?:0|[1-9][0-9]*)(?:\.[0-9]+)?$") + maximum = float(condition["maximum"]) + if condition["metric"] in ("security_rating", "new_security_rating"): + self.assertEqual(int(maximum), maximum, "the A..E bound is a whole rating") + self.assertTrue(1 <= maximum <= 5, "the security bound stays A..E") + self.assertEqual(condition["error_threshold"], "1", "the reviewed A threshold stays") + else: + self.assertLessEqual(maximum, len(sonar["debt"]), "accepted failures exceed the reviewed debt") + self.assertEqual({accepted[c["metric"]] for c in sonar["accepted_conditions"]}, set(sonar["issue_types"]), + "accepted conditions and reviewed issue types must cover the same scope") + self.assertEqual(set(metrics), gate, "every live gate condition stays gated exactly once") + + +SIGNER_BRANCH = "nightly-signer" +SHARED = "storytold/craft-common-actions/.github/workflows/" +# App workflows reviewed to call the shared stable release.yml. That callee must carry the +# stable-only environment guard (dry runs and non-release refs bind no environment); the +# nightly-signer settings scan checks the resolved callee before creating or advancing the branch. +REVIEWED_STABLE_RELEASE_CALLERS = {"release.yml"} + + +def app_workflows(): + return {path.name: path.read_text() for path in sorted((ROOT / ".github/workflows").glob("*.y*ml"))} + + +WORKFLOW_KEY = re.compile(r'''("(?:[^"\\]|\\.)*"|'(?:[^']|'')*'|[^\s'"#{}\[\],:&*!|>%@`?-][^:#,{}]*?|-[^\s:#][^:#,{}]*?)\s*:(?:\s+(.*))?$''') + + +def _workflow_key(text): + if text.startswith('"'): + return None if "\\" in text else text[1:-1] + if text.startswith("'"): + return text[1:-1].replace("''", "'") + return text + + +def _workflow_value(text): + """A one-line scalar value without its comment and quotes; None when escaped or unterminated.""" + text = text.strip() + if text.startswith('"'): + quoted = re.match(r'"((?:[^"\\]|\\.)*)"\s*(?:#.*)?$', text) + return None if quoted is None or "\\" in quoted.group(1) else quoted.group(1) + if text.startswith("'"): + quoted = re.match(r"'((?:[^']|'')*)'\s*(?:#.*)?$", text) + return None if quoted is None else quoted.group(1).replace("''", "'") + return re.split(r"\s+#", text, maxsplit=1)[0].strip() + + +def _strip_comment(text): + """(text without its comment, unterminated) using a quote-aware scan. + + As in YAML, a quote opens a quoted scalar only where a scalar starts (line start or after + `:`, `-`, `,`, `{` or `[`), and a `#` starts a comment only outside quotes, at the start or + after whitespace. + """ + quote, index = None, 0 + while index < len(text): + char = text[index] + if quote == '"': + if char == "\\": + index += 2 + continue + if char == '"': + quote = None + elif quote == "'": + if char == "'": + if text[index + 1:index + 2] == "'": + index += 2 + continue + quote = None + elif char in "\"'" and text[:index].rstrip()[-1:] in ("", ":", "-", ",", "{", "["): + quote = char + elif char == "#" and (index == 0 or text[index - 1] in " \t"): + return text[:index].rstrip(), False + index += 1 + return text.rstrip(), quote is not None + + +FLOW_QUOTED = re.compile(r"\"(?:[^\"\\]|\\.)*\"|'(?:[^']|'')*'") +FLOW_FORBIDDEN_KEYS = {"environment", "uses"} + + +def workflow_entries(source): + """Every mapping entry in a workflow, plus the YAML forms this reader refuses. + + A narrow reader, not a YAML parser (none ships with the runner's Python). Each entry is + (line, key, value, multiline): plain, single- and double-quoted keys and one-line values in + block and simple one-line flow mappings. Block scalar bodies are skipped, and an entry whose + value is a block scalar or continues on the next lines is marked multiline. It refuses whatever + could hide a key from it: escaped double-quoted keys, explicit `?` keys, merge keys, anchors, + aliases, tags, tab indentation and nested or multi-line flow. + """ + lines = source.splitlines() + entries, refused, block = [], [], None + + def continues(index, indent): + for follow in lines[index + 1:]: + stripped = follow.strip() + if not stripped or stripped.startswith("#"): + continue + deeper = len(follow) - len(follow.lstrip(" ")) > indent + return deeper and not stripped.startswith("- ") and WORKFLOW_KEY.match(stripped) is None + return False + + for index, raw in enumerate(lines): + number = index + 1 + stripped = raw.strip() + indent = len(raw) - len(raw.lstrip(" ")) + if block is not None: + if not stripped or indent > block: + continue + block = None + if not stripped or stripped.startswith("#"): + continue + if "\t" in raw[:indent + 1]: + refused.append(f"line {number}: tab indentation"); continue + body, unterminated = _strip_comment(stripped) + if unterminated: + refused.append(f"line {number}: unterminated or multi-line quoted scalar"); continue + if not body: + continue + while body.startswith("- "): + body = body[2:].lstrip() + if body == "?" or body.startswith("? "): + refused.append(f"line {number}: explicit key"); continue + match = WORKFLOW_KEY.match(body) + value = body + if match is not None: + key, value = _workflow_key(match.group(1)), match.group(2) or "" + if key is None: + refused.append(f"line {number}: escaped double-quoted key"); continue + if key == "<<": + refused.append(f"line {number}: merge key"); continue + plain = re.sub(r"\$\{\{.*?\}\}", "", value).strip() + bare = re.sub(r"\"(?:[^\"\\]|\\.)*\"|'(?:[^']|'')*'", "''", plain) + if re.match(r"[&*!]", plain): + refused.append(f"line {number}: anchor, alias or tag") + is_block = re.fullmatch(r"[|>][0-9+-]*", plain) is not None + if match is not None: + entries.append((number, key, _workflow_value(value), + is_block or ((value == "" or not is_block) and continues(index, indent)))) + if "{" in bare and bare != "{}": + flow = re.fullmatch(r"\{([^{}\[\]]*)\}", FLOW_QUOTED.sub("''", value.strip())) + if any(set(scalar[1:-1]) & set("#{}[],") for scalar in FLOW_QUOTED.findall(value)): + refused.append(f"line {number}: flow mapping quoted scalar with # or flow punctuation") + elif flow is None: + refused.append(f"line {number}: nested or multi-line flow mapping") + elif not re.fullmatch(r"\{([^{}\[\]]*)\}", value.strip()): + refused.append(f"line {number}: nested or multi-line flow mapping") + else: + for item in flow.group(1).split(","): + entry = WORKFLOW_KEY.match(item.strip()) + key = _workflow_key(entry.group(1)) if entry else None + if key is None: + refused.append(f"line {number}: unreadable flow mapping entry") + elif key in FLOW_FORBIDDEN_KEYS: + refused.append(f"line {number}: {key} in a flow mapping (must be block style)") + else: + entries.append((number, key, _workflow_value(entry.group(2) or ""), False)) + if match is not None and is_block: + block = indent + return entries, refused + + +def workflow_keys(source): + """(line, key) for every mapping entry, plus the refused YAML forms.""" + entries, refused = workflow_entries(source) + return [(number, key) for number, key, _, _ in entries], refused + + +SHARED_CALLEE = re.compile(r"storytold/craft-common-actions/\.github/workflows/([\w.-]+\.ya?ml)@(\S+)", re.IGNORECASE) +INSPECTED_KEYS = {"environment", "uses"} + + +def trust_closure_problems(workflows): + """The nightly-signer trust-closure scan over app workflow sources; empty when the tree is safe. + + Every key it inspects comes from workflow_entries(), never a regex over the raw text. + """ + problems, stable_callers, signer_calls = [], set(), 0 + for name, source in workflows.items(): + entries, refused = workflow_entries(source) + problems.extend(name + " uses YAML the scan cannot read (" + reason + ")" for reason in refused) + for number, key, value, multiline in entries: + if key not in INSPECTED_KEYS: + continue + if key == "environment": + problems.append(f"{name} binds an environment directly (line {number})") + continue + if value is None or multiline: + problems.append(f"{name} has a uses value the scan cannot read (line {number})") + continue + callee = SHARED_CALLEE.fullmatch(value) + if callee is None: + if re.search(r"craft-common-actions", value, re.IGNORECASE) and re.search(r"workflows/(nightly-)?release\.ya?ml", value, re.IGNORECASE): + problems.append(f"{name} has an unrecognised shared release caller (line {number})") + continue + workflow, ref = callee.group(1), callee.group(2) + if workflow.lower() in ("nightly-release.yml", "nightly-release.yaml"): + if name == "nightly-sign.yml": + signer_calls += 1 + if name != "nightly-sign.yml" or not re.fullmatch(r"[0-9a-f]{40}", ref): + problems.append(name + " calls nightly-release.yml@" + ref) + if workflow.lower() in ("release.yml", "release.yaml"): + stable_callers.add(name) + if ref != "main" and not re.fullmatch(r"[0-9a-f]{40}", ref): + problems.append(name + " calls release.yml@" + ref + "; use @main or a reviewed full SHA") + if stable_callers != REVIEWED_STABLE_RELEASE_CALLERS: + problems.append("shared release.yml callers are " + ", ".join(sorted(stable_callers))) + if signer_calls != 1: + problems.append("nightly-sign.yml must call nightly-release.yml exactly once") + return problems + + +class NightlySignerBranchTrustClosure(unittest.TestCase): + """On refs/heads/nightly-signer, only the pinned signer caller may reach an environment.""" + + def test_trust_closure_scan_passes_on_this_tree(self): + self.assertEqual(trust_closure_problems(app_workflows()), []) + + def test_trust_closure_scan_refuses_each_route_into_an_environment(self): + tree = app_workflows() + bad = { + "a workflow binds an environment": {**tree, "extra.yml": "jobs:\n x:\n runs-on: ubuntu-latest\n environment: release\n"}, + "a double-quoted environment key": {**tree, "extra.yml": 'jobs:\n x:\n runs-on: ubuntu-latest\n "environment": release\n'}, + "a single-quoted environment key": {**tree, "extra.yml": "jobs:\n x:\n runs-on: ubuntu-latest\n 'environment' : release\n"}, + "an environment mapping": {**tree, "extra.yml": "jobs:\n x:\n runs-on: ubuntu-latest\n environment:\n name: release\n"}, + "an environment in a flow mapping": {**tree, "extra.yml": "jobs:\n x: {runs-on: ubuntu-latest, environment: release}\n"}, + "an escaped key": {**tree, "extra.yml": 'jobs:\n x:\n runs-on: ubuntu-latest\n "environ\\u006dent": release\n'}, + "a merge key": {**tree, "extra.yml": "base: &b\n runs-on: ubuntu-latest\njobs:\n x:\n <<: *b\n"}, + "an explicit key": {**tree, "extra.yml": "jobs:\n x:\n ? environment\n : release\n"}, + "a nested flow mapping": {**tree, "extra.yml": "jobs:\n x: {steps: [{run: a}]}\n"}, + "a double-quoted uses key copying the signer": {**tree, "extra.yml": 'jobs:\n x:\n "uses": ' + SHARED + "nightly-release.yml@" + "a" * 40 + "\n"}, + "a single-quoted uses key": {**tree, "extra.yml": "jobs:\n x:\n 'uses': " + SHARED + "nightly-release.yml@" + "a" * 40 + "\n"}, + "a quoted uses value": {**tree, "extra.yml": 'jobs:\n x:\n uses: "' + SHARED + "nightly-release.yml@" + "a" * 40 + '"\n'}, + "uses in a flow mapping": {**tree, "extra.yml": "jobs:\n x: {uses: " + SHARED + "nightly-release.yml@" + "a" * 40 + "}\n"}, + "a differently cased owner": {**tree, "extra.yml": "jobs:\n x:\n uses: Storytold/Craft-Common-Actions/.github/workflows/nightly-release.yml@" + "a" * 40 + "\n"}, + "a folded uses value": {**tree, "extra.yml": "jobs:\n x:\n uses: >-\n " + SHARED + "nightly-release.yml@" + "a" * 40 + "\n"}, + "a continued uses value": {**tree, "extra.yml": "jobs:\n x:\n uses: " + SHARED + "\n nightly-release.yml@" + "a" * 40 + "\n"}, + "a quoted second signer call": {**tree, "nightly-sign.yml": tree["nightly-sign.yml"] + " again:\n \"uses\": " + SHARED + "nightly-release.yml@" + "a" * 40 + "\n"}, + "a hash inside a quoted flow scalar": {**tree, "extra.yml": 'jobs:\n x: {name: "a} # b", runs-on: ubuntu-latest, environment: release, steps: []}\n'}, + "a single-quoted hash in a flow scalar": {**tree, "extra.yml": "jobs:\n x: {name: 'a # b', runs-on: ubuntu-latest}\n"}, + "a comma inside a quoted flow scalar": {**tree, "extra.yml": 'jobs:\n x: {name: "a, environment: release", runs-on: ubuntu-latest}\n'}, + "a bracket inside a quoted flow scalar": {**tree, "extra.yml": 'jobs:\n x: {name: "[a]", runs-on: ubuntu-latest}\n'}, + "an unterminated quote": {**tree, "extra.yml": 'jobs:\n x:\n name: "a\n b"\n runs-on: ubuntu-latest\n'}, + "environment in any flow mapping": {**tree, "extra.yml": "jobs:\n x:\n runs-on: ubuntu-latest\n with: {environment: release}\n"}, + "uses in any flow mapping": {**tree, "extra.yml": "jobs:\n x:\n steps:\n - {uses: actions/checkout@v4}\n"}, + "another caller of the signer": {**tree, "extra.yml": "jobs:\n x:\n uses: " + SHARED + "nightly-release.yml@" + "a" * 40 + "\n"}, + "a mutable signer pin": {**tree, "nightly-sign.yml": re.sub(r"nightly-release\.yml@[0-9a-f]{40}", "nightly-release.yml@main", tree["nightly-sign.yml"])}, + "a new stable release caller": {**tree, "extra.yml": "jobs:\n x:\n uses: " + SHARED + "release.yml@main\n"}, + "a stable caller on a branch or tag ref": {**tree, "release.yml": tree["release.yml"].replace(SHARED + "release.yml@main", SHARED + "release.yml@v1")}, + } + for label, workflows in bad.items(): + with self.subTest(case=label): + self.assertTrue(trust_closure_problems(workflows)) + + def test_signer_dispatch_guard_and_policy_name_the_same_branch(self): + sign = (ROOT / ".github/workflows/nightly-sign.yml").read_text() + (_, guard), = job_conditions(sign.split("\njobs:\n", 1)[1]) + self.assertIn("github.ref == 'refs/heads/" + SIGNER_BRANCH + "'", guard) + self.assertNotIn("refs/heads/release", sign, "the signer no longer runs on the stable branch") + self.assertEqual(re.findall(r"(?m)^ app-name: (\S+)$", sign), [APP_NAME], + "the shared signer needs the reviewed registry app") + dispatch = (ROOT / ".github/workflows/nightly-dispatch.yml").read_text() + self.assertEqual(re.findall(r"'ref': '([^']+)'", dispatch), ["refs/heads/" + SIGNER_BRANCH]) + self.assertEqual(json.loads(INSTALLED_POLICY.read_text())["release_branch"], SIGNER_BRANCH) + + +def dispatch_triggers(source): + """The dispatch workflow's own triggers, one per line, as a caller may register them.""" + events = source.split("\non:\n", 1)[1].split("\npermissions:", 1)[0] + return [line for line in events.splitlines() if line.startswith(" ") and not line.startswith(" ") + and line.strip() and not line.lstrip().startswith("#")] + + +class NightlyDispatchTransport(unittest.TestCase): + """The scheduled transport stays literally off and can only reach the signer branch.""" + + def setUp(self): + self.source = (ROOT / ".github/workflows/nightly-dispatch.yml").read_text() + + def test_every_dispatch_job_is_literal_off(self): + jobs = self.source.split("\njobs:\n", 1)[1] + headers = re.findall(r"(?m)^ (?![\s#])[^\n]+", jobs) + conditions = job_conditions(jobs) + self.assertTrue(headers) + self.assertEqual(len(conditions), len(headers), "every job needs a literal-off condition") + for _, expression in conditions: + self.assertTrue(literal_off(expression), "nightly activation requires reviewed test update") + + def test_only_a_completed_scheduled_producer_is_transported(self): + self.assertEqual(re.findall(r"(?m)^ workflows: (.+)$", self.source), + ["[" + PRODUCER_WORKFLOW_NAME + "]"]) + self.assertEqual(dispatch_triggers(self.source), [" workflow_run:"], + "the transport is not a second entry point") + self.assertNotIn("schedule:", self.source) + self.assertIn("producer.get('event') == 'schedule'", self.source) + + def test_the_request_names_the_signer_workflow_and_branch(self): + self.assertIn("repos/storytold/" + APP_NAME + "/actions/workflows/nightly-sign.yml/dispatches", self.source) + self.assertNotIn("'ref': 'release'", self.source) if __name__ == "__main__": unittest.main(verbosity=2) From 104556e47d66344efb2338bc48f25ad974691d42 Mon Sep 17 00:00:00 2001 From: Lucas Batista Vargas Date: Thu, 26 Nov 2026 05:52:55 -0300 Subject: [PATCH 3/3] chore: bump craft-libs to 0b8bbaf4c8 and egui to b9770908e0 (#7837) --- Cargo.lock | 241 ++++++++++-------- Cargo.toml | 104 ++++---- apps/wordcraft-web/src/host.rs | 12 +- apps/wordcraft-web/src/web.rs | 6 +- apps/wordcraft/src/main.rs | 6 +- crates/ui-egui/Cargo.toml | 4 +- crates/ui-egui/src/app/files.rs | 16 +- crates/ui-egui/src/chrome/search.rs | 9 +- crates/ui-egui/src/colors.rs | 6 +- crates/ui-egui/src/dialogs/dialogs_chart.rs | 4 +- crates/ui-egui/src/dialogs/dialogs_insert.rs | 2 +- .../src/dialogs/dialogs_insert/symbol.rs | 8 +- .../src/dialogs/dialogs_layout/text.rs | 4 +- crates/ui-egui/src/dialogs/dialogs_lists.rs | 2 +- crates/ui-egui/src/dialogs/dialogs_para.rs | 2 +- .../src/dialogs/dialogs_refs/sources.rs | 6 +- .../ui-egui/src/dialogs/dialogs_refs/toc.rs | 4 +- crates/ui-egui/src/dialogs/dialogs_review.rs | 4 +- crates/ui-egui/src/dialogs/dialogs_ribbon.rs | 2 +- .../ui-egui/src/dialogs/dialogs_smart_art.rs | 10 +- .../ui-egui/src/dialogs/dialogs_templates.rs | 4 +- crates/ui-egui/src/dialogs/merge_dialogs.rs | 4 +- crates/ui-egui/src/dialogs/search_commands.rs | 9 +- crates/ui-egui/src/dialogs/styles.rs | 2 +- crates/ui-egui/src/dialogs/tests.rs | 4 +- crates/ui-egui/src/file_dialogs.rs | 5 +- crates/ui-egui/src/file_dialogs/tests.rs | 4 +- crates/ui-egui/src/keys/canvas.rs | 8 +- crates/ui-egui/src/keys/tests.rs | 2 +- crates/ui-egui/src/mini_toolbar/tests.rs | 22 +- crates/ui-egui/src/objects.rs | 9 + crates/ui-egui/src/panes/nav.rs | 2 +- crates/ui-egui/src/panes/side.rs | 2 +- crates/ui-egui/src/ribbon/charts.rs | 13 +- crates/ui-egui/src/ribbon/common.rs | 14 +- crates/ui-egui/src/ribbon/underline.rs | 6 +- crates/ui-egui/src/tests.rs | 26 +- crates/ui-egui/src/tests/chrome.rs | 17 +- crates/ui-egui/src/tests/dialogs.rs | 4 + crates/ui-egui/src/theme/legacy.rs | 6 + 40 files changed, 355 insertions(+), 260 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 81b98ad735..27d6583696 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1183,7 +1183,7 @@ dependencies = [ [[package]] name = "craft" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" dependencies = [ "craft-automation", "craft-behavior", @@ -1221,10 +1221,20 @@ dependencies = [ "toml", ] +[[package]] +name = "craft-appkit" +version = "0.1.0" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" +dependencies = [ + "block2 0.6.2", + "objc2-app-kit 0.3.2", + "objc2-foundation 0.3.2", +] + [[package]] name = "craft-atomic" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" dependencies = [ "rustix 1.1.6", ] @@ -1232,7 +1242,7 @@ dependencies = [ [[package]] name = "craft-automation" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" dependencies = [ "base64 0.23.1", "craft-behavior", @@ -1257,7 +1267,7 @@ dependencies = [ [[package]] name = "craft-behavior" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" dependencies = [ "accesskit", "bitflags 2.13.2", @@ -1275,7 +1285,7 @@ dependencies = [ [[package]] name = "craft-browse" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" dependencies = [ "craft-behavior", "craft-docpath", @@ -1293,12 +1303,12 @@ dependencies = [ [[package]] name = "craft-cfb" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" [[package]] name = "craft-cloud-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" dependencies = [ "egui", ] @@ -1306,7 +1316,7 @@ dependencies = [ [[package]] name = "craft-cms" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" dependencies = [ "md-5", "rayon", @@ -1315,12 +1325,12 @@ dependencies = [ [[package]] name = "craft-codepage" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" [[package]] name = "craft-color" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" dependencies = [ "serde", ] @@ -1328,7 +1338,7 @@ dependencies = [ [[package]] name = "craft-color-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" dependencies = [ "craft-behavior", "craft-cms", @@ -1348,7 +1358,7 @@ dependencies = [ [[package]] name = "craft-control" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" dependencies = [ "getrandom 0.3.4", "serde", @@ -1358,7 +1368,7 @@ dependencies = [ [[package]] name = "craft-dds" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" dependencies = [ "rayon", ] @@ -1366,7 +1376,7 @@ dependencies = [ [[package]] name = "craft-dialogs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" dependencies = [ "block2 0.6.2", "craft-atomic", @@ -1391,7 +1401,7 @@ dependencies = [ [[package]] name = "craft-doc-binary" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" dependencies = [ "chrono", "craft-cfb", @@ -1408,7 +1418,7 @@ dependencies = [ [[package]] name = "craft-docpath" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" dependencies = [ "serde", ] @@ -1416,7 +1426,7 @@ dependencies = [ [[package]] name = "craft-docx" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" dependencies = [ "base64 0.23.1", "chrono", @@ -1436,7 +1446,7 @@ dependencies = [ [[package]] name = "craft-draw" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" dependencies = [ "craft-behavior", "craft-color-ui", @@ -1455,7 +1465,7 @@ dependencies = [ [[package]] name = "craft-drawingml" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" dependencies = [ "chrono", "craft-xml", @@ -1467,7 +1477,7 @@ dependencies = [ [[package]] name = "craft-flow" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" dependencies = [ "craft-wordmodel", "image", @@ -1477,7 +1487,7 @@ dependencies = [ [[package]] name = "craft-font-catalog" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" dependencies = [ "fontique", "harfrust 0.13.3", @@ -1492,7 +1502,7 @@ dependencies = [ [[package]] name = "craft-font-manager" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" dependencies = [ "craft-behavior", "craft-font-catalog", @@ -1505,17 +1515,27 @@ dependencies = [ "egui", "log", "serde", - "skrifa 0.44.0", + "skrifa 0.47.0", +] + +[[package]] +name = "craft-font-os-windows" +version = "0.1.0" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" +dependencies = [ + "windows-registry", + "windows-sys 0.61.2", ] [[package]] name = "craft-font-store" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" dependencies = [ "cap-primitives", "craft-atomic", "craft-font-catalog", + "craft-font-os-windows", "flate2", "log", "ruzstd", @@ -1527,12 +1547,13 @@ dependencies = [ "thiserror 2.0.21", "toml", "ureq", + "wuff", ] [[package]] name = "craft-font-subset" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" dependencies = [ "brotli 9.1.3", "harfbuzz-subset-sys", @@ -1545,7 +1566,7 @@ dependencies = [ [[package]] name = "craft-fonts-build" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" dependencies = [ "craft-font-subset", ] @@ -1553,7 +1574,7 @@ dependencies = [ [[package]] name = "craft-gpu" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" dependencies = [ "egui-wgpu", "log", @@ -1565,7 +1586,7 @@ dependencies = [ [[package]] name = "craft-host" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" dependencies = [ "bitflags 2.13.2", "craft-i18n", @@ -1578,7 +1599,7 @@ dependencies = [ [[package]] name = "craft-html" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" dependencies = [ "craft-codepage", "craft-flow", @@ -1591,7 +1612,7 @@ dependencies = [ [[package]] name = "craft-i18n" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" dependencies = [ "chrono", "fixed_decimal", @@ -1619,7 +1640,7 @@ dependencies = [ [[package]] name = "craft-image-codecs" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" dependencies = [ "craft-dds", "craft-jpeg", @@ -1646,7 +1667,7 @@ dependencies = [ [[package]] name = "craft-imaging" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" dependencies = [ "craft-behavior", "craft-color-ui", @@ -1664,7 +1685,7 @@ dependencies = [ [[package]] name = "craft-jpeg" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" dependencies = [ "thiserror 2.0.21", ] @@ -1672,7 +1693,7 @@ dependencies = [ [[package]] name = "craft-keymap" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" dependencies = [ "craft-host", "craft-i18n", @@ -1687,7 +1708,7 @@ dependencies = [ [[package]] name = "craft-latex" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" dependencies = [ "craft-flow", "craft-math", @@ -1698,7 +1719,7 @@ dependencies = [ [[package]] name = "craft-markdown" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" dependencies = [ "craft-flow", "craft-html", @@ -1708,7 +1729,7 @@ dependencies = [ [[package]] name = "craft-math" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" dependencies = [ "craft-xml", "roxmltree", @@ -1718,7 +1739,7 @@ dependencies = [ [[package]] name = "craft-mcp-server" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" dependencies = [ "serde_json", ] @@ -1726,7 +1747,7 @@ dependencies = [ [[package]] name = "craft-menu" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" dependencies = [ "craft-behavior", "craft-host", @@ -1744,7 +1765,7 @@ dependencies = [ [[package]] name = "craft-metadata" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" dependencies = [ "brotli-decompressor 6.3.1", "chrono", @@ -1756,7 +1777,7 @@ dependencies = [ [[package]] name = "craft-metafile" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" dependencies = [ "encoding_rs", "image", @@ -1767,7 +1788,7 @@ dependencies = [ [[package]] name = "craft-mime" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" dependencies = [ "chardetng", "chrono", @@ -1778,7 +1799,7 @@ dependencies = [ [[package]] name = "craft-odf" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" dependencies = [ "aes", "base64 0.23.1", @@ -1804,7 +1825,7 @@ dependencies = [ [[package]] name = "craft-ods" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" dependencies = [ "craft-odf", "craft-sheet", @@ -1815,7 +1836,7 @@ dependencies = [ [[package]] name = "craft-offcrypto" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" dependencies = [ "aes", "base64 0.23.1", @@ -1832,7 +1853,7 @@ dependencies = [ [[package]] name = "craft-opc" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" dependencies = [ "craft-xml", "craft-zip", @@ -1843,7 +1864,7 @@ dependencies = [ [[package]] name = "craft-pages" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" dependencies = [ "craft-behavior", "craft-keymap", @@ -1859,7 +1880,7 @@ dependencies = [ [[package]] name = "craft-pdf" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" dependencies = [ "krilla", "serde", @@ -1869,7 +1890,7 @@ dependencies = [ [[package]] name = "craft-platform" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" dependencies = [ "arboard", "async-channel", @@ -1905,7 +1926,7 @@ dependencies = [ [[package]] name = "craft-print" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" dependencies = [ "craft-behavior", "craft-host", @@ -1929,7 +1950,7 @@ dependencies = [ [[package]] name = "craft-proof" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" dependencies = [ "log", "miniz_oxide 0.9.1", @@ -1940,7 +1961,7 @@ dependencies = [ [[package]] name = "craft-quit" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" dependencies = [ "dispatch2", "egui", @@ -1953,7 +1974,7 @@ dependencies = [ [[package]] name = "craft-review" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" dependencies = [ "base64 0.23.1", "craft-behavior", @@ -1972,7 +1993,7 @@ dependencies = [ [[package]] name = "craft-rtf" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" dependencies = [ "craft-codepage", "craft-flow", @@ -1985,7 +2006,7 @@ dependencies = [ [[package]] name = "craft-settings" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" dependencies = [ "craft-atomic", "craft-host", @@ -2002,17 +2023,17 @@ dependencies = [ [[package]] name = "craft-sheet" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" [[package]] name = "craft-ssip" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" [[package]] name = "craft-svg" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" dependencies = [ "craft-xml", "flate2", @@ -2029,7 +2050,7 @@ dependencies = [ [[package]] name = "craft-table" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" dependencies = [ "craft-behavior", "craft-keymap", @@ -2041,7 +2062,7 @@ dependencies = [ [[package]] name = "craft-text" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" dependencies = [ "craft-behavior", "craft-host", @@ -2065,7 +2086,7 @@ dependencies = [ [[package]] name = "craft-theme" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" dependencies = [ "bitflags 2.13.2", "craft-tracked", @@ -2080,7 +2101,7 @@ dependencies = [ [[package]] name = "craft-theme-store" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" dependencies = [ "craft-atomic", "craft-behavior", @@ -2095,7 +2116,7 @@ dependencies = [ [[package]] name = "craft-tiff" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" dependencies = [ "serde", "thiserror 2.0.21", @@ -2105,7 +2126,7 @@ dependencies = [ [[package]] name = "craft-time" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" dependencies = [ "serde", "thiserror 2.0.21", @@ -2114,7 +2135,7 @@ dependencies = [ [[package]] name = "craft-timeline" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" dependencies = [ "craft-behavior", "craft-keymap", @@ -2129,12 +2150,12 @@ dependencies = [ [[package]] name = "craft-tracked" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" [[package]] name = "craft-ui" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" dependencies = [ "craft-cloud-ui", "craft-ui-canvas", @@ -2148,7 +2169,7 @@ dependencies = [ [[package]] name = "craft-ui-canvas" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" dependencies = [ "craft-behavior", "craft-i18n", @@ -2164,7 +2185,7 @@ dependencies = [ [[package]] name = "craft-ui-contract" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" dependencies = [ "accesskit", "craft-behavior", @@ -2202,7 +2223,7 @@ dependencies = [ [[package]] name = "craft-ui-macros" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" dependencies = [ "proc-macro-crate", "proc-macro2", @@ -2213,7 +2234,7 @@ dependencies = [ [[package]] name = "craft-ui-panels" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" dependencies = [ "craft-behavior", "craft-host", @@ -2231,7 +2252,7 @@ dependencies = [ [[package]] name = "craft-ui-patterns" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" dependencies = [ "craft-behavior", "craft-host", @@ -2252,7 +2273,7 @@ dependencies = [ [[package]] name = "craft-ui-shell" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" dependencies = [ "craft-behavior", "craft-host", @@ -2273,7 +2294,7 @@ dependencies = [ [[package]] name = "craft-ui-test-kit" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" dependencies = [ "craft-behavior", "craft-host", @@ -2284,7 +2305,7 @@ dependencies = [ [[package]] name = "craft-ui-widgets" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" dependencies = [ "craft-behavior", "craft-host", @@ -2303,7 +2324,7 @@ dependencies = [ [[package]] name = "craft-update" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" dependencies = [ "chrono", "craft-host", @@ -2332,7 +2353,7 @@ dependencies = [ [[package]] name = "craft-web-api" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" dependencies = [ "js-sys", "serde_json", @@ -2343,7 +2364,7 @@ dependencies = [ [[package]] name = "craft-web-host" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" dependencies = [ "craft-host", "craft-platform", @@ -2355,7 +2376,7 @@ dependencies = [ [[package]] name = "craft-win32" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" dependencies = [ "winsafe", ] @@ -2363,8 +2384,9 @@ dependencies = [ [[package]] name = "craft-window" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" dependencies = [ + "craft-appkit", "craft-atomic", "craft-behavior", "craft-host", @@ -2380,6 +2402,7 @@ dependencies = [ "serde_json", "wayland-client", "winsafe", + "x11rb", ] [[package]] @@ -2393,7 +2416,7 @@ dependencies = [ [[package]] name = "craft-wordmodel" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" dependencies = [ "base64 0.23.1", "craft-math", @@ -2407,7 +2430,7 @@ dependencies = [ [[package]] name = "craft-xls" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" dependencies = [ "craft-cfb", "craft-sheet", @@ -2420,7 +2443,7 @@ dependencies = [ [[package]] name = "craft-xlsx" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" dependencies = [ "craft-drawingml", "craft-opc", @@ -2432,7 +2455,7 @@ dependencies = [ [[package]] name = "craft-xml" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" dependencies = [ "quick-xml 0.41.0", "serde", @@ -2442,7 +2465,7 @@ dependencies = [ [[package]] name = "craft-zip" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" dependencies = [ "flate2", "thiserror 2.0.21", @@ -2760,7 +2783,7 @@ checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" [[package]] name = "ecolor" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=f5025284445ea19c35f746d96fc0b75468b3f560#f5025284445ea19c35f746d96fc0b75468b3f560" +source = "git+https://github.com/storytold/egui.git?rev=b9770908e0f304896f9658d239a7b29cf8af1564#b9770908e0f304896f9658d239a7b29cf8af1564" dependencies = [ "bytemuck", "emath", @@ -2769,7 +2792,7 @@ dependencies = [ [[package]] name = "eframe" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=f5025284445ea19c35f746d96fc0b75468b3f560#f5025284445ea19c35f746d96fc0b75468b3f560" +source = "git+https://github.com/storytold/egui.git?rev=b9770908e0f304896f9658d239a7b29cf8af1564#b9770908e0f304896f9658d239a7b29cf8af1564" dependencies = [ "ahash", "bytemuck", @@ -2804,7 +2827,7 @@ dependencies = [ [[package]] name = "egui" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=f5025284445ea19c35f746d96fc0b75468b3f560#f5025284445ea19c35f746d96fc0b75468b3f560" +source = "git+https://github.com/storytold/egui.git?rev=b9770908e0f304896f9658d239a7b29cf8af1564#b9770908e0f304896f9658d239a7b29cf8af1564" dependencies = [ "accesskit", "ahash", @@ -2823,7 +2846,7 @@ dependencies = [ [[package]] name = "egui-wgpu" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=f5025284445ea19c35f746d96fc0b75468b3f560#f5025284445ea19c35f746d96fc0b75468b3f560" +source = "git+https://github.com/storytold/egui.git?rev=b9770908e0f304896f9658d239a7b29cf8af1564#b9770908e0f304896f9658d239a7b29cf8af1564" dependencies = [ "ahash", "bytemuck", @@ -2842,7 +2865,7 @@ dependencies = [ [[package]] name = "egui-winit" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=f5025284445ea19c35f746d96fc0b75468b3f560#f5025284445ea19c35f746d96fc0b75468b3f560" +source = "git+https://github.com/storytold/egui.git?rev=b9770908e0f304896f9658d239a7b29cf8af1564#b9770908e0f304896f9658d239a7b29cf8af1564" dependencies = [ "accesskit_winit", "arboard", @@ -2868,7 +2891,7 @@ dependencies = [ [[package]] name = "egui_extras" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=f5025284445ea19c35f746d96fc0b75468b3f560#f5025284445ea19c35f746d96fc0b75468b3f560" +source = "git+https://github.com/storytold/egui.git?rev=b9770908e0f304896f9658d239a7b29cf8af1564#b9770908e0f304896f9658d239a7b29cf8af1564" dependencies = [ "ahash", "egui", @@ -2881,7 +2904,7 @@ dependencies = [ [[package]] name = "egui_glow" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=f5025284445ea19c35f746d96fc0b75468b3f560#f5025284445ea19c35f746d96fc0b75468b3f560" +source = "git+https://github.com/storytold/egui.git?rev=b9770908e0f304896f9658d239a7b29cf8af1564#b9770908e0f304896f9658d239a7b29cf8af1564" dependencies = [ "bytemuck", "egui", @@ -2894,7 +2917,7 @@ dependencies = [ [[package]] name = "egui_kittest" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=f5025284445ea19c35f746d96fc0b75468b3f560#f5025284445ea19c35f746d96fc0b75468b3f560" +source = "git+https://github.com/storytold/egui.git?rev=b9770908e0f304896f9658d239a7b29cf8af1564#b9770908e0f304896f9658d239a7b29cf8af1564" dependencies = [ "dify", "eframe", @@ -2920,7 +2943,7 @@ checksum = "0e9c71c2167ca323c882b99918929403426e2373ea17242ff5653e0d5e1058be" [[package]] name = "emath" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=f5025284445ea19c35f746d96fc0b75468b3f560#f5025284445ea19c35f746d96fc0b75468b3f560" +source = "git+https://github.com/storytold/egui.git?rev=b9770908e0f304896f9658d239a7b29cf8af1564#b9770908e0f304896f9658d239a7b29cf8af1564" dependencies = [ "bytemuck", ] @@ -3001,7 +3024,7 @@ dependencies = [ [[package]] name = "epaint" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=f5025284445ea19c35f746d96fc0b75468b3f560#f5025284445ea19c35f746d96fc0b75468b3f560" +source = "git+https://github.com/storytold/egui.git?rev=b9770908e0f304896f9658d239a7b29cf8af1564#b9770908e0f304896f9658d239a7b29cf8af1564" dependencies = [ "ahash", "bytemuck", @@ -3027,7 +3050,7 @@ dependencies = [ [[package]] name = "epaint_default_fonts" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=f5025284445ea19c35f746d96fc0b75468b3f560#f5025284445ea19c35f746d96fc0b75468b3f560" +source = "git+https://github.com/storytold/egui.git?rev=b9770908e0f304896f9658d239a7b29cf8af1564#b9770908e0f304896f9658d239a7b29cf8af1564" [[package]] name = "equivalent" @@ -3750,7 +3773,7 @@ checksum = "9f4d0e94ddd48749f06bbe4e5389fb9799a0c45bcaf00495042076ef05e3241a" [[package]] name = "hayro-cmap" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" dependencies = [ "brotli 8.0.4", "hayro-postscript", @@ -3759,7 +3782,7 @@ dependencies = [ [[package]] name = "hayro-interpret" version = "0.7.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" dependencies = [ "bitflags 2.13.2", "hayro-cmap", @@ -3777,7 +3800,7 @@ dependencies = [ [[package]] name = "hayro-jbig2" version = "0.3.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" dependencies = [ "fearless_simd", "hayro-ccitt", @@ -3795,12 +3818,12 @@ dependencies = [ [[package]] name = "hayro-postscript" version = "0.1.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" [[package]] name = "hayro-syntax" version = "0.7.2" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" dependencies = [ "flate2", "hayro-ccitt", @@ -4474,9 +4497,9 @@ dependencies = [ [[package]] name = "jpeg-encoder" -version = "0.6.1" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b454d911ac55068f53495488d8ccd0646eaa540c033a28ee15b07838afafb01f" +checksum = "a0370574b86f7eca156b9f298392b5e69a23f8c86f3f865add60bbc2e79467a6" [[package]] name = "js-sys" @@ -4529,7 +4552,7 @@ dependencies = [ [[package]] name = "krilla" version = "0.8.2" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" dependencies = [ "base64 0.22.1", "bumpalo", @@ -4668,7 +4691,7 @@ checksum = "d4a5ff6bcca6c4867b1c4fd4ef63e4db7436ef363e0ad7531d1558856bae64f4" [[package]] name = "linesweeper" version = "0.5.0" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" dependencies = [ "arrayvec", "kurbo", @@ -9841,19 +9864,19 @@ dependencies = [ [[patch.unused]] name = "egui_demo_lib" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=f5025284445ea19c35f746d96fc0b75468b3f560#f5025284445ea19c35f746d96fc0b75468b3f560" +source = "git+https://github.com/storytold/egui.git?rev=b9770908e0f304896f9658d239a7b29cf8af1564#b9770908e0f304896f9658d239a7b29cf8af1564" [[patch.unused]] name = "egui_inspection" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=f5025284445ea19c35f746d96fc0b75468b3f560#f5025284445ea19c35f746d96fc0b75468b3f560" +source = "git+https://github.com/storytold/egui.git?rev=b9770908e0f304896f9658d239a7b29cf8af1564#b9770908e0f304896f9658d239a7b29cf8af1564" [[patch.unused]] name = "egui_system_font_provider" version = "0.37.0" -source = "git+https://github.com/storytold/egui.git?rev=f5025284445ea19c35f746d96fc0b75468b3f560#f5025284445ea19c35f746d96fc0b75468b3f560" +source = "git+https://github.com/storytold/egui.git?rev=b9770908e0f304896f9658d239a7b29cf8af1564#b9770908e0f304896f9658d239a7b29cf8af1564" [[patch.unused]] name = "hayro" version = "0.7.1" -source = "git+https://github.com/storytold/craft-libs?rev=b436ae992591173ce53fdb1314421ba2d8897e49#b436ae992591173ce53fdb1314421ba2d8897e49" +source = "git+https://github.com/storytold/craft-libs?rev=0b8bbaf4c842da2d47de7b3fddd7170ba6115541#0b8bbaf4c842da2d47de7b3fddd7170ba6115541" diff --git a/Cargo.toml b/Cargo.toml index 6fa96a7f2f..8a4217cd3b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -37,20 +37,20 @@ wordcraft-pdf = { path = "crates/pdf" } # reads the ca-valencia pack), #589 (French elision suggestions first), #497 (flag-based # compounding), #496 (review follow-ups, en-AU) and the merged #482–#490/#495 stack; the font # store's `language-pack` kind is #486 (CP4.1). -wordcraft-proof = { package = "craft-proof", git = "https://github.com/storytold/craft-libs", rev = "b436ae992591173ce53fdb1314421ba2d8897e49", version = "=0.1.0" } -craft-font-store = { git = "https://github.com/storytold/craft-libs", rev = "b436ae992591173ce53fdb1314421ba2d8897e49", version = "=0.1.0" } -craft-font-catalog = { git = "https://github.com/storytold/craft-libs", rev = "b436ae992591173ce53fdb1314421ba2d8897e49", version = "=0.1.0" } -craft-ssip = { git = "https://github.com/storytold/craft-libs", rev = "b436ae992591173ce53fdb1314421ba2d8897e49", version = "=0.1.0" } +wordcraft-proof = { package = "craft-proof", git = "https://github.com/storytold/craft-libs", rev = "0b8bbaf4c842da2d47de7b3fddd7170ba6115541", version = "=0.1.0" } +craft-font-store = { git = "https://github.com/storytold/craft-libs", rev = "0b8bbaf4c842da2d47de7b3fddd7170ba6115541", version = "=0.1.0" } +craft-font-catalog = { git = "https://github.com/storytold/craft-libs", rev = "0b8bbaf4c842da2d47de7b3fddd7170ba6115541", version = "=0.1.0" } +craft-ssip = { git = "https://github.com/storytold/craft-libs", rev = "0b8bbaf4c842da2d47de7b3fddd7170ba6115541", version = "=0.1.0" } wordcraft-engine = { path = "crates/engine" } wordcraft-mcp = { path = "crates/mcp" } wordcraft-zotero = { path = "crates/zotero" } wordcraft-control-key = { path = "crates/control-key" } wordcraft-ui-egui = { path = "crates/ui-egui" } -craft-codepage = { git = "https://github.com/storytold/craft-libs", rev = "b436ae992591173ce53fdb1314421ba2d8897e49", version = "=0.1.0" } -craft = { git = "https://github.com/storytold/craft-libs", rev = "b436ae992591173ce53fdb1314421ba2d8897e49", version = "=0.1.0", default-features = false } -craft-ui-test-kit = { git = "https://github.com/storytold/craft-libs", rev = "b436ae992591173ce53fdb1314421ba2d8897e49", version = "=0.1.0" } -craft-keymap = { git = "https://github.com/storytold/craft-libs", rev = "b436ae992591173ce53fdb1314421ba2d8897e49", version = "=0.1.0" } -craft-metafile = { git = "https://github.com/storytold/craft-libs", rev = "b436ae992591173ce53fdb1314421ba2d8897e49", version = "=0.1.0" } +craft-codepage = { git = "https://github.com/storytold/craft-libs", rev = "0b8bbaf4c842da2d47de7b3fddd7170ba6115541", version = "=0.1.0" } +craft = { git = "https://github.com/storytold/craft-libs", rev = "0b8bbaf4c842da2d47de7b3fddd7170ba6115541", version = "=0.1.0", default-features = false } +craft-ui-test-kit = { git = "https://github.com/storytold/craft-libs", rev = "0b8bbaf4c842da2d47de7b3fddd7170ba6115541", version = "=0.1.0" } +craft-keymap = { git = "https://github.com/storytold/craft-libs", rev = "0b8bbaf4c842da2d47de7b3fddd7170ba6115541", version = "=0.1.0" } +craft-metafile = { git = "https://github.com/storytold/craft-libs", rev = "0b8bbaf4c842da2d47de7b3fddd7170ba6115541", version = "=0.1.0" } # foundation kurbo = { version = "0.13", features = ["serde"] } @@ -81,28 +81,28 @@ wuff = "0.2.9" brotli-decompressor = "5" vello_cpu = "0.2" image = { version = "0.25", default-features = false } -craft-image-codecs = { git = "https://github.com/storytold/craft-libs", rev = "b436ae992591173ce53fdb1314421ba2d8897e49", version = "=0.1.0" } -craft-tiff = { git = "https://github.com/storytold/craft-libs", rev = "b436ae992591173ce53fdb1314421ba2d8897e49", version = "=0.1.0" } -craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "b436ae992591173ce53fdb1314421ba2d8897e49", version = "=0.1.0", default-features = false, features = ["write"] } +craft-image-codecs = { git = "https://github.com/storytold/craft-libs", rev = "0b8bbaf4c842da2d47de7b3fddd7170ba6115541", version = "=0.1.0" } +craft-tiff = { git = "https://github.com/storytold/craft-libs", rev = "0b8bbaf4c842da2d47de7b3fddd7170ba6115541", version = "=0.1.0" } +craft-pdf = { git = "https://github.com/storytold/craft-libs", rev = "0b8bbaf4c842da2d47de7b3fddd7170ba6115541", version = "=0.1.0", default-features = false, features = ["write"] } -craft-wordmodel = { git = "https://github.com/storytold/craft-libs", rev = "b436ae992591173ce53fdb1314421ba2d8897e49", version = "=0.1.0" } -craft-docx = { git = "https://github.com/storytold/craft-libs", rev = "b436ae992591173ce53fdb1314421ba2d8897e49", version = "=0.1.0" } -craft-mcp-server = { git = "https://github.com/storytold/craft-libs", rev = "b436ae992591173ce53fdb1314421ba2d8897e49", version = "=0.1.0" } -craft-rtf = { git = "https://github.com/storytold/craft-libs", rev = "b436ae992591173ce53fdb1314421ba2d8897e49", version = "=0.1.0", features = ["doc"] } -craft-doc-binary = { git = "https://github.com/storytold/craft-libs", rev = "b436ae992591173ce53fdb1314421ba2d8897e49", version = "=0.1.0" } -craft-flow = { git = "https://github.com/storytold/craft-libs", rev = "b436ae992591173ce53fdb1314421ba2d8897e49", version = "=0.1.0" } -craft-odf = { git = "https://github.com/storytold/craft-libs", rev = "b436ae992591173ce53fdb1314421ba2d8897e49", version = "=0.1.0", features = ["text"] } -craft-markdown = { git = "https://github.com/storytold/craft-libs", rev = "b436ae992591173ce53fdb1314421ba2d8897e49", version = "=0.1.0" } -craft-html = { git = "https://github.com/storytold/craft-libs", rev = "b436ae992591173ce53fdb1314421ba2d8897e49", version = "=0.1.0", features = ["flow"] } -craft-latex = { git = "https://github.com/storytold/craft-libs", rev = "b436ae992591173ce53fdb1314421ba2d8897e49", version = "=0.1.0" } -craft-math = { git = "https://github.com/storytold/craft-libs", rev = "b436ae992591173ce53fdb1314421ba2d8897e49", version = "=0.1.0" } -craft-mime = { git = "https://github.com/storytold/craft-libs", rev = "b436ae992591173ce53fdb1314421ba2d8897e49", version = "=0.1.0", features = ["detect"] } -craft-sheet = { git = "https://github.com/storytold/craft-libs", rev = "b436ae992591173ce53fdb1314421ba2d8897e49", version = "=0.1.0" } -craft-ods = { git = "https://github.com/storytold/craft-libs", rev = "b436ae992591173ce53fdb1314421ba2d8897e49", version = "=0.1.0" } -craft-xls = { git = "https://github.com/storytold/craft-libs", rev = "b436ae992591173ce53fdb1314421ba2d8897e49", version = "=0.1.0" } -craft-xlsx = { git = "https://github.com/storytold/craft-libs", rev = "b436ae992591173ce53fdb1314421ba2d8897e49", version = "=0.1.0" } -craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "b436ae992591173ce53fdb1314421ba2d8897e49", version = "=0.1.0" } -craft-zip = { git = "https://github.com/storytold/craft-libs", rev = "b436ae992591173ce53fdb1314421ba2d8897e49", version = "=0.1.0" } +craft-wordmodel = { git = "https://github.com/storytold/craft-libs", rev = "0b8bbaf4c842da2d47de7b3fddd7170ba6115541", version = "=0.1.0" } +craft-docx = { git = "https://github.com/storytold/craft-libs", rev = "0b8bbaf4c842da2d47de7b3fddd7170ba6115541", version = "=0.1.0" } +craft-mcp-server = { git = "https://github.com/storytold/craft-libs", rev = "0b8bbaf4c842da2d47de7b3fddd7170ba6115541", version = "=0.1.0" } +craft-rtf = { git = "https://github.com/storytold/craft-libs", rev = "0b8bbaf4c842da2d47de7b3fddd7170ba6115541", version = "=0.1.0", features = ["doc"] } +craft-doc-binary = { git = "https://github.com/storytold/craft-libs", rev = "0b8bbaf4c842da2d47de7b3fddd7170ba6115541", version = "=0.1.0" } +craft-flow = { git = "https://github.com/storytold/craft-libs", rev = "0b8bbaf4c842da2d47de7b3fddd7170ba6115541", version = "=0.1.0" } +craft-odf = { git = "https://github.com/storytold/craft-libs", rev = "0b8bbaf4c842da2d47de7b3fddd7170ba6115541", version = "=0.1.0", features = ["text"] } +craft-markdown = { git = "https://github.com/storytold/craft-libs", rev = "0b8bbaf4c842da2d47de7b3fddd7170ba6115541", version = "=0.1.0" } +craft-html = { git = "https://github.com/storytold/craft-libs", rev = "0b8bbaf4c842da2d47de7b3fddd7170ba6115541", version = "=0.1.0", features = ["flow"] } +craft-latex = { git = "https://github.com/storytold/craft-libs", rev = "0b8bbaf4c842da2d47de7b3fddd7170ba6115541", version = "=0.1.0" } +craft-math = { git = "https://github.com/storytold/craft-libs", rev = "0b8bbaf4c842da2d47de7b3fddd7170ba6115541", version = "=0.1.0" } +craft-mime = { git = "https://github.com/storytold/craft-libs", rev = "0b8bbaf4c842da2d47de7b3fddd7170ba6115541", version = "=0.1.0", features = ["detect"] } +craft-sheet = { git = "https://github.com/storytold/craft-libs", rev = "0b8bbaf4c842da2d47de7b3fddd7170ba6115541", version = "=0.1.0" } +craft-ods = { git = "https://github.com/storytold/craft-libs", rev = "0b8bbaf4c842da2d47de7b3fddd7170ba6115541", version = "=0.1.0" } +craft-xls = { git = "https://github.com/storytold/craft-libs", rev = "0b8bbaf4c842da2d47de7b3fddd7170ba6115541", version = "=0.1.0" } +craft-xlsx = { git = "https://github.com/storytold/craft-libs", rev = "0b8bbaf4c842da2d47de7b3fddd7170ba6115541", version = "=0.1.0" } +craft-xml = { git = "https://github.com/storytold/craft-libs", rev = "0b8bbaf4c842da2d47de7b3fddd7170ba6115541", version = "=0.1.0" } +craft-zip = { git = "https://github.com/storytold/craft-libs", rev = "0b8bbaf4c842da2d47de7b3fddd7170ba6115541", version = "=0.1.0" } # zlib streams (compressed metafile pictures in `.doc` drawings); already in the lock as a dependency of other crates. miniz_oxide = "0.9" cfb = "0.15" @@ -170,27 +170,27 @@ debug = 0 # The framework's patches, which Cargo does not carry over to dependents: its vendored crates from craft-libs, # and the egui and winit forks it builds with. [patch.crates-io] -krilla = { git = "https://github.com/storytold/craft-libs", rev = "b436ae992591173ce53fdb1314421ba2d8897e49" } -hayro = { git = "https://github.com/storytold/craft-libs", rev = "b436ae992591173ce53fdb1314421ba2d8897e49" } -hayro-interpret = { git = "https://github.com/storytold/craft-libs", rev = "b436ae992591173ce53fdb1314421ba2d8897e49" } -hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "b436ae992591173ce53fdb1314421ba2d8897e49" } -hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "b436ae992591173ce53fdb1314421ba2d8897e49" } -hayro-cmap = { git = "https://github.com/storytold/craft-libs", rev = "b436ae992591173ce53fdb1314421ba2d8897e49" } -hayro-postscript = { git = "https://github.com/storytold/craft-libs", rev = "b436ae992591173ce53fdb1314421ba2d8897e49" } -linesweeper = { git = "https://github.com/storytold/craft-libs", rev = "b436ae992591173ce53fdb1314421ba2d8897e49" } -ecolor = { git = "https://github.com/storytold/egui.git", rev = "f5025284445ea19c35f746d96fc0b75468b3f560" } -emath = { git = "https://github.com/storytold/egui.git", rev = "f5025284445ea19c35f746d96fc0b75468b3f560" } -epaint = { git = "https://github.com/storytold/egui.git", rev = "f5025284445ea19c35f746d96fc0b75468b3f560" } -epaint_default_fonts = { git = "https://github.com/storytold/egui.git", rev = "f5025284445ea19c35f746d96fc0b75468b3f560" } -egui = { git = "https://github.com/storytold/egui.git", rev = "f5025284445ea19c35f746d96fc0b75468b3f560" } -egui-winit = { git = "https://github.com/storytold/egui.git", rev = "f5025284445ea19c35f746d96fc0b75468b3f560" } -egui-wgpu = { git = "https://github.com/storytold/egui.git", rev = "f5025284445ea19c35f746d96fc0b75468b3f560" } -egui_glow = { git = "https://github.com/storytold/egui.git", rev = "f5025284445ea19c35f746d96fc0b75468b3f560" } -egui_extras = { git = "https://github.com/storytold/egui.git", rev = "f5025284445ea19c35f746d96fc0b75468b3f560" } -egui_kittest = { git = "https://github.com/storytold/egui.git", rev = "f5025284445ea19c35f746d96fc0b75468b3f560" } -egui_system_font_provider = { git = "https://github.com/storytold/egui.git", rev = "f5025284445ea19c35f746d96fc0b75468b3f560" } -eframe = { git = "https://github.com/storytold/egui.git", rev = "f5025284445ea19c35f746d96fc0b75468b3f560" } -egui_demo_lib = { git = "https://github.com/storytold/egui.git", rev = "f5025284445ea19c35f746d96fc0b75468b3f560" } -egui_inspection = { git = "https://github.com/storytold/egui.git", rev = "f5025284445ea19c35f746d96fc0b75468b3f560" } +krilla = { git = "https://github.com/storytold/craft-libs", rev = "0b8bbaf4c842da2d47de7b3fddd7170ba6115541" } +hayro = { git = "https://github.com/storytold/craft-libs", rev = "0b8bbaf4c842da2d47de7b3fddd7170ba6115541" } +hayro-interpret = { git = "https://github.com/storytold/craft-libs", rev = "0b8bbaf4c842da2d47de7b3fddd7170ba6115541" } +hayro-syntax = { git = "https://github.com/storytold/craft-libs", rev = "0b8bbaf4c842da2d47de7b3fddd7170ba6115541" } +hayro-jbig2 = { git = "https://github.com/storytold/craft-libs", rev = "0b8bbaf4c842da2d47de7b3fddd7170ba6115541" } +hayro-cmap = { git = "https://github.com/storytold/craft-libs", rev = "0b8bbaf4c842da2d47de7b3fddd7170ba6115541" } +hayro-postscript = { git = "https://github.com/storytold/craft-libs", rev = "0b8bbaf4c842da2d47de7b3fddd7170ba6115541" } +linesweeper = { git = "https://github.com/storytold/craft-libs", rev = "0b8bbaf4c842da2d47de7b3fddd7170ba6115541" } +ecolor = { git = "https://github.com/storytold/egui.git", rev = "b9770908e0f304896f9658d239a7b29cf8af1564" } +emath = { git = "https://github.com/storytold/egui.git", rev = "b9770908e0f304896f9658d239a7b29cf8af1564" } +epaint = { git = "https://github.com/storytold/egui.git", rev = "b9770908e0f304896f9658d239a7b29cf8af1564" } +epaint_default_fonts = { git = "https://github.com/storytold/egui.git", rev = "b9770908e0f304896f9658d239a7b29cf8af1564" } +egui = { git = "https://github.com/storytold/egui.git", rev = "b9770908e0f304896f9658d239a7b29cf8af1564" } +egui-winit = { git = "https://github.com/storytold/egui.git", rev = "b9770908e0f304896f9658d239a7b29cf8af1564" } +egui-wgpu = { git = "https://github.com/storytold/egui.git", rev = "b9770908e0f304896f9658d239a7b29cf8af1564" } +egui_glow = { git = "https://github.com/storytold/egui.git", rev = "b9770908e0f304896f9658d239a7b29cf8af1564" } +egui_extras = { git = "https://github.com/storytold/egui.git", rev = "b9770908e0f304896f9658d239a7b29cf8af1564" } +egui_kittest = { git = "https://github.com/storytold/egui.git", rev = "b9770908e0f304896f9658d239a7b29cf8af1564" } +egui_system_font_provider = { git = "https://github.com/storytold/egui.git", rev = "b9770908e0f304896f9658d239a7b29cf8af1564" } +eframe = { git = "https://github.com/storytold/egui.git", rev = "b9770908e0f304896f9658d239a7b29cf8af1564" } +egui_demo_lib = { git = "https://github.com/storytold/egui.git", rev = "b9770908e0f304896f9658d239a7b29cf8af1564" } +egui_inspection = { git = "https://github.com/storytold/egui.git", rev = "b9770908e0f304896f9658d239a7b29cf8af1564" } winit = { git = "https://github.com/storytold/winit.git", rev = "a517b3846ee8457d84ee4975110bfda6797c44dc" } diff --git a/apps/wordcraft-web/src/host.rs b/apps/wordcraft-web/src/host.rs index 7781e0dec7..8f12cd4079 100644 --- a/apps/wordcraft-web/src/host.rs +++ b/apps/wordcraft-web/src/host.rs @@ -37,9 +37,9 @@ use std::rc::Rc; use std::sync::Arc; use std::sync::Mutex; -use craft::host::{FileError, Files, PickId, PickRequest, Picked, WriteIntent}; +use craft::host::{FileError, Files, PendingPick, PickId, PickRequest, Picked, WriteIntent}; use craft::platform::browser_files::BrowserFiles; -use craft::platform::open::{DropTarget, DroppedFile, IntakeSender}; +use craft::platform::open::{DroppedFile, IntakeSender}; use craft::web_host::web::{FileData, Host, Message}; use wordcraft_ui_egui::{Services, WordApp}; @@ -131,7 +131,7 @@ fn deliver_open(intake: &IntakeSender, name: &str, data: &FileData) { return; } let file = DroppedFile { path: None, name, bytes: Some(Arc::from(array.to_vec())) }; - intake.dropped(vec![file], DropTarget::Elsewhere); + intake.dropped(vec![file]); } /// The files of a hosted page: reads go to the browser's files, but a save goes to the host page, @@ -167,8 +167,8 @@ impl Files for HostedFiles { } } - fn pick_pending(&self) -> bool { - self.inner.pick_pending() + fn pending_pick(&self) -> Option { + self.inner.pending_pick() } fn read(&self, path: &Path) -> Result, FileError> { @@ -192,7 +192,7 @@ impl Files for HostedFiles { let answer = match sent { // A Save As or first Save makes the page hold the document as this file: the answer // names it, and the next Save posts the name with `save_as` false. - Ok(()) if request.save_as => Picked::Paths(vec![PathBuf::from(&name)]), + Ok(()) if request.save_as => Picked::Saved { path: PathBuf::from(&name), file_type: None }, // An overwrite of the opened file, or a copy: the document's file stays as it is. Ok(()) => Picked::Downloaded(name), Err(error) => Picked::Failed(error), diff --git a/apps/wordcraft-web/src/web.rs b/apps/wordcraft-web/src/web.rs index b754836936..c1ee1ababb 100644 --- a/apps/wordcraft-web/src/web.rs +++ b/apps/wordcraft-web/src/web.rs @@ -10,7 +10,7 @@ use craft::host::{Files, Host, Wake}; use craft::platform::appearance::SystemReader; use craft::platform::browser_files::BrowserFiles; use craft::platform::clipboard::{Clipboard, ClipboardError, EventClipboard, Flavor, LateOffers, TEXT}; -use craft::platform::open::{DropTarget, DroppedFile, FileIntake, IntakeSender}; +use craft::platform::open::{DroppedFile, FileIntake, IntakeSender}; use craft::print::spool::Spool; use craft::settings::SharedSettings; use craft::ui::InstallSpec; @@ -227,7 +227,7 @@ impl eframe::App for WebShell { match f.bytes_async().await { Ok(bytes) => { let file = DroppedFile { path: None, name, bytes: Some(Arc::from(bytes)) }; - sender.dropped(vec![file], DropTarget::Elsewhere); + sender.dropped(vec![file]); } Err(e) => log::error!("couldn't read dropped file {name}: {e}"), } @@ -412,7 +412,7 @@ fn guard_unload(dirty: Rc>, files: Arc) -> Result<(), S let window = web_sys::window().ok_or("no window")?; let on_unload = wasm_bindgen::closure::Closure::::new(move |e: web_sys::BeforeUnloadEvent| { // A save still in the browser's picker hasn't written anything yet. - if dirty.get() || files.pick_pending() { + if dirty.get() || files.pending_pick().is_some() { e.prevent_default(); // Older browsers ask only when `returnValue` is set. e.set_return_value("unsaved changes"); diff --git a/apps/wordcraft/src/main.rs b/apps/wordcraft/src/main.rs index 890f855970..cc76a3a62c 100644 --- a/apps/wordcraft/src/main.rs +++ b/apps/wordcraft/src/main.rs @@ -38,7 +38,7 @@ use craft::platform::appearance::SystemReader; use craft::platform::clipboard::{Clipboard, ClipboardImage, SystemClipboard}; use craft::platform::default_app::{DefaultApp, DefaultAppError}; use craft::platform::logs::{self, LogNames, crash}; -use craft::platform::open::{DropTarget, DroppedFile, FileIntake, IntakeSender}; +use craft::platform::open::{DroppedFile, FileIntake, IntakeSender}; use craft::print::spool::Spool; use craft::settings::SharedSettings; use craft::ui::InstallSpec; @@ -121,7 +121,7 @@ impl eframe::App for App { // Once per frame, before any pass; the files stay in `raw` for the runtime's own reading. let files = dropped_files(raw); if !files.is_empty() { - self.drops.dropped(files, DropTarget::Elsewhere); + self.drops.dropped(files); } embed::before_input(ctx, |out| self.app.frame_input(out)); } @@ -1036,7 +1036,7 @@ mod smoke { std::fs::create_dir_all(&dir).unwrap(); let path = dir.join("dropped.txt"); std::fs::write(&path, "Dropped words").unwrap(); - run.sender.dropped(vec![DroppedFile { path: Some(path), name: "dropped.txt".into(), bytes: None }], DropTarget::Elsewhere); + run.sender.dropped(vec![DroppedFile { path: Some(path), name: "dropped.txt".into(), bytes: None }]); run.settle(); assert!(run.app.app.session.doc.plain_text(wordcraft_doc::StoryRef::Body).contains("Dropped words"), "the dropped file opened"); let _ = std::fs::remove_dir_all(dir); diff --git a/crates/ui-egui/Cargo.toml b/crates/ui-egui/Cargo.toml index e6377f0dd9..b49461d5c2 100644 --- a/crates/ui-egui/Cargo.toml +++ b/crates/ui-egui/Cargo.toml @@ -16,7 +16,7 @@ craft = { workspace = true, features = [ "color", "color-ui", "control", "draw", "font-manager", "gpu", "menu", "pages", "print", "review", "table", "text", "text-find", "web-api", "web-host", "window", ] } -craft-fonts-build = { git = "https://github.com/storytold/craft-libs", rev = "b436ae992591173ce53fdb1314421ba2d8897e49" } +craft-fonts-build = { git = "https://github.com/storytold/craft-libs", rev = "0b8bbaf4c842da2d47de7b3fddd7170ba6115541" } wordcraft-geom = { workspace = true, features = ["image"] } wordcraft-doc = { workspace = true } wordcraft-fonts = { workspace = true } @@ -76,7 +76,7 @@ craft-ui-test-kit = { workspace = true } craft = { workspace = true, features = ["ui-testing"] } [build-dependencies] -craft-fonts-build = { git = "https://github.com/storytold/craft-libs", rev = "b436ae992591173ce53fdb1314421ba2d8897e49", features = ["subset"] } +craft-fonts-build = { git = "https://github.com/storytold/craft-libs", rev = "0b8bbaf4c842da2d47de7b3fddd7170ba6115541", features = ["subset"] } serde_json = { workspace = true } toml = "1" diff --git a/crates/ui-egui/src/app/files.rs b/crates/ui-egui/src/app/files.rs index 5ff174b7d6..6e98ba438d 100644 --- a/crates/ui-egui/src/app/files.rs +++ b/crates/ui-egui/src/app/files.rs @@ -1,5 +1,5 @@ use craft::host::{PickId, Picked}; -use craft::platform::open::{DropTarget, DroppedFile, Intake}; +use craft::platform::open::{DroppedFile, Intake}; use craft::quit::{CloseAnswer, CloseGuard, CloseScope, GuardStep}; use craft::ui::dialog::{DialogId, DialogResult, UnsavedChangesDialog}; use craft::ui::shell::embed::CloseDecision; @@ -333,7 +333,7 @@ impl WordApp { // A save that never reached its destination leaves no stamp of it, when the document is as // the save left it (an edit since keeps its own marks and stays unsaved). let mut undone = false; - if !matches!(picked, Picked::Paths(_) | Picked::Downloaded(_)) + if !matches!(picked, Picked::Paths(_) | Picked::Saved { .. } | Picked::Downloaded(_)) && save.document == current && save.rev == self.session.rev() && let Some(undo) = save.undo_stamp.take() @@ -342,7 +342,7 @@ impl WordApp { undone = true; } // A download the browser accepted is a finished save too: the page holds no file of it. - if matches!(picked, Picked::Paths(_) | Picked::Downloaded(_)) { + if matches!(picked, Picked::Paths(_) | Picked::Saved { .. } | Picked::Downloaded(_)) { log::info!("saved {} through the save picker", save.name); // The page now holds the document as that file (a hosted Save As or first Save, S-L159): // the next Save goes back to it. A download names nothing the app could reopen. @@ -385,12 +385,14 @@ impl WordApp { } let result = match picked { // Only when nothing changed since and no later save of it is still unconfirmed. - Picked::Paths(_) | Picked::Downloaded(_) if !self.session.dirty && self.session.rev() == save.rev && !self.save_unconfirmed() => { + Picked::Paths(_) | Picked::Saved { .. } | Picked::Downloaded(_) + if !self.session.dirty && self.session.rev() == save.rev && !self.save_unconfirmed() => + { let step = self.with_guard(|g| g.saved()); self.drive_guard(step, None) } // Edited while the picker was open (those edits may not be written yet): ask again. - Picked::Paths(_) | Picked::Downloaded(_) => { + Picked::Paths(_) | Picked::Saved { .. } | Picked::Downloaded(_) => { let step = self.with_guard(|g| g.retry_after_failure()); self.drive_guard(step, None) } @@ -636,7 +638,7 @@ impl WordApp { let Some(intake) = self.services.intake.as_ref() else { return }; for item in intake.take() { match item { - Intake::Dropped { files, target } => self.open_dropped(&files, target), + Intake::Dropped { files } => self.open_dropped(&files), Intake::Open(paths) | Intake::OpenFor { paths, .. } => { for p in paths { // A path that is not Unicode cannot be passed on as text: skipped. @@ -668,7 +670,7 @@ impl WordApp { /// Route files dropped on the window, in drop order: the one place the drop rules live. A drop /// behind a modal dialog does nothing, since it would insert a picture or open a document /// under it. Every drop target routes by file kind, so `_target` does not change the routing. - pub(crate) fn open_dropped(&mut self, files: &[DroppedFile], _target: DropTarget) { + pub(crate) fn open_dropped(&mut self, files: &[DroppedFile]) { if self.modal_open() { return; } diff --git a/crates/ui-egui/src/chrome/search.rs b/crates/ui-egui/src/chrome/search.rs index 68e21dd7c1..d3c9c124d2 100644 --- a/crates/ui-egui/src/chrome/search.rs +++ b/crates/ui-egui/src/chrome/search.rs @@ -4,9 +4,9 @@ use craft::behavior::IconId; use craft::keymap::CommandRef; use craft::ui::buttons::IconButton; use craft::ui::contract::{Bind, Props as _, Show as _, TooltipSpec}; -use craft::ui::menu::HelpEntry; +use craft::ui::menu::search::{HelpEntry, SearchIndex, SearchWords, Synonyms}; use craft::ui::patterns::panels::{CommandPalette, PaletteFace}; -use craft::ui::runtime::env::{Label, WordTemplate}; +use craft::ui::runtime::env::{Env, Label, WordTemplate}; use craft::ui::runtime::inspect; use egui::Ui; use serde_json::json; @@ -64,7 +64,10 @@ pub(super) fn show(app: &mut WordApp, ui: &mut Ui, compact: bool) -> egui::Rect } rect = Some(button.response.rect); } - let out = CommandPalette::new(name.clone(), &entries, Bind::bound(&mut open)) + let env = Env::of(ui); + let view = env.view(); + let index = SearchIndex::new(&view, &entries, &Synonyms::of(&view.words::())); + let out = CommandPalette::new(name.clone(), &entries, &index, Bind::bound(&mut open)) .face(if compact { PaletteFace::Dialog } else { PaletteFace::InPlace }) .placeholder(Label::from(name.clone())) .suggested((Label::from(tl!("Suggested").to_string()), suggested)) diff --git a/crates/ui-egui/src/colors.rs b/crates/ui-egui/src/colors.rs index 43cc9ba17c..e57a814860 100644 --- a/crates/ui-egui/src/colors.rs +++ b/crates/ui-egui/src/colors.rs @@ -13,7 +13,7 @@ use craft::color_ui::ui::{ColorPickerDialog, ColorPickerDialogLayout, ColorPicke use craft::keymap::CommandRef; use craft::theme::Srgba; use craft::ui::buttons::{SplitButton, SplitMenu}; -use craft::ui::choice::SwatchTable; +use craft::ui::choice::{CellMarks, SwatchTable}; use craft::ui::contract::{BodyCx, Hover, NoValue, Props as _, Show as _, clicked}; use craft::ui::dialog::{DialogId, DialogResult}; use craft::ui::menu::{MenuItem, MenuItemOutput}; @@ -307,7 +307,7 @@ fn swatch_table( let out = SwatchTable::new(name.to_string(), &swatches) .per_row(per_row) .tips(true) - .marked(|i: &usize| colors.get(*i).copied() == current && current.is_some()) + .marks(|i: &usize| CellMarks::default().edge(colors.get(*i).copied() == current && current.is_some())) .show_all(ui); let picked = out.selected.and_then(|i| colors.get(i).copied()); let preview = match out.preview { @@ -490,7 +490,7 @@ fn highlight_body(ui: &mut Ui, app: &mut WordApp, cx: &mut BodyCx<'_>) -> ColorP let out = SwatchTable::new("Highlight Colors".to_string(), &swatches) .per_row(5) .tips(true) - .marked(|i: &usize| shown.get(*i).is_some_and(|(h, _)| h.ooxml() == in_effect)) + .marks(|i: &usize| CellMarks::default().edge(shown.get(*i).is_some_and(|(h, _)| h.ooxml() == in_effect))) .show_all(ui); let mut picked = None; if let Some((h, c)) = out.selected.and_then(|i| shown.get(i)) { diff --git a/crates/ui-egui/src/dialogs/dialogs_chart.rs b/crates/ui-egui/src/dialogs/dialogs_chart.rs index d4099786f1..70c9f98281 100644 --- a/crates/ui-egui/src/dialogs/dialogs_chart.rs +++ b/crates/ui-egui/src/dialogs/dialogs_chart.rs @@ -291,12 +291,12 @@ fn chart_grid(ui: &mut Ui, colors: [Color32; 3], form: &mut ChartTypeForm) -> bo let mut activated = false; for event in out.response.events { match event { - CollectionEvent::Selection(SelectionChange::Set(keys)) => { + CollectionEvent::Selection { change: SelectionChange::Set(keys), .. } => { if let Some(kind) = keys.last().and_then(|k| kinds.get(*k)) { form.kind = *kind; } } - CollectionEvent::Selection(SelectionChange::Toggle(key)) => { + CollectionEvent::Selection { change: SelectionChange::Toggle(key), .. } => { if let Some(kind) = kinds.get(key) { form.kind = *kind; } diff --git a/crates/ui-egui/src/dialogs/dialogs_insert.rs b/crates/ui-egui/src/dialogs/dialogs_insert.rs index 7cc11ea867..3142e828e6 100644 --- a/crates/ui-egui/src/dialogs/dialogs_insert.rs +++ b/crates/ui-egui/src/dialogs/dialogs_insert.rs @@ -107,7 +107,7 @@ pub(super) fn list_index(ui: &mut Ui, label: &Label, rows: &[String], current: O let mut picked = Picked { selected: None, activated: None }; for event in events { match event { - CollectionEvent::Selection(SelectionChange::Set(set)) => picked.selected = set.last().copied(), + CollectionEvent::Selection { change: SelectionChange::Set(set), .. } => picked.selected = set.last().copied(), CollectionEvent::Activate(row) => { picked.selected = Some(row); picked.activated = Some(row); diff --git a/crates/ui-egui/src/dialogs/dialogs_insert/symbol.rs b/crates/ui-egui/src/dialogs/dialogs_insert/symbol.rs index 03cc4aee37..9c6f5657b5 100644 --- a/crates/ui-egui/src/dialogs/dialogs_insert/symbol.rs +++ b/crates/ui-egui/src/dialogs/dialogs_insert/symbol.rs @@ -501,7 +501,7 @@ fn symbol_body( &mut |t, _| Tab::new(word(if *t == 0 { "Symbols" } else { "Special Characters" })), ); for event in out.response.events { - if let CollectionEvent::Selection(SelectionChange::Set(keys)) = event + if let CollectionEvent::Selection { change: SelectionChange::Set(keys), .. } = event && let Some(t) = keys.last() { form.tab = *t; @@ -570,7 +570,7 @@ fn special_table(ui: &mut Ui, form: &mut SymbolForm) -> bool { let mut activated = false; for event in events { match event { - CollectionEvent::Selection(SelectionChange::Set(set)) => { + CollectionEvent::Selection { change: SelectionChange::Set(set), .. } => { if let Some(at) = set.last() { form.special = *at; } @@ -655,7 +655,7 @@ fn recent_row(ui: &mut Ui, form: &mut SymbolForm, dark: bool) { .events }; for event in events { - if let CollectionEvent::Selection(SelectionChange::Set(rows)) = event + if let CollectionEvent::Selection { change: SelectionChange::Set(rows), .. } = event && let Some(r) = rows.last().and_then(|i| form.recent.get(*i)).cloned() && let Some(c) = r.ch.chars().next() { @@ -702,7 +702,7 @@ fn glyph_grid(ui: &mut Ui, form: &mut SymbolForm, dark: bool) -> bool { let (mut picked, mut activated) = (None, false); for event in events { match event { - CollectionEvent::Selection(SelectionChange::Set(rows)) => picked = rows.last().copied().or(picked), + CollectionEvent::Selection { change: SelectionChange::Set(rows), .. } => picked = rows.last().copied().or(picked), CollectionEvent::Activate(row) => { picked = Some(row); activated = true; diff --git a/crates/ui-egui/src/dialogs/dialogs_layout/text.rs b/crates/ui-egui/src/dialogs/dialogs_layout/text.rs index 57c136b035..0bf20b4565 100644 --- a/crates/ui-egui/src/dialogs/dialogs_layout/text.rs +++ b/crates/ui-egui/src/dialogs/dialogs_layout/text.rs @@ -452,8 +452,8 @@ impl WordForm for LanguageForm { .show_items(ui, &source, &mut |i, _| ListRow::new(Label::from(list.get(*i).map(|(_, n)| n.clone()).unwrap_or_default()))); // A language is always chosen: a Clear leaves it, and a Toggle of the chosen row picks it again. let picked = shown.events.into_iter().find_map(|event| match event { - CollectionEvent::Selection(SelectionChange::Set(keys)) => keys.last().copied(), - CollectionEvent::Selection(SelectionChange::Toggle(key)) => Some(key), + CollectionEvent::Selection { change: SelectionChange::Set(keys), .. } => keys.last().copied(), + CollectionEvent::Selection { change: SelectionChange::Toggle(key), .. } => Some(key), _ => None, }); if let Some((tag, _)) = picked.and_then(|i| list.get(i)) { diff --git a/crates/ui-egui/src/dialogs/dialogs_lists.rs b/crates/ui-egui/src/dialogs/dialogs_lists.rs index 18a4d12a02..47cd0dd854 100644 --- a/crates/ui-egui/src/dialogs/dialogs_lists.rs +++ b/crates/ui-egui/src/dialogs/dialogs_lists.rs @@ -272,7 +272,7 @@ impl ListForm { .show_items(ui, &source, &mut |at, _| ListRow::new((*at + 1).to_string())) .events; for event in events { - if let CollectionEvent::Selection(SelectionChange::Set(keys)) = event + if let CollectionEvent::Selection { change: SelectionChange::Set(keys), .. } = event && let Some(chosen) = keys.last() { self.level = *chosen; diff --git a/crates/ui-egui/src/dialogs/dialogs_para.rs b/crates/ui-egui/src/dialogs/dialogs_para.rs index 5135abba1a..c7de1258b6 100644 --- a/crates/ui-egui/src/dialogs/dialogs_para.rs +++ b/crates/ui-egui/src/dialogs/dialogs_para.rs @@ -446,7 +446,7 @@ impl BordersForm { let out = strip .show_items(ui, &source, &mut |key, _| Tab::new(tabs.iter().find(|tab| tab.0 == *key).map_or_else(String::new, |tab| tab.1.clone()))); for event in out.response.events { - if let CollectionEvent::Selection(SelectionChange::Set(keys)) = event + if let CollectionEvent::Selection { change: SelectionChange::Set(keys), .. } = event && let Some(chosen) = keys.last() { self.tab = *chosen; diff --git a/crates/ui-egui/src/dialogs/dialogs_refs/sources.rs b/crates/ui-egui/src/dialogs/dialogs_refs/sources.rs index 2eb72d9be6..e04c893167 100644 --- a/crates/ui-egui/src/dialogs/dialogs_refs/sources.rs +++ b/crates/ui-egui/src/dialogs/dialogs_refs/sources.rs @@ -313,11 +313,11 @@ impl WordForm for SourceManagerForm { .show_items(ui, &source, &mut |i, _| ListRow::new(Label::from(rows.get(*i).cloned().unwrap_or_default()))); for event in shown.events { match event { - CollectionEvent::Selection(SelectionChange::Set(keys)) => self.selected = keys.last().copied(), - CollectionEvent::Selection(SelectionChange::Toggle(key)) => { + CollectionEvent::Selection { change: SelectionChange::Set(keys), .. } => self.selected = keys.last().copied(), + CollectionEvent::Selection { change: SelectionChange::Toggle(key), .. } => { self.selected = if self.selected == Some(key) { None } else { Some(key) }; } - CollectionEvent::Selection(SelectionChange::Clear) => self.selected = None, + CollectionEvent::Selection { change: SelectionChange::Clear, .. } => self.selected = None, _ => {} } } diff --git a/crates/ui-egui/src/dialogs/dialogs_refs/toc.rs b/crates/ui-egui/src/dialogs/dialogs_refs/toc.rs index 5dabb099e6..a4d9f743ee 100644 --- a/crates/ui-egui/src/dialogs/dialogs_refs/toc.rs +++ b/crates/ui-egui/src/dialogs/dialogs_refs/toc.rs @@ -322,8 +322,8 @@ impl WordForm for TocStylesForm { // A level is always picked: Clear and a Toggle off keep the current one. for event in shown.events { let picked = match event { - CollectionEvent::Selection(SelectionChange::Set(keys)) => keys.last().copied(), - CollectionEvent::Selection(SelectionChange::Toggle(key)) => Some(key), + CollectionEvent::Selection { change: SelectionChange::Set(keys), .. } => keys.last().copied(), + CollectionEvent::Selection { change: SelectionChange::Toggle(key), .. } => Some(key), _ => None, }; if let Some(at) = picked { diff --git a/crates/ui-egui/src/dialogs/dialogs_review.rs b/crates/ui-egui/src/dialogs/dialogs_review.rs index 56f9be1b61..3f036876fe 100644 --- a/crates/ui-egui/src/dialogs/dialogs_review.rs +++ b/crates/ui-egui/src/dialogs/dialogs_review.rs @@ -401,7 +401,7 @@ fn list_table(ui: &mut Ui, name: &str, rows: &[(String, String)], second: bool, }); let mut picked = None; for event in out.events { - if let CollectionEvent::Selection(SelectionChange::Set(keys)) = event + if let CollectionEvent::Selection { change: SelectionChange::Set(keys), .. } = event && let Some(key) = keys.into_iter().last() { picked = Some(key); @@ -560,7 +560,7 @@ impl WordForm for AutoCorrectForm { .natural_height(true) .show_items(ui, &source, &mut |key, _| Tab::new(tab_name(*key))); for event in strip.response.events { - if let CollectionEvent::Selection(SelectionChange::Set(keys)) = event + if let CollectionEvent::Selection { change: SelectionChange::Set(keys), .. } = event && let Some(key) = keys.into_iter().last() { self.tab = key.min(2); diff --git a/crates/ui-egui/src/dialogs/dialogs_ribbon.rs b/crates/ui-egui/src/dialogs/dialogs_ribbon.rs index 591559d00e..523cbb421c 100644 --- a/crates/ui-egui/src/dialogs/dialogs_ribbon.rs +++ b/crates/ui-egui/src/dialogs/dialogs_ribbon.rs @@ -190,7 +190,7 @@ impl RibbonDialog { &mut |page, _| Tab::new(tabs.iter().find(|tab| tab.0 == *page).map_or_else(String::new, |tab| tab.1.clone())), ); for event in out.response.events { - if let CollectionEvent::Selection(SelectionChange::Set(pages)) = event + if let CollectionEvent::Selection { change: SelectionChange::Set(pages), .. } = event && let Some(page) = pages.last() && *page != self.page { diff --git a/crates/ui-egui/src/dialogs/dialogs_smart_art.rs b/crates/ui-egui/src/dialogs/dialogs_smart_art.rs index 0bdc163099..e71632abfd 100644 --- a/crates/ui-egui/src/dialogs/dialogs_smart_art.rs +++ b/crates/ui-egui/src/dialogs/dialogs_smart_art.rs @@ -300,8 +300,8 @@ fn category_list(ui: &mut Ui, form: &mut SmartArtForm) { .show_items(ui, &keyed(&positions, |i| *i), &mut |key, _| ListRow::new(tl!(CATEGORIES.get(*key).copied().unwrap_or("All")).to_string())); for event in out.events { let picked = match event { - CollectionEvent::Selection(SelectionChange::Set(keys)) => keys.last().copied(), - CollectionEvent::Selection(SelectionChange::Toggle(key)) => Some(key), + CollectionEvent::Selection { change: SelectionChange::Set(keys), .. } => keys.last().copied(), + CollectionEvent::Selection { change: SelectionChange::Toggle(key), .. } => Some(key), _ => None, }; if let Some(category) = picked.and_then(|k| CATEGORIES.get(k)) { @@ -333,12 +333,12 @@ fn layout_tiles(ui: &mut Ui, theme: &[Rgb], form: &mut SmartArtForm) -> bool { let mut activated = false; for event in out.response.events { match event { - CollectionEvent::Selection(SelectionChange::Set(keys)) => { + CollectionEvent::Selection { change: SelectionChange::Set(keys), .. } => { if let Some(layout) = keys.last().and_then(|k| shown.get(*k)) { form.layout = *layout; } } - CollectionEvent::Selection(SelectionChange::Toggle(key)) => { + CollectionEvent::Selection { change: SelectionChange::Toggle(key), .. } => { if let Some(layout) = shown.get(key) { form.layout = *layout; } @@ -429,7 +429,7 @@ pub fn frame_button(app: &mut WordApp, ui: &mut Ui, pages: &[PlacedPage], layout ]; let area = ui.max_rect(); let shown = TaskBar::selection(tl!("Text Pane").to_string(), &corners) - .side(Side::Start) + .side(Side::Start, craft::behavior::overlay::Align::Center) .dismiss(TaskBarDismiss::Keep) .show(ui, area, |ui, _| IconButton::new(IconId::new("textPane")).label(tl!("Text Pane").to_string()).show(ui).clicked()); if shown.inner == Some(true) { diff --git a/crates/ui-egui/src/dialogs/dialogs_templates.rs b/crates/ui-egui/src/dialogs/dialogs_templates.rs index 835ca864e5..ad9d2183cb 100644 --- a/crates/ui-egui/src/dialogs/dialogs_templates.rs +++ b/crates/ui-egui/src/dialogs/dialogs_templates.rs @@ -254,7 +254,7 @@ impl OrganizerDialog { }); for event in out.events { match event { - CollectionEvent::Selection(SelectionChange::Set(keys)) => { + CollectionEvent::Selection { change: SelectionChange::Set(keys), .. } => { if let Some(key) = keys.last() { self.left = key.clone(); } @@ -285,7 +285,7 @@ impl OrganizerDialog { ListRow::new(label(n)).lead_text(label(glyph(ty)), label("¶")) }); for event in out.events { - if let CollectionEvent::Selection(SelectionChange::Set(keys)) = event + if let CollectionEvent::Selection { change: SelectionChange::Set(keys), .. } = event && let Some(key) = keys.last() { self.right = key.clone(); diff --git a/crates/ui-egui/src/dialogs/merge_dialogs.rs b/crates/ui-egui/src/dialogs/merge_dialogs.rs index 53489475a4..070834551c 100644 --- a/crates/ui-egui/src/dialogs/merge_dialogs.rs +++ b/crates/ui-egui/src/dialogs/merge_dialogs.rs @@ -62,12 +62,12 @@ fn pick_name(ui: &mut egui::Ui, label: &str, names: &[String], current: &str) -> let mut activated = false; for e in response.events { match e { - CollectionEvent::Selection(SelectionChange::Set(keys)) => { + CollectionEvent::Selection { change: SelectionChange::Set(keys), .. } => { if let Some(n) = keys.first().and_then(|k| names.get(*k)) { picked = Some(n.clone()); } } - CollectionEvent::Selection(SelectionChange::Toggle(k)) => { + CollectionEvent::Selection { change: SelectionChange::Toggle(k), .. } => { if let Some(n) = names.get(k) { picked = Some(n.clone()); } diff --git a/crates/ui-egui/src/dialogs/search_commands.rs b/crates/ui-egui/src/dialogs/search_commands.rs index ca7f733f6d..67001902b0 100644 --- a/crates/ui-egui/src/dialogs/search_commands.rs +++ b/crates/ui-egui/src/dialogs/search_commands.rs @@ -4,9 +4,9 @@ use craft::keymap::CommandRef; use craft::ui::contract::Bind; use craft::ui::dialog::{DialogId, DialogResult, DialogStack, StackDialog, dialog_id}; -use craft::ui::menu::HelpEntry; +use craft::ui::menu::search::{HelpEntry, SearchIndex, SearchWords, Synonyms}; use craft::ui::patterns::panels::CommandPalette; -use craft::ui::runtime::env::{Label, WordTemplate}; +use craft::ui::runtime::env::{Env, Label, WordTemplate}; use serde_json::Value; use super::find::{SEARCH_SUGGESTIONS, find_in_navigation_pane}; @@ -46,7 +46,10 @@ impl StackDialog for SearchCommandsDialog { } fn show(&mut self, ui: &mut egui::Ui, _: &DialogStack) -> Option>> { - let out = CommandPalette::new(tl!("Search Commands"), &self.entries, Bind::bound(&mut self.open)) + let env = Env::of(ui); + let view = env.view(); + let index = SearchIndex::new(&view, &self.entries, &Synonyms::of(&view.words::())); + let out = CommandPalette::new(tl!("Search Commands"), &self.entries, &index, Bind::bound(&mut self.open)) .suggested((Label::from(tl!("Suggested")), self.suggested.clone())) .fallback(self.fallback.clone()) .show(ui); diff --git a/crates/ui-egui/src/dialogs/styles.rs b/crates/ui-egui/src/dialogs/styles.rs index 4f51044387..7131a12d73 100644 --- a/crates/ui-egui/src/dialogs/styles.rs +++ b/crates/ui-egui/src/dialogs/styles.rs @@ -161,7 +161,7 @@ impl ManageStylesDialog { }); for event in out.events { match event { - CollectionEvent::Selection(SelectionChange::Set(keys)) => { + CollectionEvent::Selection { change: SelectionChange::Set(keys), .. } => { if let Some(key) = keys.last() { self.selected = key.clone(); } diff --git a/crates/ui-egui/src/dialogs/tests.rs b/crates/ui-egui/src/dialogs/tests.rs index d0d25dc570..b01cd9d1d0 100644 --- a/crates/ui-egui/src/dialogs/tests.rs +++ b/crates/ui-egui/src/dialogs/tests.rs @@ -898,8 +898,8 @@ fn replace_all_with_regex_groups_from_the_dialog() { h.run_steps(2); h.state_mut().run("ui.dialog", json!({"name": "replace"})).unwrap(); h.run_steps(2); - set_field(&mut h, "find", "query", json!(r"(?\w+), (\w+)")); // PLAN: assumed key `find` for the Find and Replace dialog - set_field(&mut h, "find", "with", json!(with)); + set_field(&mut h, "find", "find", json!(r"(?\w+), (\w+)")); // PLAN: assumed key `find` for the Find and Replace dialog + set_field(&mut h, "find", "replace", json!(with)); set_field(&mut h, "find", "regex", json!(true)); h.get_by_label("Replace All").click(); h.run_steps(2); diff --git a/crates/ui-egui/src/file_dialogs.rs b/crates/ui-egui/src/file_dialogs.rs index 28c59c3296..fd42a3a0c3 100644 --- a/crates/ui-egui/src/file_dialogs.rs +++ b/crates/ui-egui/src/file_dialogs.rs @@ -162,6 +162,7 @@ impl WordApp { let paths = paths.iter().map(|p| p.to_string_lossy().into_owned()).collect(); Some(self.finish_picks(d.after, paths)) } + Picked::Saved { path, .. } => Some(self.finish_picks(d.after, vec![path.to_string_lossy().into_owned()])), Picked::Contents(files) => Some(self.finish_contents(d.after, files)), // The page handed the save over as a download: the save finishes under that name, which // the engine answers with `downloaded`, and the document keeps the file it had. @@ -537,7 +538,7 @@ mod picture_dispatch_tests { use std::sync::Arc; use craft::host::{AppInfo, Host, Picked, ScriptedFiles}; - use craft::platform::open::{DropTarget, DroppedFile, FileIntake}; + use craft::platform::open::{DroppedFile, FileIntake}; use super::*; @@ -568,7 +569,7 @@ mod picture_dispatch_tests { let services = crate::Services { intake: Some(intake), ..Default::default() }; let mut dropped = WordApp::new(wordcraft_engine::Session::new(wordcraft_doc::Document::new()), services); let document = dropped.session.document_id(); - sender.dropped(vec![DroppedFile { path: None, name, bytes: Some(bytes.into()) }], DropTarget::Elsewhere); + sender.dropped(vec![DroppedFile { path: None, name, bytes: Some(bytes.into()) }]); dropped.drain_inbox(); assert_eq!(dropped.session.document_id(), document, "drop inserts into the current document: {ext}"); let pictures = dropped.session.run("arrange.selectionPane", &json!({})).unwrap(); diff --git a/crates/ui-egui/src/file_dialogs/tests.rs b/crates/ui-egui/src/file_dialogs/tests.rs index 4ce25d9149..a4a00dd0d5 100644 --- a/crates/ui-egui/src/file_dialogs/tests.rs +++ b/crates/ui-egui/src/file_dialogs/tests.rs @@ -455,7 +455,7 @@ fn failed_web_saves_restore_the_save_stamps() { assert_eq!(a.session.path, path_before, "{id}: {name}"); } // The browser takes the download: the scripted host files its bytes under the name it answers with. - let files = Arc::new(ScriptedFiles::answering([Picked::Paths(vec![PathBuf::from("draft.docx")])]).in_browser()); + let files = Arc::new(ScriptedFiles::answering([Picked::Saved { path: PathBuf::from("draft.docx"), file_type: None }]).in_browser()); let mut a = app_over(&files, wordcraft_doc::Document::from_text(UNSAVED)); a.session.dirty = true; let revision_before = a.session.doc.core.revision; @@ -488,7 +488,7 @@ fn web_pdf_export_keeps_an_existing_suffix_in_any_case() { ("Report", "Report.pdf"), ] { // The browser takes the download: the scripted host files its bytes under the name it answers with. - files.queue(Picked::Paths(vec![PathBuf::from(expected)])); + files.queue(Picked::Saved { path: PathBuf::from(expected), file_type: None }); let result = a.execute("file.exportPdf", json!({"path": name})).unwrap(); assert_eq!(result["downloaded"], expected, "{name}"); assert!(files.file(std::path::Path::new(expected)).is_some_and(|b| b.starts_with(b"%PDF")), "{name}"); diff --git a/crates/ui-egui/src/keys/canvas.rs b/crates/ui-egui/src/keys/canvas.rs index 8c979c2909..080e08392f 100644 --- a/crates/ui-egui/src/keys/canvas.rs +++ b/crates/ui-egui/src/keys/canvas.rs @@ -88,7 +88,7 @@ pub fn page_input(app: &mut WordApp, inputs: &[EditorInput], pass: &ToolPass, ct // Enter and Escape leave crop mode keeping the crop (`crop` docs). The canvas takes the page's // keys as editor input before the crop overlay's own pass reads its Submit and Cancel, so they // end it here, and neither types a paragraph over the selected picture. - if matches!(e, EditorInput::Newline | EditorInput::Cancel) && crate::crop::active(app).is_some() { + if matches!(e, EditorInput::Newline { .. } | EditorInput::Cancel) && crate::crop::active(app).is_some() { crate::crop::leave(app); continue; } @@ -112,7 +112,7 @@ fn is_key_input(e: &EditorInput) -> bool { EditorInput::Move(..) | EditorInput::Delete { .. } | EditorInput::Edit(_) - | EditorInput::Newline + | EditorInput::Newline { .. } | EditorInput::Tab | EditorInput::BackTab | EditorInput::Cancel @@ -306,7 +306,7 @@ fn equation_input(app: &mut WordApp, ctx: &egui::Context, pass: &ToolPass, e: &E let _ = app.run(if *forward { "equation.delete" } else { "equation.backspace" }, json!({})); true } - EditorInput::Newline => { + EditorInput::Newline { .. } => { let _ = app.run("equation.enter", json!({})); true } @@ -518,7 +518,7 @@ fn handle_input(app: &mut WordApp, ctx: &egui::Context, pass: &ToolPass, e: &Edi }; let _ = app.run(id, json!({})); } - EditorInput::Newline => { + EditorInput::Newline { .. } => { if !crate::objects::key(app, Key::Enter, Modifiers::NONE) { let _ = app.run("text.newParagraph", json!({})); } diff --git a/crates/ui-egui/src/keys/tests.rs b/crates/ui-egui/src/keys/tests.rs index d2f16a5c8b..6923e55e12 100644 --- a/crates/ui-egui/src/keys/tests.rs +++ b/crates/ui-egui/src/keys/tests.rs @@ -292,7 +292,7 @@ fn the_ignored_paste_uses_up_its_paste_modifiers() { let mut h = app_harness(copied_bold_app()); let chord = Modifiers { shift: true, ..mod_held() }; batch_frame(&mut h, vec![egui::Event::ModifiersChanged(chord), key_event(Key::V, true, chord), egui::Event::Paste("x".into())]); - crate::test_harness::frame(&mut h); + batch_frame(&mut h, vec![key_event(Key::V, false, Modifiers::NONE), egui::Event::ModifiersChanged(Modifiers::NONE)]); assert_eq!(body(h.state()), "source target"); assert!(is_bold(&mut h)); run(&mut h, "select.text", json!({"text": "target"})); diff --git a/crates/ui-egui/src/mini_toolbar/tests.rs b/crates/ui-egui/src/mini_toolbar/tests.rs index ccbbd70a00..fc2b99439c 100644 --- a/crates/ui-egui/src/mini_toolbar/tests.rs +++ b/crates/ui-egui/src/mini_toolbar/tests.rs @@ -352,10 +352,26 @@ fn hovering_a_bar_member_previews_its_command() { h.get_by_label("20").rect().center() } Member::Font => { + // `FontPicker` scans `Catalog::global()` on a background thread; wait until ready so the + // chevron click isn't ignored while the picker is still disabled in a fresh test process. + let catalog = craft::font_manager::Catalog::global(); + catalog.scan_in_background(); + let deadline = std::time::Instant::now() + std::time::Duration::from_secs(10); + while !catalog.is_ready() && std::time::Instant::now() < deadline { + std::thread::sleep(std::time::Duration::from_millis(10)); + } + assert!(catalog.is_ready(), "font catalog finished scanning"); + steps(&mut h); let b = font_box(&h); - // The font picker's chevron is an adornment inside the field and a click on the name opens the list - // too, so click the field itself (the size box's chevron lies beside it). - click_at(&mut h, b.center()); + let c = canvas(&h); + // A click on a Plain picker's name only selects it (craft-libs #3103); the chevron opens the list. + let chevron = h + .query_all_by_label("Fonts") + .map(|n| n.rect()) + .filter(|r| c.contains_rect(*r)) + .min_by(|a, z| a.center().distance(b.center()).total_cmp(&z.center().distance(b.center()))) + .expect("the font box's chevron"); + click_at(&mut h, chevron.center()); // The framework's font list is a tree of families (depth rows), so its rows are tree items. h.query_all_by_role(Role::TreeItem) .filter(|n| { diff --git a/crates/ui-egui/src/objects.rs b/crates/ui-egui/src/objects.rs index afdbcccedf..19f7f3f592 100644 --- a/crates/ui-egui/src/objects.rs +++ b/crates/ui-egui/src/objects.rs @@ -110,6 +110,9 @@ pub(crate) struct ObjectGesture { /// copy's axis lock). Alt is not part of it: letting Alt go just before the release must not snap an /// object that was placed freely while Alt was held. last_mods: (bool, bool), + /// The pointer position and Alt state at the last move: releasing Alt with the pointer still + /// must not re-snap the object when a modifier change stirs the pass. + last_at: (Pos2, bool), /// Moving an In Line with Text object: where it lands. drop_at: Option, preview: Option, @@ -472,6 +475,7 @@ impl ObjectGesture { pending_behind: false, copy: false, last_mods: (false, false), + last_at: (Pos2::ZERO, false), drop_at: None, preview: None, } @@ -605,6 +609,11 @@ impl ObjectGesture { app.canvas.cancel_text_drag(); self.pending_behind = false; } + let alt_released = self.moved && self.last_at == (p.pos, true) && !p.mods.alt && self.last_mods == (p.mods.shift, p.mods.cmd); + self.last_at = (p.pos, p.mods.alt); + if alt_released { + return; + } self.moved = true; self.last_mods = (p.mods.shift, p.mods.cmd); self.copy = p.mods.cmd && object.member.is_none(); diff --git a/crates/ui-egui/src/panes/nav.rs b/crates/ui-egui/src/panes/nav.rs index 544361f08c..d1de2915d7 100644 --- a/crates/ui-egui/src/panes/nav.rs +++ b/crates/ui-egui/src/panes/nav.rs @@ -94,7 +94,7 @@ fn tabs(app: &mut WordApp, ui: &mut Ui) { /// The key a selection event picked, if it picked one row. fn picked_row(event: &CollectionEvent) -> Option { match event { - CollectionEvent::Selection(SelectionChange::Set(keys)) => keys.first().copied(), + CollectionEvent::Selection { change: SelectionChange::Set(keys), .. } => keys.first().copied(), CollectionEvent::Activate(key) => Some(*key), _ => None, } diff --git a/crates/ui-egui/src/panes/side.rs b/crates/ui-egui/src/panes/side.rs index 4f2cbdce7d..38b4cd675c 100644 --- a/crates/ui-egui/src/panes/side.rs +++ b/crates/ui-egui/src/panes/side.rs @@ -125,7 +125,7 @@ pub(super) fn styles(app: &mut WordApp, ui: &mut Ui) { let mut asked = None; for event in &out.events { match event { - CollectionEvent::Selection(SelectionChange::Set(keys)) => { + CollectionEvent::Selection { change: SelectionChange::Set(keys), .. } => { if let Some((id, ..)) = keys.first().and_then(|k| list.get(*k)) { let _ = app.run("para.style", json!({"style": id})); app.canvas.focus_page(&ctx); diff --git a/crates/ui-egui/src/ribbon/charts.rs b/crates/ui-egui/src/ribbon/charts.rs index 4194873ce2..f04fc48b4e 100644 --- a/crates/ui-egui/src/ribbon/charts.rs +++ b/crates/ui-egui/src/ribbon/charts.rs @@ -6,6 +6,7 @@ use craft::ui::contract::{Gap, Props as _, Show as _, ShowContainer as _}; use craft::ui::layout_components::Stack; use craft::ui::list::ThumbAspect; use craft::ui::menu::MenuItem; +use craft::ui::primitives::FacePaint; use craft::ui::tile_grid::{CaptionPlace, Tile}; use super::common::{menu_button, size_field}; @@ -77,18 +78,24 @@ pub(super) fn smart_art_design(row: &mut RibbonRow<'_>, app: &mut WordApp) { let face = Button::new(tl!("Change\nColors").to_string()).icon(IconId::new("smartArtColors")).arrangement(Arrangement::Stacked); let _ = menu_button(ui, face, tl!("Change\nColors").to_string(), None, |ui, _| { let custom = g.has_custom_colors(); - for colors in SmartArtColors::ALL { + for (idx, colors) in SmartArtColors::ALL.into_iter().enumerate() { + let theme = theme.clone(); MenuItem::command(CommandRef::with_params("smartArt.colors", json!({"variant": colors.id()}))) .label(crate::dialogs_smart_art::colors_label(colors)) .radio_mark(g.colors == colors && !custom) - .sample(move |cx, r| crate::dialogs_smart_art::swatches(cx, r, colors, theme)) + .sample( + ThumbAspect::new(2, 1), + FacePaint::new(idx as u64, move |cx, r| crate::dialogs_smart_art::swatches(cx, r, colors, &theme)), + ) .show(ui); } // Active while items carry their own colours; set in the Text Pane. + let theme = theme.clone(); + let g = g.clone(); let mut row = MenuItem::new(tl!("Custom").to_string()) .enabled(custom) .radio_mark(custom) - .sample(move |cx, r| crate::dialogs_smart_art::custom_swatches(cx, r, g, theme)); + .sample(ThumbAspect::new(2, 1), FacePaint::new(0x100, move |cx, r| crate::dialogs_smart_art::custom_swatches(cx, r, &g, &theme))); if !custom { row = row.tooltip(tl!("Set the colors in the Text Pane to use custom colors.").to_string()); } diff --git a/crates/ui-egui/src/ribbon/common.rs b/crates/ui-egui/src/ribbon/common.rs index d6b479d563..0963341b70 100644 --- a/crates/ui-egui/src/ribbon/common.rs +++ b/crates/ui-egui/src/ribbon/common.rs @@ -7,8 +7,9 @@ use craft::ui::contract::{Bind, BodyCx, Gap, Props as _, Show as _, ShowContaine use craft::ui::controls::disclosure::DisclosureGlyph; use craft::ui::display::Divider; use craft::ui::layout_components::{Row, Stack}; +use craft::ui::list::ThumbAspect; use craft::ui::menu::{Menu, MenuItem, MenuOutput}; -use craft::ui::primitives::IconSpec; +use craft::ui::primitives::{FacePaint, IconSpec}; use craft::ui::runtime::env::Label; use craft::ui::text::NumberField; @@ -133,10 +134,13 @@ pub(crate) fn weight_menu(ui: &mut Ui, _app: &mut WordApp, id: &str, current: Op MenuItem::command(CommandRef::with_params(id, params(w))) .label(label) .check(checked) - .sample(move |cx, rect| { - let y = rect.center().y; - cx.painter.line_segment([egui::pos2(rect.left(), y), egui::pos2(rect.right(), y)], egui::Stroke::new(w.max(pixel), cx.ink())); - }) + .sample( + ThumbAspect::new(3, 1), + FacePaint::new(u64::from(w.to_bits()), move |cx, rect| { + let y = rect.center().y; + cx.painter.line_segment([egui::pos2(rect.left(), y), egui::pos2(rect.right(), y)], egui::Stroke::new(w.max(pixel), cx.ink())); + }), + ) .show(ui); } } diff --git a/crates/ui-egui/src/ribbon/underline.rs b/crates/ui-egui/src/ribbon/underline.rs index 30c4bcdc9a..6500bee0af 100644 --- a/crates/ui-egui/src/ribbon/underline.rs +++ b/crates/ui-egui/src/ribbon/underline.rs @@ -1,7 +1,9 @@ use craft::menu::CommandRef; use craft::ui::contract::{Props as _, Show as _}; use craft::ui::display::Divider; +use craft::ui::list::ThumbAspect; use craft::ui::menu::{Menu, MenuItem}; +use craft::ui::primitives::FacePaint; use egui::{Rect, Stroke, pos2}; @@ -23,12 +25,12 @@ pub(super) const UNDERLINE_STYLES: [(&str, &str); 8] = [ /// Home › Font › Underline's drop-down (#2738): a sample of each line, Words only, None, More /// Underlines… (the Font dialog) and Underline Color. pub(super) fn underline_menu(ui: &mut Ui, app: &mut WordApp) { - for (style, name) in UNDERLINE_STYLES { + for (idx, (style, name)) in UNDERLINE_STYLES.into_iter().enumerate() { // The sample stands for the label; the name is the tooltip and what assistive technology reads. MenuItem::command(CommandRef::with_params("format.underline", json!({"style": style}))) .label(tl!(name).to_string()) .tooltip(tl!(name).to_string()) - .sample(move |cx, r| paint_underline(&cx.painter, r, style, cx.ink())) + .sample(ThumbAspect::new(4, 1), FacePaint::new(idx as u64, move |cx, r| paint_underline(&cx.painter, r, style, cx.ink()))) .sample_only() .hide_shortcut() .show(ui); diff --git a/crates/ui-egui/src/tests.rs b/crates/ui-egui/src/tests.rs index 7d3308c7cd..a9abd0f2e4 100644 --- a/crates/ui-egui/src/tests.rs +++ b/crates/ui-egui/src/tests.rs @@ -5,7 +5,7 @@ use craft::automation::control::{ControlRequest, Reply}; use craft::host::{PickId, PickKind, PickRequest, Picked, ScriptedFiles}; use craft::platform::clock::monotonic_ms; use craft::platform::default_app::{DefaultApp, DefaultAppError}; -use craft::platform::open::{DropTarget, DroppedFile, FileIntake}; +use craft::platform::open::{DroppedFile, FileIntake}; use craft::ui::shell::ScreenMode; use std::sync::Arc; @@ -102,6 +102,7 @@ type Rig = egui_kittest::Harness<'static, WordApp>; /// runs it before the second (`raw_input_hook`), as on the desktop. fn press(h: &mut Rig, key: egui::Key, modifiers: egui::Modifiers) { h.event(egui::Event::Key { key, physical_key: None, pressed: true, repeat: false, modifiers }); + h.event(egui::Event::Key { key, physical_key: None, pressed: false, repeat: false, modifiers }); h.step(); h.step(); } @@ -283,10 +284,12 @@ fn row_mod_shift_0_resets_the_interface_size_unless_bound() { h.event(egui::Event::Key { key: egui::Key::Num0, physical_key: None, pressed: true, repeat: false, modifiers: altgr }); h.event(egui::Event::ModifiersChanged(altgr)); h.event(egui::Event::Text("}".into())); + h.event(egui::Event::Key { key: egui::Key::Num0, physical_key: None, pressed: false, repeat: false, modifiers: altgr }); h.step(); assert_eq!(h.state().ui.interface_size.percent(), Some(300), "AltGr+0 doesn't reset"); assert_eq!(body_text(h.state()), "}", "AltGr+0 types the character"); h.event(egui::Event::Key { key: egui::Key::Num0, physical_key: Some(egui::Key::Num0), pressed: true, repeat: false, modifiers: chord }); + h.event(egui::Event::Key { key: egui::Key::Num0, physical_key: Some(egui::Key::Num0), pressed: false, repeat: false, modifiers: chord }); h.step(); h.step(); assert!(h.state().ui.interface_size.is_auto(), "Ctrl+Shift+0 returns to Auto"); @@ -295,6 +298,7 @@ fn row_mod_shift_0_resets_the_interface_size_unless_bound() { // PLAN(shell-w7): sh.A11 `Session::keymap_mut` over `Overrides::insert`. h.state_mut().session.keymap_mut().insert("view.focus", vec!["Mod+Shift+0".into()]); h.event(egui::Event::Key { key: egui::Key::Num0, physical_key: Some(egui::Key::Num0), pressed: true, repeat: false, modifiers: chord }); + h.event(egui::Event::Key { key: egui::Key::Num0, physical_key: Some(egui::Key::Num0), pressed: false, repeat: false, modifiers: chord }); h.step(); h.step(); assert_eq!(h.state().ui.interface_size.percent(), Some(300), "the size stays"); @@ -612,7 +616,7 @@ impl craft::platform::clipboard::ClipboardBackend for LatePaste { fn drop_files(a: &mut WordApp, files: Vec) { let (intake, sender) = FileIntake::new(craft::host::Wake::none()); a.services.intake = Some(intake); - sender.dropped(files, DropTarget::Elsewhere); + sender.dropped(files); } /// An in-memory dropped file. @@ -2574,7 +2578,7 @@ impl WebSaves { let answered = self.0.answer_to( id, match ended { - Ended::Saved => Picked::Paths(vec![std::path::PathBuf::from("novel.docx")]), + Ended::Saved => Picked::Saved { path: std::path::PathBuf::from("novel.docx"), file_type: None }, Ended::Cancelled => Picked::Cancelled, Ended::Failed(why) => Picked::Failed(why), }, @@ -3381,7 +3385,6 @@ fn f11_and_escape_toggle_full_screen() { for _ in 0..6 { h.step(); } - let key = |key| egui::Event::Key { key, physical_key: None, pressed: true, repeat: false, modifiers: egui::Modifiers::NONE }; // Run frames and return the full-screen requests the window got. let sent = |h: &mut egui_kittest::Harness| { let mut out = Vec::new(); @@ -3392,25 +3395,25 @@ fn f11_and_escape_toggle_full_screen() { out }; assert_eq!(sent(&mut h), vec![], "a normal window to start with"); - h.event(key(egui::Key::F11)); + h.key_press(egui::Key::F11); assert_eq!(sent(&mut h), vec![Fullscreen(true)], "F11"); assert!(h.state().session.view.full_screen); - h.event(key(egui::Key::F11)); + h.key_press(egui::Key::F11); assert_eq!(sent(&mut h), vec![Fullscreen(false)], "F11 again"); assert!(!h.state().session.view.full_screen); // The command (ribbon, command search, agents), then Escape. assert_eq!(h.state_mut().run("view.fullScreen", json!({})).unwrap(), json!({"value": true})); assert_eq!(sent(&mut h), vec![Fullscreen(true)], "the command"); - h.event(key(egui::Key::Escape)); + h.key_press(egui::Key::Escape); assert_eq!(sent(&mut h), vec![Fullscreen(false)], "Escape"); // Escape in a normal window doesn't touch the window. - h.event(key(egui::Key::Escape)); + h.key_press(egui::Key::Escape); assert_eq!(sent(&mut h), vec![]); // Escape closing a dialog leaves full screen alone. h.state_mut().run("view.fullScreen", json!({"value": true})).unwrap(); h.state_mut().run("ui.dialog", json!({"name": "zoom"})).unwrap(); assert_eq!(sent(&mut h), vec![Fullscreen(true)]); - h.event(key(egui::Key::Escape)); + h.key_press(egui::Key::Escape); assert_eq!(sent(&mut h), vec![]); assert!(open_dialog(h.state()).is_none(), "Escape closed the dialog"); assert!(h.state().session.view.full_screen, "and only that"); @@ -3481,7 +3484,6 @@ fn escape_collapses_a_selection_before_leaving_full_screen() { for _ in 0..6 { h.step(); } - let esc = egui::Event::Key { key: egui::Key::Escape, physical_key: None, pressed: true, repeat: false, modifiers: egui::Modifiers::NONE }; let sent = |h: &mut egui_kittest::Harness| { let mut out = Vec::new(); for _ in 0..2 { @@ -3497,11 +3499,11 @@ fn escape_collapses_a_selection_before_leaving_full_screen() { h.state_mut().run("view.fullScreen", json!({"value": true})).unwrap(); assert_eq!(sent(&mut h), vec![Fullscreen(true)]); assert!(!h.state().session.sel.is_collapsed()); - h.event(esc.clone()); + h.key_press(egui::Key::Escape); assert_eq!(sent(&mut h), vec![], "Escape with a selection stays in full screen"); assert!(h.state().session.sel.is_collapsed(), "and collapses the selection"); assert!(h.state().session.view.full_screen); - h.event(esc); + h.key_press(egui::Key::Escape); assert_eq!(sent(&mut h), vec![Fullscreen(false)], "Escape with nothing selected leaves"); assert!(!h.state().session.view.full_screen); } diff --git a/crates/ui-egui/src/tests/chrome.rs b/crates/ui-egui/src/tests/chrome.rs index 8e2fe893a5..cdcbba11ea 100644 --- a/crates/ui-egui/src/tests/chrome.rs +++ b/crates/ui-egui/src/tests/chrome.rs @@ -793,8 +793,16 @@ fn alt_q_opens_search_and_typing_goes_there() { let Some(open) = chord_event(&chord) else { panic!("the chord {chord} names a key egui knows"); }; + let release = |key, modifiers| egui::Event::Key { key, physical_key: None, pressed: false, repeat: false, modifiers }; + let open_release = chord_event(&chord).map(|e| match e { + egui::Event::Key { key, physical_key, modifiers, .. } => egui::Event::Key { key, physical_key, pressed: false, repeat: false, modifiers }, + other => other, + }); // Both in one frame's input, as the platform sends them: kittest's `event` runs a frame for each queued event. h.input_mut().events.extend([open.clone(), egui::Event::Text("q".into())]); + if let Some(rel) = open_release.clone() { + h.input_mut().events.push(rel); + } h.step(); // The chord fires the command in that pass; the app runs it before the next pass (`raw_input_hook`). h.step(); @@ -808,25 +816,30 @@ fn alt_q_opens_search_and_typing_goes_there() { h.step(); assert_eq!(search_text(&h).as_deref(), Some("bold"), "typing goes into the search box"); assert_eq!(h.state().session.doc.plain_text(wordcraft_doc::StoryRef::Body), "Kilns"); - h.event(key(egui::Key::Escape, egui::Modifiers::NONE)); + h.key_press(egui::Key::Escape); h.step(); h.step(); // The framework gives Escape to a field holding a draft first (`overlay/dismissal.rs`): the typed "bold" takes the // first one, and the second closes Search. The old app closed on one. - h.event(key(egui::Key::Escape, egui::Modifiers::NONE)); + h.key_press(egui::Key::Escape); h.step(); h.step(); assert!(!crate::chrome::search::is_open(h.state()), "Escape closes Search"); assert!(!h.state().session.view.full_screen_view); // Words that name no command: Enter finds them in the document, in the Navigation pane. h.event(open); + if let Some(rel) = open_release { + h.event(rel); + } h.step(); h.step(); // Typing sends each key's press before its text. h.event(key(egui::Key::K, egui::Modifiers::SHIFT)); h.event(egui::Event::Text("Kilns".into())); + h.event(release(egui::Key::K, egui::Modifiers::SHIFT)); h.step(); h.event(key(egui::Key::Enter, egui::Modifiers::NONE)); + h.event(release(egui::Key::Enter, egui::Modifiers::NONE)); h.step(); h.step(); assert!(!crate::chrome::search::is_open(h.state()), "Enter ran the search"); diff --git a/crates/ui-egui/src/tests/dialogs.rs b/crates/ui-egui/src/tests/dialogs.rs index 2da0401a00..91f3ec83cc 100644 --- a/crates/ui-egui/src/tests/dialogs.rs +++ b/crates/ui-egui/src/tests/dialogs.rs @@ -430,14 +430,17 @@ fn find_replace_and_go_to_keys_like_word() { h.event(egui::Event::Text("Kilns fire clay. Kilns cool.".into())); h.step(); let nav_query = |h: &egui_kittest::Harness| h.ctx.data(|d| d.get_temp::(h.state().window_id("nav_query"))).unwrap_or_default(); + let release = |key, modifiers| egui::Event::Key { key, physical_key: None, pressed: false, repeat: false, modifiers }; // Ctrl+F: the pane, and typing goes into its search box. h.event(key(egui::Key::F, egui::Modifiers::COMMAND)); + h.event(release(egui::Key::F, egui::Modifiers::COMMAND)); h.step(); h.step(); assert!(h.state().session.view.nav_pane, "the Navigation pane opened"); assert_eq!(h.state().ui.nav_tab, "results", "Find exposes its results (#2096)"); assert!(h.state().dialog_host.open_dialogs().is_empty(), "no dialog: {:?}", open_key(h.state())); h.event(key(egui::Key::C, egui::Modifiers::NONE)); + h.event(release(egui::Key::C, egui::Modifiers::NONE)); h.event(egui::Event::Text("cool".into())); h.step(); h.step(); @@ -460,6 +463,7 @@ fn find_replace_and_go_to_keys_like_word() { h.state_mut().canvas.focus_page(&ctx); h.step(); h.event(key(egui::Key::F, egui::Modifiers::COMMAND)); + h.event(release(egui::Key::F, egui::Modifiers::COMMAND)); h.step(); h.step(); assert_eq!(nav_query(&h), "Kilns"); diff --git a/crates/ui-egui/src/theme/legacy.rs b/crates/ui-egui/src/theme/legacy.rs index 130d1c2d29..9c3666b101 100644 --- a/crates/ui-egui/src/theme/legacy.rs +++ b/crates/ui-egui/src/theme/legacy.rs @@ -783,6 +783,12 @@ mod tests { }, false, ); + // Give the craft runtime the test's mode (#3589 keeps the curve `super::apply` set on that mode's style). + let mode = if dark { craft::theme::ModeChoice::Dark } else { craft::theme::ModeChoice::Light }; + craft::ui::shell::embed::before_input(&h.ctx, |_| { + craft::ui::runtime::frame::FrameInput::new(craft::ui::runtime::env::RootEnv::new().mode(mode)) + }); + h.step(); h.run(); let img = h.render().unwrap(); // Ink: how far each pixel, laid over the background (the window outside the frame is