Phase 5a-5.
- Settings → Appearance shows a preview card for each theme. The cards
are one radio group. The arrow keys move and select, and the current
card has the selection outline and a check mark (UI-047).
- Edit theme opens the theme editor as a workbench tab in the window
that opened Settings. The window shows each change at once.
- The editor shows all 51 color roles in seven groups. Each role has a
color picker, a hex field, its lowest readability result, and a reset
button. A failure shows a warning icon and its ratio, or "Too close".
- Save writes a short schema 3 theme with the built-in theme as its
base. A built-in theme does not change. Discard returns to the saved
colors, and Duplicate saves a copy.
- The editor is a built-in package, like the browser, so it uses the
editor tab code of plugins.
- 23 new catalog rows with French, Japanese, and Simplified Chinese.
- The smoke harness sends emit to every page and emit_to to the pages
with the target window label.
- Docs: UI-047, ui-design.md, and "Edit a theme" in guides/themes.md.
New tests: appearance/themeEditor and tests/unit/theme/themeEditor.spec.ts.
Six smoke tests use the cards instead of the theme menu.
Plugin runtime cost:
- Remove the timed plugin scan. Windows scan at start, on focus, on Refresh, and on plugins-changed.
- Keep one package check for each plugin folder. Read and hash the files again only when the
entry names, sizes, or modification times change. Enable and load always read all files.
An asset read checks the SHA-256 hash of its file.
- A changed package still stops and needs a new enable decision. Add tests for the cache,
for changes that keep the metadata, and for the enable decision.
- Replace the 50 ms wait loops of update and removal with a condition variable. The limit
stays at 10 seconds. Command names, arguments, and results do not change.
Content security policy:
- Set app.security.csp in tauri.conf.json. Keep Tauri from adding nonces to style-src.
- Add CSP mode to the smoke tests (pnpm smoke --csp). The dev server sends the same policy
with each HTML page, and the harness fails a test on a policy violation.
- Decode data URLs without fetch in the background frame test.
Capabilities:
- Give browser windows their own capability. They load no installed plugin.
Add a unit test and a browser window smoke test for the command set.
Document the scans, the hash cache, the policy, and the window capabilities.
Keep the user preferences in settings.json in the app config folder.
WebView storage can be lost, and the host cannot read it. The file has
a schema number, a revision number, and one value for each section:
general, appearance, customThemes, customThemesLegacy, and language.
- settings_read gives all sections, the revision, and a one-time
notice.
- settings_write replaces one section, writes the file atomically, and
sends settings-changed to all windows. The limit is 8 MiB.
- settings_migrate writes the first file only when no file exists.
- The host moves a damaged file to settings.corrupt-<seconds>.json,
starts from the defaults, and reports this one time.
Each window loads the sections before its first render. One store in
src/lib/settings/store.ts replaces the storage listeners. When no file
exists, the window normalizes the old localStorage values and migrates
them. The old keys stay in place for one release. The window layout
and the open tabs stay in localStorage on purpose. The browser preview
keeps all preferences in localStorage.
Keep tab transfer offers in host memory, not in localStorage, because
an offer can hold unsaved text. A window takes an offer once. The host
checks the workspace root and a 120 second expiry. When the receiver
accepts the tab, the host sends tab-transfer-accepted to the source
window only. A refused offer stays open, and the source tab stays open.
A new window and a drop on the tab ribbon use one check.
The smoke harness serves the new commands from one shared state for
each browser context. Tests read saved values from the mock settings
file. Rust, unit, and smoke tests cover the changes.
Each smoke test now uses tests/smoke/_harness/ for Playwright, the Tauri
IPC mock, the in-memory workspace, and output folders, instead of its
own copy. The tests keep their interactions and assertions. Mock
handlers that the app never calls are gone.
- Split the four mixed regression scripts into 18 feature tests.
- Update tests that broke when the app changed on purpose. Each update
cites the app source that shows the new behavior.
- Mark two real app defects with @known-issue: the settings window
controls are 1px shorter than the main window controls, and plugin
tabs cannot be reordered by dragging without a workspace.
- Merge three palette unit tests into one table-driven test.
- The native tests load Playwright through the harness and read
NATIVE_CDP_URL, with their old variable names as fallbacks.
- A failed smoke test saves a screenshot and prints the console errors.
- The runner runs failed tests once more, alone, and reports a test
that then passes as flaky.
Result: 89 passed, 1 flaky, 2 known issues, 0 failed. Before, 45 of 78
passed.
- pnpm smoke runs tests/smoke/ in parallel. It starts Vite when nothing
serves SMOKE_URL, finds an installed Chrome when Playwright has no
Chromium, and skips a test with a reason when a requirement that the
test declares with "// @requires" is missing. Logs go to
output/smoke/logs/.
- tests/smoke/_harness/ holds the Playwright launch, page error
collection, the Tauri IPC mock with an in-memory workspace, and output
folders. tabs/order uses it as the first converted test.
- Pin Playwright 1.63.0, the version that browser-runtime uses.
- RUNESTONE_PLUGIN_REPOS names the folder of the sibling plugin
checkouts for buildPlugins, the menu audit, and the smoke tests.
- buildInstaller restores the version fields after Ctrl+C, keeps the
backups of each attempt, stops when the browser runtime is not staged,
and writes the file name instead of absolute paths to host.json.
- buildPlugins clears the staged Table Formulas package before copying.
- plugins/choiceMenus used the wrong Local Autocomplete folder name.