Phase 5-1.
Workbench.svelte keeps the state and the commands. Six components now
draw its regions, each with its own styles:
- WorkbenchHeader: the side pane buttons, the working tabs, the
actions, and the window controls.
- PluginRibbon: the ribbon of plugin views.
- LeftPane: the plugin sidebar, files, search, bookmarks, and the
workspace footer.
- DocumentArea: the plugin editor panes, the document panes, and the
save conflict banners.
- RightPane: the outline and the backlinks.
- StatusBar: the status line.
Each component keeps the root element of its region, so the shell grid
places them as before. Workbench.svelte has about 450 fewer lines.
There is no visible change.
pnpm check passes. pnpm test: 451 of 451 pass. Full smoke suite: 95
passed, 2 known. plugins/access failed one time and passed on retry
and 3 of 3 times alone.
Phase 4f.
- scripts/i18nAudit.mjs runs in pnpm check. It fails for a key that the
catalog does not have, a catalog key that the code does not use, and
a row without all four languages.
- message() marks a key that a variable carries to the translation call
later: table formats, formula errors, and browser status messages.
- 53 new rows with French, Japanese, and Simplified Chinese text for the
status and error messages of the workbench, the tree, Settings, theme
import, images, the built-in browser, and code blocks. The backlinks
toggle now translates too.
- 13 unused rows are gone.
- Errors of the plugin API stay in English. docs/development.md has the
rule in "Interface text".
pnpm check, pnpm test (350 of 350), and the full smoke suite pass,
except two tests that failed one time under load and passed on retry
and 3 of 3 times alone.
Phase 4d. session.svelte.ts holds the workspace state of each window:
the marks, the note index, renames, and typed change events. It
replaces refreshToken.
- One rename path: session.rename serves the tree, the note title, the
rename command, the link menu, plugins, and the template manager.
Open documents, plugin views, the index, and the marks follow it.
A title rename, the rename command, and a plugin rename now also
move pins and bookmarks.
- marksStore.svelte.ts is the only writer of .runestone/marks.json.
Changes run in order from the latest marks. A change from another
window reloads the marks.
- The note index updates only the paths that change, does not rescan
on window focus, reads in batches of 64, and keeps links, not text.
- Plugins also hear about .runestone/ changes from other windows.
- The outline uses the heading parser of heading links and Read, so
lines in code blocks are no longer headings.
- New note is above New file in the tree menu (card a6032af5).
- New workspace/session smoke test and new unit tests for the index
and the outline.
pnpm check, pnpm test (347 of 347), and the full smoke suite pass,
except workspace/manageTemplates, which failed one time under load and
passed on retry and 4 of 4 times alone.
Phase 4b. DocumentEditor.svelte replaces LiveWriter.svelte and the Monaco
EditorHost.svelte. Each open document has one CodeMirror state. Write and
Source are two compartment configurations of it, so they share the undo
history. editorStates.ts keeps the state while the tab stays open. The
Monaco model, the diff bridge, its timers, and sessions.ts are gone.
- Source: syntax colors from the theme tokens, lazy language packages,
line numbers, folding, and the current line in IDE, wrapped lines in
Writing, several carets, and bracket matching and closing.
- Lists (card 088e778b): Tab nests a list item and Shift+Tab moves it
up, in Write and Source. Both renumber the list. The source keeps
"1.". Write and Read show numbers, letters, then Roman numerals.
- Indent (card 696c30ce): a fixed 4 spaces in Write and Source.
- The code menu uses CodeMirror commands. The command palette item and
the Monaco styles, search, theme, and workers are removed.
- @codemirror/legacy-modes is pinned to 6.5.4. Version 6.5.5 uses
parser types that do not match @codemirror/language 6.12.
- 26 smoke tests use CodeMirror instead of Monaco. New tests:
editor/listNesting and the markdownLists unit tests.
- Docs: development, UI design, plugin host, user guide, and UI-040.
pnpm check, pnpm test (341 of 341), and pnpm build pass. The full smoke
suite passes, except one template test that passed on retry.
- The pty_open mocks in layout/workbench and plugins/lifecycle send
output through the channel that api.pty passes. Without a channel they
keep the old events, so released Terminal versions still pass.
- plugins/gitToolbar resolves the Git plugin's "@runestone/plugin-sdk"
imports to this repository's SDK build. The smoke runner builds the
SDK when it is missing.
- The menu audit no longer compares the Terminal plugin's copies of the
host menu files. The plugin now uses host menus through the SDK.
Checked with the released plugins and with the migrated Terminal, Git,
and Project Management branches.
The new package packages/plugin-sdk (@runestone/plugin-sdk) is the one source of the public plugin types.
It contains PluginApi and its members, the manifest type, API_VERSION, and feature checks
(hasFeature, requireFeature, requireFeatures, missingFeatures). It also contains the action icons and
the tooltip helper as DOM functions, because RuneStone has no API for them. Menus stay host-drawn through
api.ui.showActionMenu, so the SDK contains only the menu types. The SDK uses the Apache License 2.0.
The host imports the SDK with relative paths in src/lib/plugins/sdk.ts, src/lib/ui/actionIcons.ts, and
src/lib/ui/tooltip.ts. The completion, Git, background, and contribution contract files export the SDK types.
The menu files keep their types, because the Terminal plugin keeps copies of them. A unit test makes sure
that those types and the SDK types are the same. The menu inventory now scans the SDK source.
pnpm sdk:build compiles the SDK to dist/. pnpm release:sdk --version <v> builds it, then commits and tags
v<v> in a local clone of the public repository. It never pushes, and it prints the push commands.
It stops before a change in these conditions:
- The clone is missing, has changes, or is not on a branch.
- The tag exists, or the version is not greater than the current version.
- The package has no LICENSE file, or the SDK source has changes that are not committed.
A failed attempt restores the version and the clone.
pnpm check type checks the SDK and the example plugin. The example plugin now has JSDoc types from the SDK.
pnpm test covers the feature checks, the host and SDK parity, and the release script with temporary
Git repositories. The plugin development, release, development, and completion guides describe the SDK.
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.
The formula engine, the rendered results, and the formula help now
come from src/lib/formulas/. The editor and the renderer call this
module directly. The tableFormulas contribution type is removed.
- Add the tableFormulas general setting (default on) and a switch in
Settings > General. When it is off, formulas show as source text.
- Do not load an installed runestone.table-formulas package. Settings
> Plug-ins marks it as included with RuneStone and tells the user
that it can be removed. The user's files stay in place.
- Translate the formula help and the error descriptions into French,
Japanese, and Simplified Chinese.
- Port the plugin unit tests. Test the setting and use a test-only
contribution for the generic plugin lifecycle tests.
- Smoke tests load only Terminal. The formula and lifecycle tests use
the built-in feature and its setting.
- Remove scripts/buildPlugins.mjs, the build:plugins script, and the
plugin-packages requirement of the smoke runner.
- Remove RuneStone_Table_Formulas from the menu audit scope. It had no
menu surfaces.
- Update the README, the user guides, and the developer references.
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.
Replace the three error styles with one Error type and one Result alias in
error.rs. The error crosses IPC as the same plain string as before. The
message text does not change.
Move the shared file mechanics to fsutil.rs. These are the reserved-name
check, the link and junction check, the limited reads, and the atomic
writes. Each module keeps its own path rules, limits, and messages. The
plugin settings writer now flushes its file to disk before the rename.
Remove the current_root_path and list_entries wrappers and an unused mime
value. Use named windows-sys constants for the process, file, drive, and
error codes.
Add a test that compares the command lists in lib.rs, build.rs, and the
capability files. The settings capability must be a subset of the full list.
In Cargo.toml, set the author, keep only the rlib crate type, and remove
the unused thiserror dependency. Remove panic = "abort" from the release
profile. A panic on a worker thread then stops only that thread. It does
not stop the editor with unsaved buffers.
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.
Unit tests go to tests/unit/<area>/, browser smoke tests to
tests/smoke/<area>/, and tests against a running desktop app to
tests/native/. Files named after dates, work passes, or Kanban cards get
feature names, for example editorOctober12 -> editor/footnotes.
scripts/ keeps the build, release, and package tools. Plugin repositories
import scripts/packagePlugin.mjs, and the Terminal smoke test imports
scripts/pluginMocks.mjs, which now re-exports the harness copy.
The unit tests get their own type check (tests/tsconfig.json) with Node
types. pnpm check runs it after the app check. Add @types/node and fix
the three test mocks that it reported.
Move the agent instructions from AGENTS.md to CLAUDE.md. AGENTS.md now
points to CLAUDE.md. The UI rules move to docs/ui-design.md. The version
and release policy moves to the new docs/releases.md.
Rewrite the README, the user guides, and the developer references.
Check each claim against the code. Remove old version history and
repeated warnings. Link to Gitea at git.knottywyvern.com instead of the
LAN address. Move the October 13 menu audit to the archive.