docs: ADR 0117 (user themes from a folder), the guide, UI guidelines, roadmap, changelog and attribution (M8)

This commit is contained in:
Tanish Manku committed 2026-11-18 06:27:11 -07:00
1 parent 0a5547b6b1
commit f90a3c45c1
8 files changed
+273 -4

No files matched your search

+1
View File
@@ -150,6 +150,7 @@ OR Apache-2.0) is noted in the table.
| Ogg Vorbis decoding | `crates/audio/src/vorbis.rs` | `lewton` (MIT OR Apache-2.0) with `ogg` (BSD-3-Clause); Xiph.Org's open, royalty-free Vorbis I specification | Used as a library, not copied. |
| MP3 (MPEG-1/2 audio layers I–III) decoding | `crates/audio/src/mp3.rs` | `nanomp3` (MIT OR Apache-2.0), a port of minimp3 (CC0) | Used as a library. The MP3 patents have expired; decoding only, no encoder. |
| Animated PNG and animated WebP files: APNG chunks (`acTL`, `fcTL`, `fdAT`), frame regions, blend and dispose ops; the WebP RIFF container (`VP8X`, `ANIM`, `ANMF`) | `crates/engine/src/anim.rs` | The APNG specification (Mozilla; part of W3C *Portable Network Graphics (PNG) Specification*, Third Edition); Google's public *WebP Container Specification* and *WebP Lossless Bitstream Specification*; PNG frame data by the `png` crate (MIT OR Apache-2.0), lossless WebP frames by `image-webp` (MIT OR Apache-2.0) | Open, royalty-free specifications; the chunks are written by our own code (ADR 0063). |
| WCAG 2.x relative luminance and contrast ratio, and the AA minimums a user theme is held to (text 4.5:1, non-text and focus 3:1) | `src/theme.rs` (`contrast`, `shortfalls`), `src/theme_file.rs` | W3C, Web Content Accessibility Guidelines 2.2 (success criteria 1.4.3, 1.4.11, 2.4.7), <https://www.w3.org/TR/WCAG22/> | Implemented from the published definitions. |
## Rust dependencies
+18
View File
@@ -2,6 +2,24 @@
## Unreleased
* **Themes of your own** (#340, ADR 0117, M8): a theme is a small JSON file that names colours
for the interface's roles, kept in `themes` in the settings folder (`data/themes` in a
portable copy).
* **Preferences › Appearance › Theme** lists your themes under the built-in ones and applies
one as soon as you click it. **Export Current Theme** writes the look in use as a file to
start from, **Open Themes Folder** shows where they are, and **Reload** reads them again, so
an edit shows at once without restarting or rebuilding.
* **A theme that would be hard to read is not used.** Contrast is measured for every pair of
colours drawn together: text needs 4.5:1 and icons and the focus ring 3:1 (WCAG AA). A theme
that falls short, names a role that doesn't exist or has a colour that can't be read is
refused whole, never applied in part, and says what to change, such as "text_dim on panel
has a contrast of 2.47:1; it needs 4.5:1".
* **Colour in icons and accent gradients**, from the theme: `icon_accent` fills an icon's
closed shapes under its outline, and `accent_end` turns the accent bars beside panel titles
and under the active tab into a gradient. The built-in themes are unchanged.
* `anicraft --check-theme <file>` checks a theme without opening a window, and
`anicraft --theme <file>.json` uses one for a single run.
* **Convert Audio to Keyframes and Auto Lip-Sync** (ADR 0114, #332, M5).
* **Convert Audio to Keyframes** (Modify › Timeline, or **To Keyframes…** in a sound
keyframe's Properties): the sound's loudness on each frame drives an object on another
+160
View File
@@ -0,0 +1,160 @@
# ADR 0117: User themes from a folder
* Status: accepted (2026-11-18)
* Relates to: ADR 0005 (UI guidelines), ADR 0008 (visual language), ADR 0022 and 0064 (high
contrast, following the system), ADR 0077 (the light theme and the palette system), ADR 0094
(portable mode), ADR 0004 (destructive actions); user issue #340; roadmap M8
## Context
The interface has three palettes over one set of roles in `src/theme.rs` (Graphite, Light, High
contrast). Every colour change meant editing that file and rebuilding. Issue #340 asks for themes
that install like plug-ins: drop a file in a folder, pick it in Preferences, edit it and reload,
with coloured icons and gradients for people who miss the tinted chrome of older animation tools.
The triage of #340 split it into four requests: themes from a folder, coloured and gradient
icons, distinct pressed and focus states, and bevel or gradient surfaces. This ADR decides the
first, and how far colour in icons and gradients go **within the palette**. It does not take on
new control states or surface styles: those change what every painter draws, not which colours it
draws with, and they are separate decisions.
Two things could go wrong with themes from files: a theme that makes the editor unreadable (and
then can't be switched off, because Preferences is unreadable too), and a format that lets a file
reach into individual widgets, after which no built-in change is safe.
## Decisions
1. **A theme is a small data file that names colours for the palette's roles.** JSON, one file
per theme, in `themes` in the settings folder (the portable `data` folder in a portable copy,
ADR 0094; `ANICRAFT_THEMES_DIR` points it elsewhere). JSON because the preferences, saved
commands and documents already are, the reader is already a dependency, and unknown keys can be
refused exactly.
```json
{
"anicraft_theme": 1,
"name": "Ember",
"author": "…",
"base": "dark",
"colors": { "panel": "#221a20", "accent": "#d6336c", "stage_shadow": "#00000096" }
}
```
* `anicraft_theme` is the format's version. A file with a higher number than the build reads
is refused ("update AniCraft"), not half-read.
* `base` is `dark`, `light` or `high-contrast` (default `dark`): the built-in palette the
theme starts from. Roles the file doesn't name keep the base's colour, and what is not a
colour comes from the base too: whether egui starts from its dark or light look, the title
bar, control outlines and hairlines, corner radii, shadow strength.
* `colors` maps **role names** (the fields of `theme::Tokens` that hold a colour, 50 today:
`panel`, `text_dim`, `accent`, `span`, `tween`, `playhead`…) to `#rrggbb`, or `#rrggbbaa`
for the four roles that are laid over others (`stage_shadow`, `stage_edge`, `cell_tint`,
`icon_accent`). There is no key for a widget, a size, a font, a state or a file path: a
theme can't address anything the built-in palettes can't.
* The role list is one macro (`colour_roles!`) that generates the names, the reader and the
writer; a test reads `Tokens` from its source and fails if a colour field is not in it.
2. **All or nothing.** A file is read whole and checked whole before any of it is used. An
unknown key, an unknown role, a colour that isn't hex, a see-through colour on a solid role, a
file over 64 KB or one that isn't JSON refuses the theme with a message that names the key or
role. Nothing is skipped silently and nothing is applied in part: a typo in a role name is an
error the author sees, not a colour that quietly stays the base's.
3. **Contrast is computed, and text below WCAG AA refuses the theme.** The pairs a palette draws
together moved from the guidelines test into `theme::shortfalls`, so the built-in palettes and
a user's theme are checked by the same table (WCAG 2.x relative luminance):
* the built-ins against the house rules as before (body text 7:1 and so on);
* a user's theme against WCAG AA: text 4.5:1 on every surface it is drawn on (`text`,
`text_dim`, `text_faint`, `accent_text`, `error`, `ok` on panels, headers and fields; text on
filled buttons; marks and letters on timeline blocks), icons 3:1, and the focus ring 3:1
(1.4.11, 2.4.7). Any of these below its minimum **refuses** the theme, with the pair and the
numbers: "text_dim on panel has a contrast of 2.47:1; it needs 4.5:1."
* what doesn't stop the interface being read (a timeline block against the grid, a checkbox
edge, waveforms) is **noted** under the theme in Preferences, not refused.
* `base` must agree with the colours: light text on a `light` base is refused with the fix
("use "base": "dark""), because the base decides the egui look and the title bar.
A refused theme is still listed, disabled, with its reason, so the author sees it where they
look for it. If the theme in use stops passing (edited and reloaded, or deleted), the built-in
palette it was based on shows and the status bar says why; the choice is kept, so mending the
file and pressing Reload brings it back.
4. **Preferences › Appearance › Theme** lists Follow system, the three built-ins, then the
user's themes by name (with author and file name), each a radio button applied live on click
like the built-ins. Under them: **Open Themes Folder**, **Reload** and **Export Current
Theme**. Export writes every role of the look in use to `my-theme.json` (numbered if taken) in
the folder and lists it at once: the way to start a theme is to export one and change colours,
not to read documentation. None of this is modal.
5. **Where the choice is kept.** `theme_file` (the file's name without `.json`) beside the
existing `theme`, which then holds the base palette. An older build reads the base and shows a
built-in look; a file name with a path separator is dropped. A theme chosen by hand is not
overridden by the system's contrast setting, as Light chosen by hand isn't (ADR 0077).
6. **Icons take colour from one role: `icon_accent`.** The icons are single-colour outlines
(Lucide's grid). A palette may set `icon_accent`, and then an icon's **closed shapes are
filled with it under the outline**: two-tone icons, from the same artwork, at any scale. It is
see-through in the built-ins (nothing is drawn; they are unchanged), may be translucent, and
is checked: the outline must still reach 3:1 against the tint over the surface it sits on, at
rest, under the pointer and on the active tool. The fill is drawn only under icons painted in
the icon roles (`icon`, `icon_hot`, `on_active`); a disabled icon or a chevron drawn in a text
colour stays an outline. One role, applied in `icons::paint`, so every icon follows it and no
panel decides for itself.
Multi-colour icon artwork and icon packs in a theme (#340, proposal 5) are **not** in this
decision: they need a fuller SVG reader and a per-theme icon cache, and the MPL-2.0 rasteriser
the issue mentions stays out under the permissive-only policy.
7. **Gradients exist where the palette has a role for one: `accent_end`.** The accent is drawn
as a thin square bar wherever it marks structure: a section band's edge, a dock panel's and a
tab strip's edge, the active tab's line, a picked row's edge. Those bars now go through one
helper, `theme::accent_bar`, which draws `accent` flat, or a two-stop gradient from `accent`
to `accent_end` along the bar when a palette sets it. The built-ins have `accent_end` equal to
`accent` (flat, the same draw call as before), and a theme that changes only `accent` gets a
flat bar in its accent, never a gradient to its base's. No widget builds a gradient of its
own; a second gradient would be a second role and a second helper, decided the same way.
Gradient or bevelled surfaces (#340, proposal 4) are not decided here.
8. **Tokens stay a plain reference.** `T.panel` is read tens of thousands of times a frame, from
any thread. The built-ins are constants; a user's tokens are kept for the life of the program
(a few hundred bytes for each distinct set ever applied, the same set kept once), the set in
use sits behind a lock, and each thread remembers it until a counter says it changed, so a
read takes no lock. No `unsafe`. Under test the look stays per thread, as before (ADR 0077).
9. **A theme is view state, so it has no engine command** (golden rule 2 leaves view state to
the shell). What a script or an assistant needs is reachable without a window:
`anicraft --check-theme <file>` prints whether a theme would be used, or why not, and exits 0
or 1; `anicraft --theme <file>.json` uses a theme for one run (screenshots).
10. **Limits.** 64 KB a file, 200 themes listed (the rest counted and said), names and authors
up to 64 characters without control characters, no subfolders read, no file written except
by Export.
## Consequences
* A new colour role must be added to the `colour_roles!` list (a test fails until it is) and is
then settable by themes with no further work; a new role that pairs with another needs a line
in `theme::shortfalls`, as before.
* Built-in UI changes must hold under colours they didn't choose. The rules already forbid
assuming a colour or a direction (ADR 0077); the contrast table is what guarantees the pairs.
Check UI changes with a user theme as well as `--theme light`.
* The built-in palettes are pinned by a test over every role's bytes: this change altered none of
them, and nothing alters one by accident.
* Reading the folder is synchronous at start and on Reload (200 small files at most).
## Not yet
* Theme packages with their own icons, multi-colour and gradient icon artwork (#340).
* Separate pressed and focus looks, and bevel or gradient surface styles (#340).
* Metrics in a theme (tool button size, bar thickness).
* Installing a theme by dropping it on the window, and removing one from Preferences (the folder
is one click away).
* A file watcher: Reload is a button.
* Themes in the browser build (it has no folder).
* Following the system's accent colour; a light high-contrast palette (ADR 0077).
## Question for the lead
#340 stays open: this decides and builds the folder, the format, the checks and colour in icons
within the palette, but not icon packs, new control states or surface styles. If those are not
wanted at all, the issue can be closed against this ADR.
-1
View File
@@ -23,4 +23,3 @@ has to renumber because another PR merged first.
| Number | Pull request | Topic |
|---|---|---|
| 0037 | #38 (outside contribution) | Interface languages |
| 0117 | m8/user-themes (M8) | User themes from a folder |
@@ -26,6 +26,7 @@ bottom says which system you are on and where your settings are kept.
contrast while your computer asks for more contrast; it changes within a few seconds of your
system, without a restart. The note under it says what your system is set to right now. A theme
you pick by hand stays whatever the system says, and every theme applies as soon as you click it.
Themes you made or downloaded are listed under these: see [Themes of your own](#themes-of-your-own).
* **Dark (Graphite)**: graphite panels, with colour where it means something.
* **Light**: light grey panels and near-black text, for bright rooms and for eyes that find dark
interfaces hard to read. Timeline blocks keep their colours (mint artwork, violet classic
@@ -38,6 +39,77 @@ bottom says which system you are on and where your settings are kept.
* **Interface scale**: from 75 % to 200 %, on top of your system's display scaling. The new size
applies when you let go of the slider.
### Themes of your own
A theme is a small text file that gives colours to the interface's **roles**: the panels, the
text, the accent, the timeline's blocks and so on. You don't need to rebuild anything: put the
file in the themes folder and pick it.
1. Open **Preferences › Appearance › Theme** and click **Export Current Theme**. AniCraft writes
the look you are using, every colour of it, to `my-theme.json` in the themes folder and lists
it under the built-in themes.
2. Click **Open Themes Folder** and open the file in any text editor. Change some colours, and
give it a name.
3. Click **Reload**. The list is read again, and if your theme is the one in use, the whole
interface redraws with the new colours at once.
A theme only needs the colours it changes. This one is complete:
```json
{
"anicraft_theme": 1,
"name": "Ember",
"author": "Your name",
"base": "dark",
"colors": {
"chrome": "#1a1418",
"panel": "#221a20",
"panel_alt": "#2a2028",
"header": "#352833",
"hover": "#453441",
"active": "#5a4354",
"field": "#150f13",
"border": "#44333f",
"text": "#f2e9ee",
"text_dim": "#c2b1bb",
"text_faint": "#a8959f",
"icon": "#c9b6c0",
"icon_accent": "#d6336c59",
"accent": "#d6336c",
"accent_end": "#f08c2e",
"accent_dim": "#5a1f38",
"accent_text": "#ff8fb3"
}
}
```
* `anicraft_theme` is always `1` for now.
* `base` is `dark`, `light` or `high-contrast`: the built-in theme yours starts from. Every
colour you leave out keeps that theme's value. Use `light` when your text is darker than your
panels.
* `colors` gives each role a colour as `#rrggbb`. An exported theme lists every role there is;
the names say what they colour (`panel`, `text`, `accent`, `span` for a timeline span holding
artwork, `tween`, `playhead`, `onion_past`…).
* **`icon_accent`** fills the closed shapes of the icons with a second colour, under their
outlines. Add two more digits for how solid it is (`59` is about a third), so the outline stays
clear. Leave it out for plain outline icons.
* **`accent_end`** turns the thin accent bars (beside panel titles, under the active tab) into a
gradient from `accent` to this colour. Leave it out for a flat bar.
**A theme that would be hard to read is not used.** AniCraft measures the contrast of each pair
of colours it draws together. Text needs 4.5:1 against what it sits on, and icons and the focus
ring need 3:1 (WCAG AA). A theme that falls short stays in the list, greyed out, with a line that
says which colours to change, for example *"text_dim on panel has a contrast of 2.47:1; it needs
4.5:1"*. The same happens for a mistyped role name or a colour that isn't written as `#rrggbb`: the
theme is refused whole, never applied in part. If the theme you are using stops passing after an
edit, AniCraft shows the built-in theme it is based on until you mend the file and click
**Reload**.
The themes folder is `themes` in the settings folder shown at the bottom of Preferences (in a
portable copy, `data/themes` beside the app). To check a file without opening AniCraft, run
`anicraft --check-theme my-theme.json` in a terminal; to try one for a single session,
`anicraft --theme my-theme.json`. The browser version has the built-in themes only.
### Stage
* **Rendering** decides when the stage redraws after an edit:
+3 -3
View File
@@ -30,7 +30,7 @@ This integration depends on craft-libs #1962 and still requires hosted parity va
| Installers & release | **Packaging** (ADR 0026, `docs/release.md`): the Craft family's `packaging/` layout behind the shared release workflow. Windows MSI (x64, arm64; per-user by default, everyone on request, upgrades in place), portable and symbols zips; macOS universal DMG with a laid-out window and CLI zip; Linux AppImage, deb, rpm, tar.gz, Flatpak and Arch (x86_64, aarch64; riscv64 deb/rpm/tar). `.anicraft` opens AniCraft by default; `.fla`/`.xfl` offered under Open with. Signed and notarized on the `release` branch (missing secrets fail it), unsigned elsewhere; ends in a draft release. Packaging lint and a fixture WiX build guard PRs; `src/packaging_tests.rs` keeps ids and types in step. **Opening documents on macOS** (ADR 0062): a double-click in Finder, a drop on the Dock icon or Open With opens the document, at launch or while running (the open-documents Apple Event through `platform.rs`, by `fmv-macos-events`, so no `unsafe` of ours), through the unsaved-changes guard; the Dock's Quit asks to save too; Windows and Linux command-line hand-over covered by a test. **Portable mode and AppImage desktop integration** (ADR 0094): an `anicraft-portable` marker (shipped in the Windows zip and the Linux tar.gz; also honoured beside `AniCraft.app` and an `.AppImage`) keeps preferences, autosave, logs, plug-ins, templates, recent files, brushes, filter presets and workspaces in `data/` beside the app, through one switch in `platform.rs`, falling back visibly when that folder can't be written; Preferences › About shows the mode and every folder; on first start from an AppImage a non-modal card offers once to add AniCraft to the applications menu (`desktop.integrate/remove/status`: desktop entry with a quoted `Exec`, MIME types and icons under `$XDG_DATA_HOME` only, idempotent, removable from About, following a moved or updated AppImage); a store-readiness job checks the Flatpak manifests, AppStream (`appstreamcli validate`), the desktop entry and any winget/MSIX manifests. Not yet: verified on a Mac (the checklist is in ADR 0062), a single running AniCraft taking a second document on Windows and Linux, store submissions and winget/MSIX manifests, self-update inside a portable copy, video export inside the Flatpak. |
| Documentation | **User guide, first slice** (ADR 0069, `docs/guide/`): eighteen chapters for artists (getting started to troubleshooting, and Coming from Animate), a command reference and a shortcut reference (Windows/Linux and macOS) generated from the registry and checked for freshness by tests, every link, anchor and picture checked, eight screenshots from `scripts/guide-shots.sh`. Help › User Guide opens the book bundled in the app, offline, in the browser; the web build serves it beside the editor; `anicraft-cli guide --out <folder>` writes it. Not yet: translated guides, search, a PDF edition, context help from panels, macOS and Linux screenshots. |
| Languages | **First slice** (ADR 0040, `docs/localisation.md`): every shell string goes through `tr!`/`trn!` (keyed by its English; placeholders; CLDR plurals for whole numbers), menus translate the registry's labels when drawn (ids, CLI, MCP and the file format stay English), screen-reader names too. Catalogs are craft-i18n's TSV, read by our own parser and embedded from `CRAFT_I18N_DIR` (fallback app → shared → base language → English). Preferences › Appearance › Language (system language by default) and `--lang`. A **pseudo-locale** (`--lang pseudo`: accented, a third longer, bracketed) tests layout; checked by a source guideline test and a pseudo-locale accessibility audit; `scripts/i18n-extract.sh` writes the translators' template and per-locale coverage. Not yet: a real language (craft-i18n has no `anicraft.tsv` yet), engine messages and confirmation bodies (`@msg`), default document names, right to left (needs bidi and shaping in egui upstream), CJK and Georgian (need a font), shaped scripts. |
| Accessibility | **First pass** (ADR 0022, `docs/accessibility.md`): AccessKit (via eframe) gives every control a name and role, checked by a headless test that walks the tree in 23 interface states (custom-painted tools, layer rows and toggles, icon buttons, Library rows, every Properties field, the Motion Editor, every dialog; the stage is a named canvas; the status bar a polite live region). **Ctrl+F6 / Ctrl+Shift+F6** move focus between Stage, Timeline, Properties, Library and Tools (rebindable); focused controls keep Enter/Space/arrows while other shortcuts still work; pointer-only surfaces are not Tab stops. **High contrast** palette (Preferences › Theme) from the same roles, text ≥ 7:1, controls and focus ≥ 3:1; both palettes checked by the contrast test (the graphite one now meets AA everywhere). **Interface scale** 75–200 % holds up (stage refits, tools and timeline header scroll, status truncates). **Second pass** (ADR 0064): while the stage has focus its elements are a list box under the canvas (name from the instance name and outline or kind, layer, place and size, bounds, selected; 2,000 at most plus a summary); **Tab, arrows, Enter/Space and Shift+Space select on the stage** through `element.select` (new `toggle`); the active layer's keyframe spans are a list (frames, tween, label, sound, actions; activating one moves the playhead); on the focused timeline the arrows move the playhead and layer, announced through the status bar; **the menu bar from the keyboard** on Windows and Linux (Alt tap or F10, arrows, submenus, Esc, Alt+letter with underlined access keys); **Follow system** (the default theme) switches to high contrast with Windows' contrast themes, macOS' Increase Contrast, the portal/GNOME contrast setting and `prefers-contrast` in browsers. **Light theme** (ADR 0077, #227): a third palette designed for light (paper greys, near-black text, hairline controls, timeline blocks re-tuned to 3:1 on the panels with 4.5:1 marks), checked by the same contrast test; Follow system now follows the system's light or dark mode too (Windows, macOS, portal/GNOME, `prefers-color-scheme`). Not yet: names beyond the outline heuristic, per-item menu letters, a light high-contrast palette, a keyboard route to the menu row on macOS (⌘K covers it), manual passes with Narrator, VoiceOver and Orca. |
| Accessibility | **First pass** (ADR 0022, `docs/accessibility.md`): AccessKit (via eframe) gives every control a name and role, checked by a headless test that walks the tree in 23 interface states (custom-painted tools, layer rows and toggles, icon buttons, Library rows, every Properties field, the Motion Editor, every dialog; the stage is a named canvas; the status bar a polite live region). **Ctrl+F6 / Ctrl+Shift+F6** move focus between Stage, Timeline, Properties, Library and Tools (rebindable); focused controls keep Enter/Space/arrows while other shortcuts still work; pointer-only surfaces are not Tab stops. **High contrast** palette (Preferences › Theme) from the same roles, text ≥ 7:1, controls and focus ≥ 3:1; both palettes checked by the contrast test (the graphite one now meets AA everywhere). **Interface scale** 75–200 % holds up (stage refits, tools and timeline header scroll, status truncates). **Second pass** (ADR 0064): while the stage has focus its elements are a list box under the canvas (name from the instance name and outline or kind, layer, place and size, bounds, selected; 2,000 at most plus a summary); **Tab, arrows, Enter/Space and Shift+Space select on the stage** through `element.select` (new `toggle`); the active layer's keyframe spans are a list (frames, tween, label, sound, actions; activating one moves the playhead); on the focused timeline the arrows move the playhead and layer, announced through the status bar; **the menu bar from the keyboard** on Windows and Linux (Alt tap or F10, arrows, submenus, Esc, Alt+letter with underlined access keys); **Follow system** (the default theme) switches to high contrast with Windows' contrast themes, macOS' Increase Contrast, the portal/GNOME contrast setting and `prefers-contrast` in browsers. **Your own themes** (ADR 0117, #340): JSON files of role colours in the settings folder's `themes`, listed in Preferences › Theme and applied live, exported from the look in use, reloaded without a restart; each is held to WCAG AA by the same contrast table as the built-ins (`theme::shortfalls`) and refused whole, naming the roles, when text, icons or the focus ring fall short; two-tone icons (`icon_accent`) and a gradient on accent bars (`accent_end`) from the palette. **Light theme** (ADR 0077, #227): a third palette designed for light (paper greys, near-black text, hairline controls, timeline blocks re-tuned to 3:1 on the panels with 4.5:1 marks), checked by the same contrast test; Follow system now follows the system's light or dark mode too (Windows, macOS, portal/GNOME, `prefers-color-scheme`). Not yet: names beyond the outline heuristic, per-item menu letters, a light high-contrast palette, a keyboard route to the menu row on macOS (⌘K covers it), manual passes with Narrator, VoiceOver and Orca. |
| Stage rendering & build | **Tiled stage** (ADR 0007): 512 px cached tiles, over the stage and the visible pasteboard (artwork off the stage shows, on transparent tiles that never cross the stage edge; View › Clip Content Outside the Stage and its edit-bar button hide it, view state), batched per frame with one scene evaluation per frame, look-ahead ring and playback prefetch, scaled older tiles instead of blank areas, pixel-aligned (no seams). **Space-biased build**: debug build 6.9 GB → 1.04 GB, fresh build 44 s, edit rebuild 4–6 s (`docs/development.md`). |
| Scale & performance | Pulled forward from M2: persistent document with snapshot undo (memory-budgeted history, save-point dirty tracking, History panel), background render worker with frame cache and playback look-ahead, band-parallel renderer with culling, compact streaming file format v2, `anicraft-cli bench`. Measured numbers are in `docs/performance.md`. Memory, sharing, file-size and culling budgets are a test on every PR; timing budgets are `anicraft-cli bench --check yes` (all met; the 1080p render is 15.3–15.8 ms against 16.7 ms). |
@@ -46,7 +46,7 @@ This integration depends on craft-libs #1962 and still requires hosted parity va
| **M5** | Rich media | ~~Text engine~~ ✅ first slice (ADR 0012: `harfrust` shaping, `skrifa` outlines, line wrapping, outlines stored with the text); ~~per-character and paragraph styles~~ ✅ first slice (ADR 0085: styled runs (font, size, bold, italic, colour, letter spacing, superscript/subscript by the font's OS/2 metrics, underline, link) set on the selected characters while typing, mixed values in Properties, paragraph alignment, indent, margins and line spacing, runs shaped one by one and wrapped across, one fill per colour in every export, SVG links, XFL `DOMTextRun`s kept in one block, `text.style`/`text.paragraph`/`text.styles`; not yet: justified text, runs on a path's underlines, `htmlText` in fields, links that click in Test Movie and the HTML page, SVG `<text>`/`<tspan>` output, the editor showing the real faces and alignment); ~~text on a path~~ ✅ first slice (ADR 0070: a copy of a shape's outline in the block, glyphs set by arc length and stored as outlines, offset, flip and alignment, Attach to Path by picking a shape, SVG `textPath`; editing the path in place and several lines on a path later); ~~dynamic and input text fields~~ ✅ first slice (ADR 0066: Text type in Properties, instance names, `field.text`/`appendText`/`length` in scripts, typing with caret, selection, max chars and passwords in Test Movie, native inputs in the HTML export, XFL fields kept; `htmlText`, change events, embedded fonts in HTML and other `TextField` API later); ~~bitmap import and bitmap fills~~ ✅; ~~audio layers, waveform display, stream sync~~ ✅ first slice (ADR 0020: WAV, Ogg Vorbis, MP3; `cpal` output); ~~effect envelopes, layer volume and mute, sounds inside symbols~~ ✅ (ADR 0039); ~~audio output polish (latency-aware clock, event tails, monitor volume and mute, scrubbing preference, device recovery, Web Audio)~~ ✅ (ADR 0095); ~~Convert Audio to Keyframes and auto lip-sync~~ ✅ first slice (ADR 0114, #332: loudness per frame onto scale, alpha, position, rotation or a graphic's first frame, as keyframes or a motion tween curve, with threshold, smoothing and a live preview; five mouth shapes from band energies keyed onto a mouth symbol's frames; not yet: more mouth shapes, the camera, armatures and filters as targets, classic tweens between keys); ~~button sounds and hit-area editing~~ ✅ (ADR 0057: state sounds in Test Movie and HTML, state names on the timeline, the Hit area over the other states, Show hit areas in Test Movie, XFL sounds in the package); ~~filters (blur, drop shadow, glow, colour matrix)~~ ✅, ~~bevel, gradient glow and gradient bevel~~ ✅ (ADR 0025; SVG export and XFL import), ~~filter presets, reordering, on/off and tweened filter values~~ ✅ (ADR 0091: drag or Alt+arrows to reorder, an eye per filter that keeps its settings, Copy/Paste Filters, presets in your preferences with a JSON file to move them; classic tweens pair lists with switched-off filters), ~~motion-tween tracks per filter property in the Motion Editor~~ ✅ (ADR 0092: blur, strength, angle, distance and Adjust Color's four, by filter slot, with curves, eases and retiming, auto-keyed from Properties › Filters, following reorders and removals), ~~filter colours, quality and switches as tracks, built-in presets and filters on text~~ ✅ (ADR 0099: a filter's colours and ramp stops channel by channel in the tint's units, with a swatch row in the Motion Editor; quality, Inner, Knockout and Hide Object as stepped tracks; classic tweens of lists that differ pair what matches and fade the rest; eight built-in presets that can be hidden, not deleted; filters on static, dynamic and input text, in every export and from XFL; not yet: the Type and on/off as tracks, ramp stop positions as tracks, Animate's filter tracks from XFL motion tweens, typed text of an input field filtered in the HTML page) and ~~blend modes~~ ✅ on Movie Clips. |
| **M6** | Interactivity & extensibility | **Plug-ins: the Craft-family WebAssembly system** (same host model as PhotoCraft: `wasmi` sandbox, `plugin.*` commands; AniCraft ABI for vector/timeline operations and exporters): first slice ✅ (command plug-ins over the registry, ADR 0017); ~~exporter and easing plug-ins~~ ✅ (ADR 0088); ~~frame scripts on the same sandbox~~ ✅ and ~~button states in test-movie preview~~ ✅ first slice (ADR 0024: action IR, pure player, Actions panel, Test Movie); ~~HTML canvas runtime export~~ ✅ first slice (ADR 0028: one self-contained page, baked frames, a JS port of the player tested against it; ~~filters, Subtract and Invert in the page~~ ✅, ADR 0072); ~~command macros~~ ✅ first slice (ADR 0097: every undo step records its commands; History › Save As Command with steps rewritten to act on the selection or refused with the step named; saved commands at the end of the Commands menu with shortcuts; Manage Saved Commands; Run Command…; one transactional undo step; small JSON files in the settings folder; `macro.*` headless, CLI and MCP; macros call only what plug-ins may. Not yet: Replay Steps without saving, editing a macro's steps, macros that ask for values, the browser build and the command palette). **ActionScript compatibility, low priority** (ADR 0013), last in M6 and free to slip past M8: ~~tier 1 keeps scripts~~ ✅ (XFL frame scripts and class names stored verbatim, the Actions panel's Script view, `script.*` commands); ~~tier 2 runs the ActionScript 3 timeline subset (stop, play, go to frame or label, named instances, button events) in Test Movie and HTML canvas export through the same action IR as WebAssembly frame scripts~~ ✅; ~~tier 2.5 small logic (typed variables, expressions, `if` and loops, property reads, functions across frames, enter-frame and keyboard listeners, seeded random, ADR 0052)~~ ✅. The full language, the `flash.*` API and SWF bytecode are not planned. |
| **M7** | Advanced animation | ~~Bone/IK tool~~ ✅ first slice (ADR 0043: symbol-instance armatures on an armature layer, Bone tool, joint-angle poses tweened with easing, CCD inverse kinematics with joint limits and pins, posing with the Selection tool, Bone properties, every export; not yet: outline-following ARAP meshes, symbols, pins bound to bones, a GPU textured path, bent bitmaps in HTML/Lottie); ~~springs, joint translation, editing members in place~~ ✅ second slice (ADR 0084); not yet: runtime armatures, XFL armature import); ~~shape armatures~~ ✅ first slice (ADR 0071: bones inside one shape, automatic binding, linear blend skinning, Bind tool); ~~painted weights and reshaping a bound shape~~ ✅ second slice (ADR 0090; not yet: reshaping at a posed frame); ~~mixed armatures: symbol instances and shapes in one armature~~ ✅ (ADR 0098: bones inside a shape and bones that move instances or whole shapes in one armature, several skinned shapes, chains across the kinds with the Bone tool, one pose for IK, tweens, springs and translation, file format version 4 only for documents that use it; not yet: joining two armatures, joining a whole shape from a shape's bone by dragging, XFL import of armatures); ~~asset warp~~ ✅ first slice (ADR 0079: warp meshes on shapes and bitmaps, pins, rigid MLS, pin poses tweened, Asset Warp tool, ~~camera layer with depth~~ ✅ first slice (ADR 0027: one camera layer per scene, pan/zoom/rotate/tint, classic and motion tweens, pan-only layer depth, Camera tool, Preview Through Camera, every export); ~~layer depth in perspective, keyed over time, Layer Depth panel, attaching layers, camera colour effects, editing while previewing~~ ✅ second slice (ADR 0082; not yet: tools other than Selection while previewing, depth inside symbols, XFL camera import); ~~variable-width strokes~~ ✅ first slice (ADR 0018: width profiles, Width tool, exports, tweens); ~~Brush tool~~ ✅ first slice (ADR 0033: filled sweeps, tips, pressure, Paint Normal/Fills/Behind; not yet: Paint Selection/Inside); ~~brush library, pressure curves and the Paint Brush~~ ✅ first slice (ADR 0068: parameter presets, user brushes and brush sets, curve editor, velocity, stroke mode); ~~Eraser and Eyedropper~~ ✅ first slice (ADR 0034: five erase modes, Faucet, Erase Everything; picks solid, gradient, bitmap and line styles) and brush library; ~~tilt, textured brushes, erasing inside symbols, gradients and width profiles in the merge~~ ✅ second slice (ADR 0093: tilt turns and widens the tip per sample, paper-grain texture and scatter as vector paint, Charcoal and Spatter, the Eraser's hint for symbols and objects, width profiles carried into each merged piece; not yet: reading tilt on desktop systems (winit 0.30 reports it only on iOS), bitmap, art and pattern brushes, eraser pressure and presets, the live preview through texture and tilt); ~~graph-based easing presets library~~ ✅ first slice (ADR 0081: presets, custom multi-segment eases, saved eases, per-group classic eases, Motion Editor properties, XFL import; not yet: updating every tween that uses a saved ease, a user ease library shared between documents, Lottie-native eases instead of baked frames, motion-tween eases from XFL); ~~layer parenting~~ ✅ first slice (ADR 0113, #388: a layer follows the first object on its parent layer through position, rotation, scale and skew, chains, the timeline's parenting view with draggable dots and a parent menu, parenting keeps the stage position in one undo step, followers edited in stage space, every export; not yet: a parent that changes over time, Edit Multiple Frames and motion path editing in stage space on a follower, armature layers as followers, XFL import (no public format description)). |
| **M8** | Release quality | ~~**Several documents open at once**~~ ✅ first slice (ADR 0112, #420: a tab per open document above the edit bar, with a dot for unsaved changes and a close button; click, middle-click, drag to reorder, right-click Close / Close Others / Close All / show the file; Ctrl+Tab, Ctrl+PageDown, Ctrl+W, Ctrl+Alt+W; each tab its own session, undo history, selection, playhead, view and Motion Editor state; New, Open, recent files, drops and restored copies open a tab, a file already open is shown; closing a tab with unsaved changes asks, quitting asks once for all; one recovery copy per open document; paste across documents brings symbols, bitmaps and sounds, renamed on a clash; a document not shown keeps no render caches; next: tearing a tab off into its own window, another document's Library in the Library panel, reopening last session's documents, a shared undo budget); ~~Installers and signing for Windows/macOS/Linux~~ ✅ first slice (ADR 0026: family `packaging/` layout, MSI, DMG, AppImage/deb/rpm/Flatpak/tar.gz, `.anicraft` registered everywhere, signing wired to the release environment; ~~opening documents from Finder~~ ✅ (ADR 0062, to be checked on a Mac); ~~AppImage desktop integration, portable mode, store readiness checks~~ ✅ (ADR 0094); next: store submissions); ~~web build (wasm) of the editor~~ ✅ first slice (ADR 0036: browser file picker and downloads, autosave in browser storage, CPU stage, CI wasm build and tests in Node, the release zip made by `packaging/web/package.sh` and checked in CI (#210); next: releases carrying it and a hosted copy, once the team decides where, Web Audio, WebGPU stage, verified in browsers); ~~localisation~~ ✅ first slice (ADR 0040: `tr!` everywhere in the shell, craft-i18n catalogs, Preferences language, pseudo-locale; next: AniCraft's catalog in craft-i18n, engine messages, right to left once egui can lay it out); accessibility: first pass ✅ (ADR 0022: screen-reader names for every control, Ctrl+F6 panel focus, high-contrast theme, 200 % scale), second pass ✅ (ADR 0064: stage elements and timeline frames for screen readers, keyboard selection on the stage, keyboard menu bar, following the system's contrast setting), ~~a light theme~~ ✅ (ADR 0077: Light palette, Follow system for light or dark, #227), next: live screen-reader passes on each platform, a light high-contrast palette; ~~crash-recovery autosave~~ ✅ (ADR 0015); ~~Find and Replace and the Movie Explorer~~ ✅ first slice (ADR 0058: `find.search`/`find.replace`/`find.goto` over text, fonts, colours, symbols, sounds and bitmaps, scene or document, linear-time patterns, Replace All as one undo step asking above 100 places, going there opens symbols in place; `explorer.tree` paged, Show filters and search, the Movie Explorer tab beside the Library, lists drawing only the rows in view; not yet: action parameters and ActionScript strings apart from code, font size and style, colour tolerance, renaming in the Movie Explorer); ~~files from the desktop, recent files and a start screen~~ ✅ first slice (ADR 0059: drops route by type and target in one undo step, Open Recent with pins and missing files, start screen with presets and thumbnails); ~~templates, SVG into the Library, drops on the timeline~~ ✅ first slice (ADR 0065: six built-in templates built in code, Save as Template with category and picture, SVG as a graphic symbol, sounds onto a frame's keyframe and media into a keyframe made there; next: exact desktop drop positions once eframe moves to winit 0.31, user template descriptions and renaming); ~~Publish Settings and Publish~~ ✅ first slice (ADR 0060: the publish profile in the document, every format with its export options and an output relative to the document's folder with `{name}`, Shift+F12 publishing in the background with progress, Cancel and one report, overwriting asked once per session, presets in Preferences, the browser's downloads as one ZIP; not yet: Animate's PublishSettings.xml from XFL, more placeholders, outputs outside the document's folder, progress inside HTML, Lottie and audio); ~~documentation book~~ ✅ first slice (ADR 0069: the user guide in `docs/guide/`, generated command and shortcut references, Help › User Guide offline), ~~search and context help~~ ✅ (ADR 0096: a prebuilt index and an offline search page with the same ranking as `anicraft-cli guide search`; F1, Help › Help for This and each panel menu open the guide at the section for the dialog, panel or tool, through a map checked against the guide's headings; F1 moves from the shortcut editor, which keeps Ctrl+Alt+Shift+K); next: translated guides, a print edition (PDF through the browser; a native PDF proposed in ADR 0096), help for single fields; ~~dockable panels and workspaces~~ ✅ first slice (ADR 0075, #249: every panel docks on any side of the stage, stacks as tabs, resizes, folds, floats in a window of its own with ADR 0062's fallback, closes and reopens wherLine truncated
| **M8** | Release quality | ~~**Several documents open at once**~~ ✅ first slice (ADR 0112, #420: a tab per open document above the edit bar, with a dot for unsaved changes and a close button; click, middle-click, drag to reorder, right-click Close / Close Others / Close All / show the file; Ctrl+Tab, Ctrl+PageDown, Ctrl+W, Ctrl+Alt+W; each tab its own session, undo history, selection, playhead, view and Motion Editor state; New, Open, recent files, drops and restored copies open a tab, a file already open is shown; closing a tab with unsaved changes asks, quitting asks once for all; one recovery copy per open document; paste across documents brings symbols, bitmaps and sounds, renamed on a clash; a document not shown keeps no render caches; next: tearing a tab off into its own window, another document's Library in the Library panel, reopening last session's documents, a shared undo budget); ~~Installers and signing for Windows/macOS/Linux~~ ✅ first slice (ADR 0026: family `packaging/` layout, MSI, DMG, AppImage/deb/rpm/Flatpak/tar.gz, `.anicraft` registered everywhere, signing wired to the release environment; ~~opening documents from Finder~~ ✅ (ADR 0062, to be checked on a Mac); ~~AppImage desktop integration, portable mode, store readiness checks~~ ✅ (ADR 0094); next: store submissions); ~~web build (wasm) of the editor~~ ✅ first slice (ADR 0036: browser file picker and downloads, autosave in browser storage, CPU stage, CI wasm build and tests in Node, the release zip made by `packaging/web/package.sh` and checked in CI (#210); next: releases carrying it and a hosted copy, once the team decides where, Web Audio, WebGPU stage, verified in browsers); ~~localisation~~ ✅ first slice (ADR 0040: `tr!` everywhere in the shell, craft-i18n catalogs, Preferences language, pseudo-locale; next: AniCraft's catalog in craft-i18n, engine messages, right to left once egui can lay it out); accessibility: first pass ✅ (ADR 0022: screen-reader names for every control, Ctrl+F6 panel focus, high-contrast theme, 200 % scale), second pass ✅ (ADR 0064: stage elements and timeline frames for screen readers, keyboard selection on the stage, keyboard menu bar, following the system's contrast setting), ~~a light theme~~ ✅ (ADR 0077: Light palette, Follow system for light or dark, #227), ~~user themes from a folder~~ ✅ first slice (ADR 0117, #340: a theme is a small JSON file of colours for the palette's roles in the settings folder's `themes`; Preferences › Theme lists them with Open Themes Folder, Reload and Export Current Theme; a theme whose text, icons or focus ring fall below WCAG AA, or that names an unknown role, is refused whole with the pair and the numbers; `icon_accent` gives two-tone icons and `accent_end` a gradient on the accent bars; `--check-theme`, `--theme <file>`; not yet: icon packs and multi-colour icon artwork, separate pressed and focus looks, bevel or gradient surfaces, metrics, drop to install, a file watcher, themes in the browser), next: live screen-reader passes on each platform, a light high-contrast palette; ~~crash-recovery autosave~~ ✅ (ADR 0015); ~~Find and Replace and the Movie Explorer~~ ✅ first slice (ADR 0058: `find.search`/`find.replace`/`find.goto` over text, fonts, colours, symbols, sounds and bitmaps, scene or document, linear-time patterns, Replace All as one undo step asking above 100 places, going there opens symbols in place; `explorer.tree` paged, Show filters and search, the Movie Explorer tab beside the Library, lists drawing only the rows in view; not yet: action parameters and ActionScript strings apart from code, font size and style, colour tolerance, renaming in the Movie Explorer); ~~files from the desktop, recent files and a start screen~~ ✅ first slice (ADR 0059: drops route by type and target in one undo step, Open Recent with pins and missing files, start screen with presets and thumbnails); ~~templates, SVG into the Library, drops on the timeline~~ ✅ first slice (ADR 0065: six built-in templates built in code, Save as Template with category and picture, SVG as a graphic symbol, sounds onto a frame's keyframe and media into a keyframe made there; next: exact desktop drop positions once eframe moves to winit 0.31, user template descriptions and renaming); ~~Publish Settings and Publish~~ ✅ first slice (ADR 0060: the publish profile in the document, every format with its export options and an output relative to the document's folder with `{name}`, Shift+F12 publishing in the background with progress, Cancel and one report, overwriting asked once per session, presets in Preferences, the browser's downloads as one ZIP; not yet: Animate's PublishSettings.xml from XFL, more placeholders, outputs outside the document's folder, progress inside HTML, Lottie and audio); ~~documentation book~~ ✅ first slice (ADR 0069: the user guide in `docs/guide/`, generated command and shortcut references, Help › User Guide offline), ~~search and context help~~ Line truncated
## Releases
@@ -67,7 +67,7 @@ titled with its milestone.
| M5 | Audio layers: import, waveform, playback sync | timeline, layers |
| M6 | ~~WebAssembly plug-ins (U2)~~ ✅ first slice (ADR 0017); ~~frame scripts and Test Movie on the plug-in host~~ ✅ first slice (ADR 0024); ~~HTML canvas runtime export~~ ✅ first slice (ADR 0028); ~~ActionScript tier 1: keep scripts~~ ✅ (ADR 0013); ~~ActionScript tier 2: run the timeline subset~~ ✅ (ADR 0013); ~~ActionScript tier 2.5: small logic~~ ✅ (ADR 0052); ~~exporter and easing plug-ins~~ ✅ (ADR 0088); ~~command macros~~ ✅ first slice (ADR 0097); next: growing the ActionScript subset (`switch`, arrays, event bubbling) | command registry, plug-in host, action IR and player |
| M7 | ~~Variable-width strokes~~ ✅ (ADR 0018), ~~camera layer with depth~~ ✅ first slice (ADR 0027), ~~camera depth, attaching and colour~~ ✅ (ADR 0082), ~~Bone tool and IK~~ ✅ first slice (ADR 0043), ~~shape armatures and the Bind tool~~ ✅ first slice (ADR 0071), ~~painted weights and reshaping~~ ✅ (ADR 0090), ~~mixed armatures (instances and shapes together)~~ ✅ (ADR 0098), ~~bone springs and joint translation~~ ✅ (ADR 0084), ~~Asset Warp~~ ✅ first slice (ADR 0079), ~~Brush tool~~ ✅ first slice (ADR 0033), ~~Eraser and Eyedropper~~ ✅ first slice (ADR 0034); ~~brush library and pressure curves~~ ✅ first slice (ADR 0068), ~~tilt, texture, profiles in the merge~~ ✅ (ADR 0093), ~~layer parenting~~ ✅ first slice (ADR 0113); next: reading pen tilt from the toolkit, art brushes | strokes, Pen and Pencil, width profiles, timeline evaluation |
| M8 | ~~Several documents open at once~~ ✅ first slice (ADR 0112, #420), ~~Crash-recovery autosave~~ ✅, ~~accessibility first pass~~ ✅ (ADR 0022), ~~installers and signing~~ ✅ first slice (ADR 0026), ~~portable mode and AppImage desktop integration~~ ✅ (ADR 0094), ~~web build~~ ✅ first slice (ADR 0036), ~~localisation~~ ✅ first slice (ADR 0040), ~~Find and Replace and the Movie Explorer~~ ✅ first slice (ADR 0058), ~~drops, recent files and the start screen~~ ✅ first slice (ADR 0059); ~~templates and drops on the timeline~~ ✅ first slice (ADR 0065); ~~Publish Settings and Publish~~ ✅ first slice (ADR 0060); ~~Test Movie in its own window and macOS document opening~~ ✅ first slice (ADR 0062); ~~accessibility second pass~~ ✅ (ADR 0064); ~~a light theme~~ ✅ (ADR 0077); ~~CI on macOS and Windows~~ ✅ (ADR 0067); ~~guide search and context help~~ ✅ (ADR 0096); ~~dockable panels and workspaces~~ ✅ first and second slices (ADR 0075, ADR 0087); next: live screen-reader passes | `.anicraft` format, session, AccessKit in eframe |
| M8 | ~~Several documents open at once~~ ✅ first slice (ADR 0112, #420), ~~Crash-recovery autosave~~ ✅, ~~accessibility first pass~~ ✅ (ADR 0022), ~~installers and signing~~ ✅ first slice (ADR 0026), ~~portable mode and AppImage desktop integration~~ ✅ (ADR 0094), ~~web build~~ ✅ first slice (ADR 0036), ~~localisation~~ ✅ first slice (ADR 0040), ~~Find and Replace and the Movie Explorer~~ ✅ first slice (ADR 0058), ~~drops, recent files and the start screen~~ ✅ first slice (ADR 0059); ~~templates and drops on the timeline~~ ✅ first slice (ADR 0065); ~~Publish Settings and Publish~~ ✅ first slice (ADR 0060); ~~Test Movie in its own window and macOS document opening~~ ✅ first slice (ADR 0062); ~~accessibility second pass~~ ✅ (ADR 0064); ~~a light theme~~ ✅ (ADR 0077); ~~user themes from a folder~~ ✅ first slice (ADR 0117, #340); ~~CI on macOS and Windows~~ ✅ (ADR 0067); ~~guide search and context help~~ ✅ (ADR 0096); ~~dockable panels and workspaces~~ ✅ first and second slices (ADR 0075, ADR 0087); next: live screen-reader passes | `.anicraft` format, session, AccessKit in eframe |
Tasks that wait on an open track: XFL motion tweens (on M2's motion tweens); frame scripts and
ActionScript (on M6's plug-in host).
+7
View File
@@ -76,6 +76,13 @@ are not used for UI text, because they would change metrics per OS.
under the pointer is `T.icon_hot`; a mark drawn across the timeline is `T.text`, not white,
because the panels may be light. A new token needs a value in every palette and a line in the
contrast test. Check UI changes with `--theme light` as well.
* **Users bring their own palettes** (ADR 0117): a theme file sets colours for these same roles
over one of the three, and is refused unless its text, icons and focus ring reach WCAG AA
(`theme::shortfalls`, the table the built-ins are tested with). So a pair of roles you draw
together must be in that table, and nothing may assume a role's colour. A new colour role goes
in `colour_roles!`. Accent bars go through `theme::accent_bar` (the one gradient), icons through
`icons::paint` (the one place `icon_accent` is drawn). Check with
`--theme <file>.json` as well.
* No raw colours outside `theme.rs`: add a token.
## 4. Shapes, borders, spacing and sizes (ADR 0008)
+12
View File
@@ -446,6 +446,18 @@ mod tests {
let _ = std::fs::remove_dir_all(&dir);
}
/// The sample theme in the user guide is one AniCraft uses, with its two-tone icons and its
/// gradient accent bars, and nothing about it is noted as low in contrast.
#[test]
fn the_guides_sample_theme_is_a_good_theme() {
let chapter = include_str!("../docs/guide/preferences-shortcuts-accessibility.md");
let sample = chapter.split("```json
").nth(1).and_then(|s| s.split("```").next()).expect("the chapter has a sample theme");
let t = parse(sample).unwrap_or_else(|e| panic!("{}", e.message()));
assert_eq!((t.name.as_deref(), t.base, t.notes.len()), (Some("Ember"), Palette::Graphite, 0), "{:?}", t.notes);
assert!(t.tokens.icon_accent.a() > 0 && t.tokens.accent_end != t.tokens.accent);
}
#[test]
fn hostile_files_never_panic() {
let deep = format!("{}1{}", "[".repeat(5000), "]".repeat(5000));