RuneStone 1.0.0

This commit is contained in:
Knotty Wyvern
2026-11-03 00:23:07 -07:00
commit 5557443ed1
818 changed files with 239368 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
# Documentation archive
[User guide](../user-guide.md) · [Development](../development.md)
These records preserve past checks, decisions, and proposals. They do not define current behavior or authorize planned work.
| Record | Purpose |
| --- | --- |
| [macOS validation, 0.1.44](macos-validation-0.1.44.md) | Apple silicon DMG, source commit, checksums, checks, and acceptance limits |
| [Linux installer 0.1.44](linux-validation-0.1.44.md) | Debian build, checksum, automated checks, and remaining validation gaps |
| [Linux validation, October 14–15](linux-validation-2026-10.md) | Native builds, desktop smoke checks, Debian/AppImage packages, and test limits for 0.1.34 |
| [Menu and color review, October 13](menu-audit-2026-10-13.md) | Menu coverage, palette corrections, contrast measurements, and the 0.1.32 builds |
| [Plugin release trial, October 5](plugin-release-trial-2026-10-05.md) | Simulated Gitea downloads, native installation, and repeat steps |
| [Kanban review, October 8](kanban-review-2026-10-08.md) | Scope, assignments, checks, and the 0.1.13 test builds |
| [Kanban changes, October 8](kanban-changes-2026-10-08.md) | Editor, settings, browser, and plugin changes |
| [Kanban follow-up, October 8](kanban-followup-2026-10-08.md) | Menu, theme, and Git graph checks |
| [App updating draft](app-updating-draft.md) | Unaccepted proposal for installer repair and later update checks |
| [Development notes, 0.1.8](development-0.1.8.md) | Settings windows and pasted Markdown |
+111
View File
@@ -0,0 +1,111 @@
# App updating draft
Status: Draft for review. The App updating card stays in Backlog until the user accepts this scope.
RuneStone needs an update flow that keeps workspace files, settings, plugins, and browser profiles.
Users must not uninstall RuneStone before an update or a same-version repair.
The proposed first milestone makes the installer reliable and clear. A later milestone adds update checks inside RuneStone.
## Current state
The card reports an uninstall and reinstall workflow. The project rules already require direct reinstall and update.
The Windows configuration uses a per-user NSIS installer and blocks downgrades.
The 0.1.15 release notes tell users to run the installer directly, but also identify native installer behavior as untested.
This difference needs reproduction on an installed copy before implementation.
Sources: [project rules](../../CLAUDE.md#windows-installer), [Windows configuration](../../src-tauri/tauri.windows.conf.json), and the 0.1.15 release notes (no longer in the repository).
## Proposed first milestone
The installer detects an existing installation and defaults to reinstall or update.
It shows the installed version, package version, and destination before it changes files.
The primary action reads Update for a newer version and Reinstall for the same version.
An older package stops with a clear downgrade message.
If RuneStone is open, setup asks the user to close it after saving work.
The app must not discard unsaved files or end active terminal work without a user decision.
The installer keeps the existing installation path and application identity.
It replaces program files and bundled browser files without deleting user data.
After success, setup offers Open RuneStone.
After failure, setup identifies the failed step and offers a retry or a recovery instruction.
A retry must not require manual removal of the application or its data.
## Proposed update screen
Settings gains an Updates category with a recognizable icon and a visible label.
It shows the installed version, last check, available version, release notes, and download state.
Check for updates is a manual action in the first implementation.
Background checks remain a later option. Downloads and installation require explicit user actions.
| State | User action | Result |
| --- | --- | --- |
| No check yet | Check for updates | Read the selected release channel |
| Current version | Check again | Show that no newer release exists |
| Update available | Download update | Show progress and allow cancellation |
| Download complete | Restart and update | Save work and close the app before setup |
| Open work prevents restart | Return to RuneStone | Keep the downloaded package for later |
| Offline or failed download | Retry | Keep the installed app usable |
| Invalid package | Download again | Do not run the invalid package |
The update service must compare numeric version parts, including build numbers above 99.
It must not mistake a same-version repair for a newer release.
The default channel excludes trial releases. A future trial channel requires an explicit choice.
## Release source and package checks
The in-app milestone needs a chosen release source, stable metadata format, and publisher verification method.
The proposed source is the existing Gitea service, with a dedicated application release contract.
Plugin download support does not establish an application update contract.
The contract must identify the version, Windows architecture, installer URL, file size, digest, release notes, and release channel.
The app validates the downloaded bytes and publisher before execution.
Transport security and a digest alone do not prove the publisher when the source itself changes.
Signing keys and credentials stay outside the repository. The build process must document key recovery and rotation.
The app rejects a mismatched version, architecture, digest, or signature.
It does not run an arbitrary URL as an installer.
If private releases need authentication, the credential flow requires a separate design before implementation.
## Data and plugin behavior
| Data | Required result |
| --- | --- |
| Workspace files and hidden workspace metadata | Preserve all files and paths |
| Application settings and recent workspaces | Preserve values and reopen behavior |
| Installed plugins and plugin settings | Preserve packages, enable states, and stored data |
| Browser profiles, cookies, history, and bookmarks | Preserve data and profile identity |
| Unsaved documents and active terminals | Resolve before restart, without silent data loss |
Application updates do not silently replace third-party plugins.
Plugin update support stays outside this card. Existing plugin ZIP installation remains separate.
An incompatible plugin should remain installed but inactive, with a clear explanation, if compatibility checks become necessary.
That compatibility policy requires defined host requirements before enforcement.
## Acceptance checks
| Scenario | Pass condition |
| --- | --- |
| Clean installation | Setup installs and opens RuneStone |
| Same-version reinstall | Reinstall is the default action and restores program files |
| Upgrade from the previous build | Setup updates directly without an uninstall step |
| Older installer | Setup blocks the downgrade |
| Custom installation path | Setup uses the existing path |
| Populated workspace and user data | Before and after file hashes and settings match |
| App open with unsaved work | The user can return to work without losing edits |
| Failure or cancellation | User data remains intact and retry is possible |
| Download or publisher check failure | The app does not execute the package |
| Successful update | The app reports the installed version and opens normally |
Test the installer in a disposable Windows profile with representative workspace, plugin, and browser data.
Automated source checks do not replace the native installer checks.
## Decisions before To Do
1. Approve installer repair as the first milestone, or include the update screen in the first card.
2. Choose the application release source and its public or private access model.
3. Choose the publisher verification and signing process before an in-app installer launch.
The recommended first card covers installer repair and native regression checks.
The update screen can follow after the release source and signing decisions.
This draft does not authorize updater implementation or move the card into To Do.
+19
View File
@@ -0,0 +1,19 @@
# Historical development notes: 0.1.8
[Archive](README.md) · [Current development guide](../development.md)
## Settings windows and pasted Markdown
Desktop Settings opens in a separate movable window for each workspace window.
Repeated requests focus the existing Settings window.
Closing the workspace window also closes its Settings window.
Settings opened before a workspace closes when that workspace opens, so plugin context cannot remain stale.
Saved preferences synchronize across windows. The browser preview keeps the Settings dialog.
The separate window has dedicated native permissions and loads only the browser settings contribution.
Plugin installation still lists all installed plugins.
Live Markdown formatting refreshes when background parsing finishes after a large paste.
Run `tests/smoke/editor/markdownPaste.smoke.mjs` against the development server to check pasted source and rendered formatting.
Run `tests/smoke/settings/window.smoke.mjs` to check the Settings layout, save synchronization, and mocked native requests.
The browser checks do not test native title-bar movement or desktop clipboard behavior.
+55
View File
@@ -0,0 +1,55 @@
# Kanban changes for October 8 2026
This pass covers eight To Do cards across RuneStone, RuneStone Project Management, and RuneStone_Git.
The global project management helper read all three boards without data issues.
Selection used board placements and the separate priority field.
The App updating card received a [draft](app-updating-draft.md) and remains in Backlog.
## Changes
| Board | Card | Result |
| --- | --- | --- |
| RuneStone | Autocorrect only shows errors | Plain editable text permits the native spelling menu. Selection and table action menus remain available. |
| RuneStone | New file button | New file accepts the complete name without adding an extension. Rename includes the extension. |
| RuneStone | Monospace font is too big | Both code layouts use the shared 13px size and 21px line height. |
| RuneStone | Themes and theme switching | GPT, Claude, Sakura, and RuneStone support light and dark modes. Terminal uses green on black. |
| RuneStone | Users need the ability to clear specific cookies | Settings lists and filters cookies and history for each profile, with individual removal. |
| Project Management | Text box for adding new cards is somewhat broken | The composer uses the empty list space above the Add control. |
| Project Management | Add new card UI persists when not in use | Focus changes hide the composer and retain its draft. Cancel, view changes, board changes, and disposal discard drafts. |
| Git | Git interface missing functions | Visible push and pull controls accompany separate collapsible Changes and Graph sections. |
## Source checks
RuneStone passes its type checks with zero errors or warnings and all 195 unit tests.
The native suite passes 75 tests. Three existing tests remain ignored because they require external fixtures or services.
Git passes 11 native fixture tests, four plugin unit tests, source compilation, and sidebar browser checks.
The Git checks include upstream selection, divergence, dirty files, merge history, and errors.
Project Management passes type checks, 98 unit tests, and all 119 browser tests.
Its current source compiles, and both compiled-plugin browser tests pass.
The first compilation attempt stopped on Git ownership checks. A process-local safe-directory setting permits this known checkout.
No global Git trust setting changed.
Browser runtime checks pass all 35 unit tests, syntax checks, and the native Electron smoke test.
Individual removal preserves other cookie paths, other history entries, other profiles, bookmarks, and open tabs.
The host browser checks cover filters, busy controls, errors, profile changes, and delayed responses.
The cookie implementation uses the [Electron Cookies API](https://www.electronjs.org/docs/latest/api/cookies) to expire the selected cookie's exact domain and path.
Editor and menu checks cover exact filenames, extension changes, duplicate-name protection, fonts, spelling event dispatch, and shared menus.
Visual checks cover narrow settings and light and dark themes.
The appearance check covers all palettes, persistence, cross-window changes, and existing and newly opened code editors.
The initial Terminal check found gold brackets. The theme now sets all bracket colors to green. Separate editor theme IDs restore normal syntax colors after Terminal mode.
## Limits and review
Native spelling suggestions and actual correction still need desktop acceptance.
The Git graph uses text topology and shows at most 100 commits.
Push and pull require a configured upstream and existing Git authentication. Pull permits only fast-forward updates.
The updater remains a draft. This pass does not implement its proposed milestones.
Implementation-ready cards move to Review after their checks pass. Done remains reserved for user acceptance.
Build work must use GPT-6.1 Sol with medium reasoning, as requested.
It must produce the installer and changed Project Management and Git ZIPs.
The installer needs the rebuilt Browser runtime. A separate Browser plugin ZIP is unnecessary.
Source checks retain the existing versions until each distributable build starts.
@@ -0,0 +1,39 @@
# Menu, theme, and Git graph changes
These changes cover three To Do cards from the RuneStone and RuneStone_Git boards on October 8, 2026.
The local test builds were RuneStone 0.1.17 and Git 0.1.4.
## Changes
| Card | Result |
| --- | --- |
| 591c856a-2dc8-40a8-b656-b1d709c59114 | WebView2 supplies spelling suggestions to the shared menu. Native commands apply corrections. |
| 8a2f3bef-dec0-4b8e-8cc8-923a204386ec | Claude follows Anthropic colors and font stacks. Sakura uses the card palette and light mode. GPT and Terminal themes are removed. |
| 7d194eeb-fd9c-4116-b716-f8b96a3b1de8 | Git history draws commit nodes and parent links, with branches, tags, messages, authors, and dates. |
Saved GPT and Terminal selections migrate to RuneStone with their previous light or dark mode.
Saved dark Sakura selections migrate to light Sakura.
Claude uses local Lora and Poppins fonts, with Georgia and Arial fallbacks. It does not download fonts.
Sakura syntax colors depend on the tokens that each language supplies.
The spelling bridge validates the window, request, and enabled command before it acts.
Dismissal completes the native request. Unsupported targets retain their native menu.
The graph shows at most 100 commits. Dashed links mark parents outside that history.
The Git ZIP requires the matching host build. Earlier hosts show an update message.
## Checks
- Host source check: no errors or warnings.
- Host unit tests: 198 passed.
- Native tests: 78 passed, three ignored.
- Frontend production compilation: passed.
- Git unit tests: five passed. Plugin compilation and sidebar, UI, and host browser checks passed.
- Appearance checks: migration, palette colors, font stacks, window sync, code editors, and 360px settings passed.
- Shared menu checks: both themes, keyboard navigation, native command mapping, and fallback passed.
Screenshots and check logs are in `.audit/`. Git screenshots are in `../RuneStone_Git/output/`.
The native Windows check confirmed real WebView2 commands in the shared menu. Native Undo restored Writer text in an isolated test profile.
That profile supplied no spelling suggestions. Correction and undo with a spelling suggestion still need desktop acceptance.
The reusable check is `tests/native/spelling.native.mjs`. Set `REQUIRE_NATIVE_SUGGESTIONS=1` to require an actual suggestion.
Cards move to Review after their checks pass. Done remains reserved for user acceptance.
+110
View File
@@ -0,0 +1,110 @@
# Kanban work, October 8, 2026
## Scope and inspection
Workspace: `D:/Users/KnottyWyvern/Documents/RuneStone`.
The RuneStone board contains six selected To do cards. The Project Management board contains eight.
All 14 selected cards are unblocked.
Selection uses each board placement, not the shared card status.
Command from the RuneStone checkout: `node ../RuneStone_ProjectManagement/.agents/skills/runestone-project-management/scripts/inspect.mjs boards --workspace .`.
The first helper run failed because the renamed plugin checkout lacked usable dependencies (`ERR_MODULE_NOT_FOUND: yaml`).
The documented frozen-lockfile install restored dependencies.
The recent sandbox workspace contained no boards. The RuneStone workspace contained both requested boards.
The helper then retrieved both boards and all 14 cards with exit code 0 and no data issues.
Manual card retrieval was not necessary. The initial dependency failure remains part of this test record.
The shell sandbox also failed before command execution. Authorized commands ran outside that broken sandbox.
## Assignments
Related cards share an agent when their behavior or files overlap. These cards describe distinct outcomes, not confirmed duplicates.
Keep each card and its acceptance criteria. Do not delete or archive cards solely to group implementation.
The coordinator owns board updates, the skill, this record, and integration checks.
| Group | Card IDs | Model and effort | File ownership and sequence |
| --- | --- | --- | --- |
| Tabs and ribbon | bee9f324, c8321a48, d0850861 | Astra 6 high | Workbench, tab/pane layout, related smoke tests |
| Settings density | d8c20c7d, 2a509815 | Sol 6.1 medium | Settings windows, plugin list, dedicated tests |
| Repeated paste | 68136a13 | Sol 6.1 medium | LiveWriter, clipboard lifecycle, paste regression |
| Card details | 32f33744, 30a4c620, ed978e3d, 57074b19 | Astra 6 high | PM detail/editor UI and styles, before other PM groups |
| Card transfer | 7e41dc9e | Astra 6 high | PM board/store/UI, after card details |
| Board controls | 6369fc91, fe7e86e4 | Luna 6 max | PM board title/menu, after transfer releases UI ownership |
| Image viewer | 68fd3750 | Sol 6.1 medium | PM image viewer, description preview, styles, and image tests |
Only one agent edits each file at a time. Separate functions do not imply separate ownership.
Agents preserve all existing uncommitted changes. They do not reset files or commit unrelated work.
The coordinator moves cards to Review after their relevant checks pass. Done requires user acceptance.
The initial implementation scope did not include distributable builds or version changes.
## Skill checks
The six board-helper tests pass, including multiple workspaces, placements, migration conflicts, and read-only behavior.
The revised skill passes the prose lint at 0.97 issues per 100 words.
The Python format validator first failed because PyYAML was absent. It passed after a temporary dependency install.
## Host review results
All six RuneStone cards moved to Review.
The tab bar uses the available width and keeps its new-tab button beside the tabs.
Closing the last tab leaves one New tab. The two misleading ribbon launchers are removed.
Settings and the main window share their header height. Plugin rows use shared spacing tokens.
The paste fix accepts clipboard line endings and stops synchronous edits from returning to their source editor.
Checks pass: host type checks with zero errors or warnings, and all 191 unit tests.
Browser checks pass for tab order, plugin access, menu consistency, saved layout, settings density, settings titlebar, and settings windows.
Paste checks pass for 12 repeated clipboard cycles, saved source, editor reopen, line-ending variants, undo, and 5,000 formatted sections.
Visual checks cover light and dark themes, an 880-pixel tab bar, and settings widths down to 360 pixels.
Native desktop window calls used browser mocks. Native titlebar behavior still needs user acceptance.
## Project Management review results
The four card-detail cards moved to Review.
Description editing stays inside the card. Saved Markdown opens formatted.
Detail hints sit inside buttons. Priority choices use colored icons in a picker beside the trigger.
Type checks, unit tests, and 11 focused browser tests pass for these changes.
## Source review result, before packaging
All 14 selected cards are in Review. The helper confirmed their exact board placements after the updates.
No cards moved to Done. No cards were deleted or archived.
Seven subagents handled the seven groups with one writer for each file.
The small board-control group used Luna 6 max after source review confirmed its limited scope.
The other assignments used Astra 6 high or Sol 6.1 medium as shown above.
Card transfer now preserves the card identity, body, metadata, and unrelated board placements.
The image viewer opens from saved descriptions and supports outside-click dismissal, Escape, focus restoration, and image overlays.
Board menu actions now have icons. The smaller title pencil appears on hover or keyboard focus.
Final checks:
- RuneStone type checks: zero errors and warnings. All 191 unit tests pass.
- Host browser checks include installation, removal, menus, tabs, layout, settings, paste, and undo.
- Project Management type checks and compilation pass. All 101 unit tests and all 103 browser tests pass.
- The six skill-helper tests and the skill format validator pass.
- Both repository patches pass the whitespace check.
The first complete PM browser run exposed seven outdated or brittle test expectations.
Corrections scope deadline inputs to their field region, expect the saved description preview, and establish keyboard focus before checking its indicator.
The next complete run passed all 103 tests. The host install smoke also needed its removed ribbon selector replaced with the command API.
These test corrections retain the existing behavior checks.
Compiled PM output supports bundled-plugin tests. No installer or release ZIP was produced during source review.
Source review used RuneStone `0.1.12` and Project Management `0.2.17`.
The automated browser checks use mocked host calls. Native desktop behavior still needs user acceptance.
Test output is saved under the plugin repository's ignored `.audit/kanban-review-2026-10-08/` directory.
Original card backups are in `.runestone/agent-work-2026-10-08/backups/` in the RuneStone workspace.
Prose lint for this record: 1.45 issues per 100 words.
## Test builds requested after source review
The user requested distributable builds for desktop testing.
RuneStone 0.1.13 is available as `src-tauri/target/release/bundle/nsis/RuneStone_0.1.13_x64-setup.exe`.
Project Management 0.2.18 is available as `../RuneStone_ProjectManagement/plugin-packages/runestone.pm-0.2.18.zip`.
The 0.1.13 installation notes are no longer in the repository.
Both builds completed and passed artifact integrity checks. Previous release files remain intact.
The installer includes the existing browser runtime. Its application version is 0.1.13 and downgrades remain disabled.
The plugin ZIP has its manifest at the archive root. Its recorded file hashes match its contents.
Post-package checks passed the PM type check, 101 unit tests, and 103 browser tests.
Native host tests passed 63 tests, with three ignored.
The 14 cards remain in Review for user acceptance.
+23
View File
@@ -0,0 +1,23 @@
# RuneStone 0.1.44 for Linux
Experimental unsigned Debian installer for x86_64, built on Ubuntu 26.04.1 LTS from `codex/combined-pr-review` at `46e3daae6c1da7539ce124c7aae58c8c5285384a`.
The release version remains 0.1.44 as requested. Includes the freshly packaged Linux Browser runtime.
Install with `sudo apt install ./RuneStone_0.1.44_amd64.deb`.
- Source checks: zero errors and warnings.
- Source tests: 275 passed, one skipped; two test files failed because the external Table Formulas package is absent. Its expected repository was inaccessible during this build.
- Native Rust tests: 97 passed, three ignored, zero failures.
- Browser source checks and all 45 unit tests passed.
- Packaged Browser: all 12 engine smoke checks passed with the sandbox enabled. Virtual GPU VAAPI warnings occurred.
- Installation, same-version reinstall, upgrade, removal, and compatibility with other distributions remain untested.
See `host.json`, `SHA256SUMS`, and the accompanying logs for package verification and native test results.
Package: `RuneStone_0.1.44_amd64.deb` (136,742,648 bytes).
SHA-256: `313f15e68c3b3a6eec9fb223548c9843e6e87af5566885088ddbf7434742e100`.
Package inspection confirmed version 0.1.44, architecture amd64, executable permissions, and no unresolved host or Browser libraries on the build host. The host requires GLIBC 2.39; the Browser requires GLIBC 2.25.
Completed package, release notes, checksum, metadata, and check logs are stored in `releases/0.1.44/` outside Git. The bundle folder retains no second installer copy. Gitea release-asset upload was not performed because no authenticated HTTP session or stored credential was available.
+128
View File
@@ -0,0 +1,128 @@
# Linux validation records: October 2026
[Documentation archive](README.md) · [Linux development](../linux.md) · [Linux installation](../installation.md#install-on-linux)
These records preserve the October 14–15 checks for version 0.1.34.
Results and outstanding work describe those test runs, not the current release.
## Validation record: 2026-10-14
Validated on `desk`: Ubuntu 26.04.1 LTS, x86_64, four CPUs, 7.2 GiB reported RAM,
XFCE/X11, Linux 7.0.0-38-generic. The execution environment reports a container
boundary and underlying KVM virtualization. This does not validate Ubuntu 24.04,
Wayland, ARM, or another distribution.
Source: base commit `edef2520afc92f7896454bf94a8ea15bbf4e1684` plus the Linux
readiness patch and the Browser window portability fix. The original transferred
source archive had SHA-256
`b16643bfc7a634e5a5d17a7c246e87d95a458c06fb8afb45899a28a460e03047`.
The first native compile found a Windows-only `drag_and_drop(false)` call in
`src-tauri/src/browser.rs`; it now uses the cross-platform
`disable_drag_drop_handler()` API already used by the settings window.
Toolchain: Node.js 24.22.0, pnpm 10.34.7, Rust/Cargo 1.93.1, GLib 2.88.0,
GTK 3.24.52, and WebKitGTK 4.1 version 2.52.6. Native builds used one job and
`CARGO_PROFILE_DEV_DEBUG=0 CARGO_PROFILE_TEST_DEBUG=0` to conserve RAM and disk.
| Check | Recorded result |
| --- | --- |
| `pnpm install --frozen-lockfile` and `npm ci --prefix browser-runtime` | Passed |
| `pnpm check` | Passed; zero errors and warnings |
| `pnpm build` | Passed; bundle-size warnings remain |
| `pnpm browser:check` and `pnpm browser:test` | Passed; 44 Browser unit tests |
| Browser Linux packaging and `pnpm browser:stage` | Passed; x86_64 runtime staged |
| `npm --prefix browser-runtime run test:packaged` | Passed; all 12 engine smoke checks, sandbox enabled |
| `pnpm test` | 238 passed, one skipped, two test files failed because the Table Formulas package was absent |
| `cargo test --manifest-path src-tauri/Cargo.toml --lib --locked --offline -j 1` | Passed after the portability fix; 92 passed, three ignored |
| `pnpm tauri build --debug --no-bundle -- --locked --offline -j 1` | Passed; native debug executable, version 0.1.34 |
| Tauri X11 launch | Visible 1400 by 900 window; rendered frontend verified with an internal capture |
| Host Browser integration | Open Browser opened a Browser tab with address and profile controls; no webpage-navigation claim |
GUI checks used isolated task-local XDG settings/data directories, and the test
processes were closed afterward. Virtual-GPU EGL/VAAPI warnings occurred; they did
not prevent these smoke checks. No sandbox, security, swap, or permission workaround
was used. Existing user settings and workspaces were not used.
No installer or release package was produced, versions were unchanged, and nothing
was published. Remaining work includes supplying/building `RuneStone_Table_Formulas`
and rerunning the full source suite, completing the [Linux desktop checks](../linux.md#desktop-checks), and
validating Debian/AppImage installation and lifecycle behavior on the intended
target distribution. These results do not establish full Linux support.
### Initial bounded release attempt
The normal release profile (`opt-level = 3`, full LTO, one codegen unit) was
attempted with one Cargo job, locked/offline dependencies, and the already-tested
frontend output. Before starting, desk had about 2.0 GiB available RAM, effectively
full 4.0 GiB swap, and 4.1 GiB free disk. A temporary user service bounded the
entire build to 1,677,721,600 bytes of RAM and no additional swap.
The release build reached the GTK Rust crate but exceeded that hard cap. The
service recorded `Result=oom-kill`, `MemoryPeak=1677721600`, and zero swap use after
14 minutes 47 seconds. Soft memory throttling was tried first; it caused repeated
reclaim, so the soft threshold was removed while retaining the hard cap. No larger
memory allowance was attempted. The temporary service was cleaned up; dependency
and build caches were preserved. About 3.3 GiB disk remained afterward.
No optimized executable, Debian package, or AppImage was produced. AppImage
bundling was not attempted because it needs the release executable. Package
contents, generated dependency metadata, and installation lifecycle therefore
remain unvalidated. `ldd` found no missing libraries for the previously tested
debug host and staged Browser on desk. In addition to host libraries, the Browser
needs NSPR/NSS, CUPS, and ALSA libraries; their Ubuntu 26.04 providers include
`libnspr4`, `libnss3`, `libcups2t64`, and `libasound2t64`. Check the eventual package
declares the appropriate runtime dependencies; the current machine having them
installed does not prove that package metadata is complete.
The smallest next step is to free more RAM on desk, or use a host with more
available memory, then retry the cached release build with a larger bounded
allowance. Starting with at least 3 GiB available RAM provides more headroom but
does not establish the required peak; measure it during the retry. Recheck disk
before bundling. Existing debug-build and smoke-test results above still stand.
### Release package validation: 2026-10-15
After desk returned with more headroom, a fresh resource check found 4,956,172 KiB
available RAM (about 4.73 GiB), nearly all 4 GiB swap free, and 47 GiB free disk.
No finite inherited user-cgroup memory limit was found. The cached release build
was retried with one job, a temporary 3.5 GiB memory cap, and no build-group swap.
It completed successfully in 12 minutes 32 seconds, with 3.5 GiB peak group memory
and no OOM event. The earlier failure establishes only that the chosen 1,600 MiB
cap was insufficient; it does not establish that the 8 GB VM cannot build.
The initial Debian bundle declared only GTK and WebKitGTK. Added
`src-tauri/tauri.linux.conf.json` to declare OpenSSL plus the Browser's NSS/NSPR and
ALSA dependencies. The release executable requires GLIBC 2.39, so the Debian
metadata also declares `libc6 (>= 2.39)`. Tauri retains its default GTK/WebKitGTK
dependencies. Recheck symbol requirements when changing the compiler or build host;
this floor is evidence from this build, not a permanent portability guarantee.
The Debian package was regenerated and its final dependency metadata verified.
| Release check | Recorded result |
| --- | --- |
| Normal optimized release profile and Debian bundling | Passed, using locked/offline Cargo dependencies and the previously validated frontend |
| Debian package | `RuneStone_0.1.34_amd64.deb`, package name `rune-stone`, version `0.1.34`, architecture `amd64` |
| Debian package checksums, desktop entry, resources and permissions | Passed; host and Browser executables are executable, Browser resource directory is traversable, packaged checksums match |
| Debian shared libraries on desk | All host and Browser libraries resolve |
| Extracted Debian GUI smoke | Host rendered a visible window, launched its own packaged Browser executable, and rendered an HTTPS page |
| AppImage bundling | Passed from the same optimized release executable; 2 minutes 18 seconds, about 1.6 GiB peak memory, no build-group swap |
| Extracted AppImage GUI smoke | AppRun launched, bundled WebKitGTK child processes were used, its packaged Browser launched, and an HTTPS page rendered |
Both package tests used isolated task-local settings/data and closed their test
processes afterward. AppImage's supported extraction route was used because the
VM does not expose `/dev/fuse`; FUSE-mounted execution was not tested. Virtual-GPU
acceleration warnings did not prevent rendering. Versions remain 0.1.34 under the
explicit validation-build instruction. These are unsigned experimental artifacts,
not published releases. Completed package files, metadata, test limits, and
checksums are archived under `releases/0.1.34/` outside Git.
No app was installed system-wide and no existing user workspace/settings were
used. Installation, same-version reinstall, upgrade, removal, the full desktop
acceptance matrix, Ubuntu 24.04, Wayland, and other architectures remain untested.
The Table Formulas external dependency remains absent. Native library resolution
on desk and successful extraction smoke checks do not prove clean-machine package
installation or compatibility with other distributions.
The AppImage's bundled WebKitGTK and JavaScriptCoreGTK libraries require GLIBC
2.43. The Debian executable's GLIBC 2.39 floor therefore does not describe the
AppImage's minimum runtime. Treat this AppImage as an Ubuntu 26.04 validation
artifact rather than a portable Ubuntu 24.04 build.
+23
View File
@@ -0,0 +1,23 @@
# RuneStone 0.1.44: macOS Apple silicon
Built on October 21, 2026 from `codex/combined-pr-review` at `46e3daae6c1da7539ce124c7aae58c8c5285384a`. Version 0.1.44 was explicitly requested to accompany the existing Windows release.
Download `RuneStone_0.1.44_aarch64.dmg`, open it, and drag RuneStone into Applications. Quit RuneStone before replacing an existing installation.
Includes Browser runtime 0.1.7 with Electron 44.5.1. Framework symlinks are preserved. Host and Browser have verified ad hoc signatures. Developer ID signing, notarization, Intel support, desktop launch, installation and upgrade acceptance remain untested.
Validation: type checks passed with zero errors or warnings; 281 host tests passed with one skipped; 94 Rust tests passed with three ignored; 45 Browser tests and native Browser engine checks passed. The host test run used Table Formulas compiled from `e662b5dc746111fc2f99849a6e877ff2fb80c306`. The optimized build reported one existing unused-function warning.
The DMG passed image verification. Mounted-image checks verified version 0.1.44, ARM64 executable, Applications shortcut, Browser framework symlinks, strict host and Browser signatures, and execution of the packaged Browser runtime. These checks do not establish desktop acceptance.
SHA-256 (`RuneStone_0.1.44_aarch64.dmg`):
```text
4dc5d372c30149a6e506379eb3d9e654c692fc3ac507b0282f588448e8d01664
```
Build procedure: frozen pnpm install; Browser npm ci, checks, tests, engine tests, package and stage; locked optimized Tauri app build; replace generated Browser resources with a symlink-preserving copy; ad hoc sign and verify Browser and host; create a compressed DMG with an Applications shortcut; verify and mount the DMG.
Artifact: `releases/0.1.44/RuneStone_0.1.44_aarch64.dmg`. Logs and packaging scripts remain under `output/macos-installer-0.1.44/`.
Published alongside the existing Windows installer in the [Gitea 0.1.44 release](https://git.knottywyvern.com/kwyvern/RuneStone/releases/tag/v0.1.44), with `macos-release-notes.md` as a separate attachment. The existing release tag was retained.
+87
View File
@@ -0,0 +1,87 @@
# Menu and color review — October 13, 2026
The seven boards contained eight To Do cards: five in RuneStone and three in Project Management. No selected card was blocked.
Reference cards remain in Backlog. They supply evidence and do not count as implementation tasks.
## Menu coverage
The source audit covers RuneStone, Project Management, Terminal, Background Slideshow, Local Autocomplete, Git, PDF Viewer, and Table Formulas.
The [inventory](../menu-surfaces.json) records 38 source files, their design route, and their check.
Project Management has 21 distinct menu, choice, and picker routes in its detailed local inventory.
PDF Viewer and Table Formulas contain no independent menu renderer. Git's commit list is a persistent listbox.
| Surface | Result |
| --- | --- |
| Linked cards | Both Relationship and Card to link use the shared menu. Search updates the card choices. |
| Move card to board | Destination board and list use shared menus inside the dialog. |
| Other PM choices | Cover, bulk moves, board, list, status, and backgrounds use the shared adapter. |
| Search results | Labels, tags, details, notes, workspace files, Terminal choices, and slideshow images use shared picker presentation. |
| Browser | Profile and web-data choices use the shared menu. |
| Local Autocomplete | Server type uses the host menu when the API is available. |
| Terminal | Menu snapshots match the host. The default profile uses a radio menu. |
| Keyboard navigation | Menu focus scrolls only its panel. A short modal no longer dismisses the menu during arrow navigation. |
The earlier linked-card check tested only Relationship. Its neighboring Card to link control remained native.
The richer-layout allowance also let independent picker styles persist. The guide now requires shared presentation within those layouts.
Run `pnpm check:menus` for the source audit. It rejects new or changed entry-point counts and stale Terminal snapshots.
This check detects known source patterns. It does not prove every runtime state, native menu, or future rendering method is compliant.
Browser tests must still open the exact control from each reported screenshot.
## Functional color
No inspected rule requires a saturation or HSV value ceiling. The local guide used quiet and restrained language without separating structure from color strength.
That ambiguity could influence choices. It does not establish the cause of every earlier model output.
The guide now permits 100% saturation and value where they serve recognition or meaning.
Holo's prior mean saturation across palette roles was 30.24%. Asuka was 53.05%, and Malfoid was 16.24%.
Some existing colors already reached 100% value. The problem was not a universal numeric cap.
Holo now uses copper, chestnut, cream, amber, and red from the current fan-art references.
Its amber accent has 82% saturation and 100% value. Its minimum tested syntax contrast is 4.61:1.
The further theme pass below covers Asuka and Malfoid. Priority symbols use full saturation and value, opaque strokes, and readable theme text.
## Theme refinements and font roles
Asuka now assigns more syntax roles to red, orange, yellow, and blue. One green role reflects the suit detail.
The old selected keyword contrast was 3.95:1. All tested solid-state text and syntax pairs now reach at least 4.71:1.
Malfoid now uses emerald for identity and selection, with separate silver, blonde, cream, and skin-tone roles.
Emerald accent saturation increased from 29% to 76%. Tested text and syntax pairs reach at least 4.61:1, including the measured image surfaces.
All three named themes use their selection token for tree and table fills as well as text selection.
| Theme | Controls | Prose | Headings |
| --- | --- | --- | --- |
| Harvest Moon / Holo | Candara | Constantia | Constantia |
| Crimson Pilot / Asuka | Bahnschrift | Segoe UI | Bahnschrift |
| Silver Serpent / Malfoid | Corbel | Palatino Linotype | Palatino Linotype |
The font roles separate compact controls from longer reading. Character identity remains in the selected families and headings.
Chrome's font inspection confirms the actual families on this machine. The check does not rely on CSS names alone.
The shared code font remains Cascadia Mono on this machine. Each role retains a fallback stack for other systems.
Checks use 13-pixel controls, 15-pixel prose, 24-pixel headings, selected text, 360-pixel settings, and a long plugin list.
Image contrast depends on the composited surface. Asuka's red accent reaches 3.22:1 on an 82% elevated tint over pure white.
Ordinary menu text passes there. Actual syntax surfaces use a 90% editor tint and pass the separate code checks.
This limit remains visible in the evidence. The palette does not claim universal contrast over every user image or overlay.
## Evidence and limits
Host checks pass with zero errors or warnings and 243 unit tests. Project Management passes 119 unit tests and 14 host-menu browser tests.
Terminal passes seven unit tests and browser checks. Slideshow passes 14 unit tests and both settings browser suites.
Local Autocomplete passes 11 unit tests and its modal-menu browser check.
Browser checks cover themes, narrow layouts, focus, keyboard use, and the reported controls. Screenshots remain in each project's `.audit` folder.
Operating-system menus, embedded website controls, older-host fallbacks, and upstream Monaco widgets retain their respective implementations.
Native desktop interaction and screen-reader output remain acceptance checks. Browser results use mocked desktop APIs.
Source versions remain unchanged. This review produced no installer or plugin ZIP.
## Build artifacts: 2026-10-13
RuneStone 0.1.32 contains the reviewed host changes. Its installer is in RuneStone/releases/0.1.32/.
Project Management 0.2.35 contains the reviewed plugin menu and priority changes. Its ZIP is in RuneStone_ProjectManagement/releases/.
The coordinated build also includes Terminal 0.1.7, Background Slideshow 0.0.7, and Local Autocomplete 0.1.4 in their respective release folders.
Checksums, release notes, and build metadata accompany each artifact.
The host passed 243 unit tests and 93 native tests, with three native tests ignored.
PM passed 119 unit tests and 161 browser tests, with 16 browser tests skipped.
Archive integrity and manifest versions pass for all four ZIPs.
These artifacts are ready for user acceptance. All eight cards remain in Review.
@@ -0,0 +1,26 @@
# Plugin release trial: October 5, 2026
[Documentation archive](README.md) · [Plugin host checks](../plugin-host.md#modules-and-checks)
This record describes a historical trial. It does not establish current release availability or live installation support.
The four local packages passed a simulated Gitea release download and isolated native installation on October 5, 2026.
The test checked the installed hashes and kept all four plugins disabled.
| Plugin | Package version |
| --- | --- |
| Terminal | 0.1.0 |
| Table Formulas | 0.1.0 |
| PDF Viewer | 0.0.1 |
| Project management | 0.2.3 |
The authenticated check of the personal Gitea server found no releases in these four repositories.
That check did not test a live release installation or create releases or tags.
It does not establish current release availability.
## Repeat the trial
Complete the [host setup](../development.md#run-from-source) first. Run the following command from the RuneStone repository root.
To repeat the four-package trial, place exactly these four ZIPs in a folder and set `RUNESTONE_GIT_TRIAL_PACKAGES` to its absolute path.
Then run `cargo test --manifest-path src-tauri/Cargo.toml --lib four_plugin_release_trial -- --ignored --nocapture`.
For current native and browser checks, see the [plugin host reference](../plugin-host.md#modules-and-checks).
+273
View File
@@ -0,0 +1,273 @@
# Build RuneStone
[Development](development.md) · [Releases](releases.md) · [Installation](installation.md)
This guide tells maintainers how to build RuneStone installers and packages. Users install a supplied file with the [installation guide](installation.md).
Use the [release policy](releases.md) to select the version, store the files, and publish them.
## Build the Windows installer
`pnpm build:installer` builds an NSIS setup file for 64-bit Windows (x64). The script stops on other operating systems.
Prerequisites:
- The source setup in [Run from source](development.md#run-from-source).
- The pin of the browser engine in `src-tauri/browser-engine.json`. To build a new engine first, see [Build the browser engine](#build-the-browser-engine). The installer does not include the engine.
- Internet access for the first build. Tauri downloads NSIS and the WebView2 bootstrapper.
Procedure, in the RuneStone repository root:
1. Run `pnpm install --frozen-lockfile`.
2. Run `pnpm check`.
3. Run `pnpm test`.
4. Select the version with the [version policy](releases.md#versions).
5. Run `pnpm build:installer --version <version> --dry-run`. Make sure that the plan shows the correct versions. A dry run changes no file.
6. Run `pnpm build:installer --version <version>`.
Without `--version`, the script uses the version in `package.json`.
Output:
| File | Contents |
| --- | --- |
| `releases/<version>/RuneStone_<version>_x64-setup.exe` | The setup file to distribute |
| `releases/<version>/host.json` | The release version, the encoded toolchain and Windows versions, the file name, the size in bytes, and the SHA-256 hash |
The script prints `Installer available: <path>` when it completes.
After a successful build, the version fields keep the new version.
Example, from the 1.0.0 download link in the README: version `1.0.0` gives `releases/1.0.0/RuneStone_1.0.0_x64-setup.exe`.
### What the script does
Source: `scripts/buildInstaller.mjs`.
1. Reads the version and makes sure that all version fields match the current version.
2. Makes sure that downgrade protection stays on in `tauri.conf.json` and `tauri.windows.conf.json`.
Makes sure that `tauri.windows.conf.json` names the installer hooks and that `tauri.conf.json` does not bundle the browser engine.
3. Stops if the setup file or `host.json` exists in the bundle folder or in `releases/<version>/`.
A dry run prints the plan and stops here.
4. Saves copies of the four version files as `*.before` in `output/installer-build/<version>/<time>/`, a new folder for each attempt.
It also writes the configuration override `tauri.version.json` to that folder. The override sets the toolchain version, for example `{"version": "0.1.23+1"}`.
5. Runs `tauri build --no-bundle --config <override> -- --locked` with `RUNESTONE_VERSION` set to the release version. This runs `pnpm build` and compiles the release app.
`vite.config.js` gives `RUNESTONE_VERSION` to the front end for the Settings dialog. Without it, the front end uses the version in `package.json`.
Tauri gives the override to the Rust build script and to the app. Cargo keeps the previous package version, so the app must not use `CARGO_PKG_VERSION`.
6. Runs `scripts/setWindowsVersion.ps1`. It writes the release version to the `FileVersion` and `ProductVersion` strings of `runestone.exe`. Tauri can write only a SemVer version to these strings.
7. Runs `tauri bundle --bundles nsis --config <override>`. Tauri uses its stock NSIS template with the [installer hooks](#installer-hooks).
8. Stops if the setup file is larger than 30 MB. The core installer is about 10 MB.
Moves the setup file into `releases/<version>/`, writes `host.json`, and removes the bundle-folder copy.
9. Writes the new version to `package.json`, `tauri.conf.json`, `Cargo.toml`, and `Cargo.lock`.
### Failure and rollback
The version files change only in step 9. If a step fails, or you press Ctrl+C, the version files keep the previous version. If step 9 fails, the script restores them.
It moves partial setup files and `host.json` into the folder of that attempt with a `.failed-<timestamp>` suffix.
If the process is killed before this cleanup, copy the `*.before` files of the attempt back to their original names.
## Installer requirements
Keep these properties when you change the installer configuration or hooks:
| Requirement | Implementation |
| --- | --- |
| Reinstall is the default when RuneStone is installed, also for the same version. | The hooks make the stock maintenance page skip itself. Setup replaces the app in place. |
| Users do not uninstall RuneStone before an update or a reinstall. | Setup does not start the uninstaller of the installed version. |
| Updates and reinstalls keep workspace files and user settings. | Workspaces stay outside the installation folder. Settings stay in application data. |
| Older versions cannot replace a newer installation. | The hooks stop setup with exit code 2 in all modes: interactive, passive (`/P`), silent (`/S`), and update (`/UPDATE`). An installed version with an unknown format also stops setup. `allowDowngrades` stays `false`. `pnpm build:installer` stops if this setting changes. |
| Windows shows the release version in installed apps. | The hooks write the release version, such as `0.1.23a`, to `DisplayVersion`. |
| The app identity stays the same across upgrades. | The identifier stays `com.runestone.app`. |
| WebView2 is available. | The installer embeds the WebView2 bootstrapper. If the runtime is missing, setup downloads it. |
| An update removes the engine folder of releases up to 0.1.48. | `NSIS_HOOK_POSTINSTALL` removes `$INSTDIR\browser-engine`. The uninstaller of the old version does not run, so nothing else removes it. |
| Uninstall removes the downloaded browser engine. The browser profiles stay unless the user deletes the app data. | `NSIS_HOOK_POSTUNINSTALL` removes `browser-engine` in the local app data folder, except during an update. |
The installer uses the RuneStone icon, installs for the current Windows account, and adds a Start menu shortcut and an uninstaller.
It does not register document types or start RuneStone when Windows starts.
Local installers are unsigned. Configure Windows code signing with [Tauri's signing guide](https://v2.tauri.app/distribute/sign/windows/) before public distribution.
See [Tauri's Windows installer documentation](https://v2.tauri.app/distribute/windows-installer/) for packaging options.
### Installer hooks
RuneStone uses the stock NSIS template of the Tauri CLI.
`src-tauri/windows/hooks.nsh` adds the RuneStone behavior. `tauri.windows.conf.json` names this file in `bundle.windows.nsis.installerHooks`.
| Hook | When it runs | What it does |
| --- | --- | --- |
| `RuneStoneGuiInit`, set as `MUI_CUSTOMFUNCTION_GUIINIT` | Interactive and passive (`/P`) setup, before the first page | Stops a downgrade. Makes the maintenance page skip itself. |
| Section `-RuneStoneVersionCheck` | All modes, before the Tauri sections | Restores the current-user context. Stops a downgrade. Silent setup shows no pages, so it needs this check. |
| `NSIS_HOOK_POSTINSTALL` | At the end of the Tauri `Install` section | Writes `DisplayVersion`, `RuneStoneReleaseVersion`, and `RuneStoneWindowsVersion`. Removes `$INSTDIR\browser-engine`. |
| `NSIS_HOOK_POSTUNINSTALL` | At the end of the Tauri `Uninstall` section | Removes `$LOCALAPPDATA\com.runestone.app\browser-engine`, except in update mode. |
Tauri includes the hooks file before the template variables, pages, and sections.
Thus only the `NSIS_HOOK_*` macros can use template symbols such as `${VERSION}`.
The other hook code reads the version of the setup file from its version resource.
The stock maintenance page preselects "Uninstall before installing" for an upgrade.
In passive mode, it also starts the uninstaller for a same-version reinstall. A hook cannot change this page.
Thus `RuneStoneGuiInit` sets the shell context to all users. The page then looks in `HKLM`, does not find the current-user installation, and skips itself.
`tests/unit/release/installerVersion.spec.ts` reads the template from the installed Tauri CLI. It checks the template parts that the hooks use.
After a Tauri update, run `pnpm test`. If this check fails, adapt the hooks before you build an installer.
## Hotfix installer versions
Cargo and Tauri accept only SemVer versions. The Windows version resource accepts only four numbers.
`scripts/releaseVersion.mjs` encodes a hotfix version for those fields. The encoding does not create a separate build or change the release version.
The suffix index counts `a` = 1 through `z` = 26, then `aa` = 27. A regular version has index 0.
| Field | Value for `0.1.23a` |
| --- | --- |
| `package.json`, `[package.metadata.runestone]`, the setup file name, the version in Settings, and the executable `FileVersion` and `ProductVersion` strings | `0.1.23a` |
| Registry values `DisplayVersion`, which Windows shows in installed apps, and `RuneStoneReleaseVersion` | `0.1.23a` |
| `tauri.conf.json`, the Cargo package version, `Cargo.lock`, and the `FileVersion` and `ProductVersion` strings of the setup file | `0.1.23+1` |
| The numeric Windows version resources of the executable and the setup file, and the registry value `RuneStoneWindowsVersion` | `0.1.23.1` |
During the build, Tauri gets `0.1.23+1` from a configuration override. The script writes the table values to the files only after the installer is complete.
The NSIS template writes the version strings of the setup file. A hook cannot change them, so they keep the toolchain version.
Each numeric part and the suffix index must not exceed 65535. The last valid suffix is `crxo`.
The script rejects other versions before it changes a file.
Setup compares Windows versions with the NSIS function `${VersionCompare}`. Their order is the release order:
`0.1.23 < 0.1.23a < 0.1.23b < 0.1.23z < 0.1.23aa < 0.1.24`.
Setup reads the installed version from `RuneStoneWindowsVersion`.
If that value is missing, setup reads `DisplayVersion`. Earlier installers wrote the toolchain version there, such as `0.1.23+1`.
An installed version with an unknown format stops setup.
Installers from 0.1.23a to 0.1.44 read `RuneStoneReleaseVersion`, so they also detect a newer hotfix installation.
## Installer checks
Do these checks on a separate Windows test account or virtual machine. A successful build does not prove them.
The unit tests compile small NSIS programs with the hooks file. They do not run a real RuneStone setup file.
Do all checks in this table for the first installer that uses the stock template and the hooks file. Do not publish that installer before all checks pass.
| Check | Expected result |
| --- | --- |
| Install on an account without Node.js or Rust | Setup completes and RuneStone opens. |
| Install without WebView2, with internet access | Setup installs the runtime and RuneStone opens. |
| Open RuneStone from the Start menu | The app opens without a terminal or a development server. |
| Create a workspace outside the installation folder | Notes save and open again. |
| Install the new version over 0.1.44 | Setup shows no maintenance page and does not start the uninstaller. It updates the app and keeps workspace files and settings. |
| Install the new version over 0.1.48 | The `browser-engine` folder in the installation folder is gone. At the first browser start, the browser profiles move from `%APPDATA%` to `%LOCALAPPDATA%`. |
| Open a browser tab, then select **Download the engine** | The download shows its progress. Then the tab opens its page. |
| Open a browser tab without internet access | The tab shows the cause, **Retry**, and **Install from file…**. Web links in documents open in the system browser. |
| Install the same version again | Setup shows no maintenance page and does not start the uninstaller. It keeps workspace files and settings. |
| Install an older version, for example 0.1.44 | Setup blocks the downgrade. |
| Silent downgrade attempt | See the procedure below this table. Setup stops with exit code 2 and changes nothing. |
| Open **Settings → Apps → Installed apps** in Windows | The RuneStone entry shows the release version, such as `0.1.45` or `0.1.45a`. |
| Install a hotfix over its base version | Setup updates the app. |
| Remove RuneStone through Windows Settings | The app, the shortcuts, and the downloaded browser engine are removed. The separate workspace stays. |
Silent downgrade attempt, in PowerShell on the test account:
1. Install the new version.
2. Simulate a newer installation:
`Set-ItemProperty 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Uninstall\RuneStone' RuneStoneWindowsVersion '9.0.0.0'`
3. Run the setup file in silent mode and show its exit code:
`(Start-Process .\RuneStone_<version>_x64-setup.exe -ArgumentList '/S' -Wait -PassThru).ExitCode`
4. Make sure that the exit code is `2` and that installed apps show the same version as before.
5. Run the same command with `-ArgumentList '/P'`. Setup shows a message, then stops with exit code `2`.
6. Restore the registry value: set `RuneStoneWindowsVersion` to the `windowsVersion` value in `host.json`.
## Build the browser engine
`pnpm build:browser-engine` packages the browser engine for 64-bit Windows (x64) as a ZIP. Then it pins that ZIP in `src-tauri/browser-engine.json`. Each later host build downloads the pinned engine on first use.
Build and publish the engine before the installer that pins it. An installer needs a new engine only when the engine changes.
Prerequisites:
- Windows x64. The script stops on other systems, because no other platform has a published engine yet.
- `npm ci --prefix browser-runtime`, then `pnpm browser:check` and `pnpm browser:test`. See [Built-in browser runtime](development.md#built-in-browser-runtime).
- The public folder URL of the engine release. See [Publish a browser engine](releases.md#publish-a-browser-engine).
Procedure, in the RuneStone repository root:
1. Select the engine version with the [version policy](releases.md#versions). The engine version is in `browser-runtime/package.json`.
2. Run `pnpm build:browser-engine --release-url <folder URL> --version <version> --dry-run`. Make sure that the plan shows the correct version and URL. A dry run changes no file.
3. Run `pnpm build:browser-engine --release-url <folder URL> --version <version>`.
4. Publish the ZIP. See [Publish a browser engine](releases.md#publish-a-browser-engine).
Output:
| File | Contents |
| --- | --- |
| `releases/browser-engine/<version>/RuneStone-Browser_<version>_win32-x64.zip` | The engine files at the archive root, in name order, with a fixed time stamp |
| `releases/browser-engine/<version>/engine.json` | The version, the protocol, the platform key, the file name, the URL, the size in bytes, and the SHA-256 hash |
| `src-tauri/browser-engine.json` | The pin: the engine version, the protocol, and the URL, size, and SHA-256 for `windows-x86_64` |
The script prints `Engine available: <path>`, the size, the hash, and the upload URL when it completes.
The script writes the new version to `browser-runtime/package.json` and `package-lock.json` before it packages the engine, because the engine reports that version. If a step fails, the script restores these files and the pin. The backups are in `output/browser-engine-build/<version>/<time>/`.
The script reads `PROTOCOL` in `src-tauri/src/browser_engine.rs` and the protocol of the `ready` event in `browser-runtime/src/engine-main.mjs`. It stops if they differ.
Example, with Electron 44.5.1 from `browser-runtime/package.json`: the engine files are 377 MB, and the ZIP is about 160 MB.
## Build Linux packages
Prerequisites:
- The [Linux development prerequisites](linux.md) on the processor architecture of the package.
- The new version in all RuneStone version fields. No Linux script sets or restores them. See [Versions](releases.md#versions).
Procedure, in the RuneStone repository root. The commands use the Tauri CLI from `package.json` and the bundle settings in `src-tauri/tauri.linux.conf.json`.
1. Build the package format that you need:
```sh
# Debian package
pnpm tauri build --bundles deb -- --locked
# AppImage
pnpm tauri build --bundles appimage -- --locked
```
2. Find the package in `src-tauri/target/release/bundle/deb/` or `src-tauri/target/release/bundle/appimage/`.
3. Move the package into `releases/<version>/`. Do not leave a copy in the bundle folder.
4. Put the checksums, the source commit, the environment, the test results, and the untested cases in the same folder.
If the build fails, restore the previous version fields.
Example, from `productName` and `version` in `src-tauri/tauri.conf.json`: the x86_64 Debian build of version `1.0.0` is `RuneStone_1.0.0_amd64.deb`.
`pnpm build:installer` does not build Linux packages. It stops on operating systems other than Windows.
Linux packages do not include the browser engine, and no Linux engine is published yet. The browser tab says that no engine is available for the platform.
No Linux script encodes hotfix versions, and Tauri rejects a letter suffix in `tauri.conf.json`. Report this blocker before a Linux hotfix build.
The Debian package depends on `libc6 (>= 2.39)`, as set in `tauri.linux.conf.json`.
A package built on a newer system can need libraries that an older system does not have. An AppImage does not remove this limit.
For a shared package, build on the oldest distribution that you support and that supplies WebKitGTK 4.1.
See [Tauri's Debian guide](https://v2.tauri.app/distribute/debian/) and [Tauri's AppImage guide](https://v2.tauri.app/distribute/appimage/).
Test a Debian package with the [Linux installation procedure](installation.md#install-on-linux) on a separate test account:
| Check | Expected result |
| --- | --- |
| Launch without development tools | RuneStone opens. |
| Install the same version again | Settings and workspace files stay. |
| Install a newer version | Settings and workspace files stay. |
| Remove the package | Workspaces outside the installation folder stay. |
Call a distribution supported only after its native tests and package checks pass. Repeat the automated checks on a Linux runner before each Linux release.
For an example record, see the [Linux 0.1.44 validation](archive/linux-validation-0.1.44.md).
## macOS packages
macOS packages are experimental. RuneStone has no validated macOS release procedure.
Prerequisites: a Mac and the source setup.
In the RuneStone repository root, run:
```sh
pnpm tauri build --bundles app -- --locked
```
Tauri puts the application bundle in `src-tauri/target/release/bundle/macos/`. No script sets the version fields on macOS.
macOS packages do not include the browser engine, and no macOS engine is published yet.
The [macOS 0.1.44 record](archive/macos-validation-0.1.44.md) describes the ad hoc signatures and the DMG steps of that release.
Developer ID signing, notarization, Intel builds, and desktop acceptance tests are not done for macOS.
See [Tauri's macOS application bundle guide](https://v2.tauri.app/distribute/macos-application-bundle/).
+1
View File
@@ -0,0 +1 @@
66d20b7321e1cdfb001e606d2cff2e174589e70eaf736edb6fbbf655e5591876 RuneStone_1.0.0_x64-setup.exe
+117
View File
@@ -0,0 +1,117 @@
# Completion plugin API
[Plugin development](plugin-development.md) · [Plugin API](plugin-development.md#plugin-api)
`api.completion` (`version: 1`) lets plugins show autocomplete in RuneStone editors and in their own text fields, and supply the suggestions.
`api.completion` is optional. Older hosts do not have it, and `transport` can be absent. Make sure that a member exists before you call it.
The SDK type is `CompletionApi`. See [Install the SDK](plugin-development.md#install-the-sdk).
| Member | Contract |
| --- | --- |
| `registerInput(element, options)` | Add autocomplete to an `<input>` or `<textarea>`. Returns a handle. |
| `registerSurface(surface)` | Add autocomplete to a custom editor. Returns a handle. |
| `registerProvider(provider)` | Supply suggestions. Returns a cleanup function. |
| `invalidate()` | Dismiss all visible suggestions. |
| `transport(request, signal, onLine)` | Optional. Send a request to a local model server. |
The host adds the plugin ID as a prefix to field and provider IDs. Each field ID must be unique among the active fields.
The host disposes all registrations when the plugin stops.
## Register a field
```javascript
const completion = api.completion;
if (completion?.version === 1) {
const field = completion.registerInput(textarea, {
id: "draft",
kind: "prose",
sensitive: false
});
api.onDispose(() => field.dispose());
}
```
`registerInput` options are `id`, `kind` (`"prose"` default, or `"code"`), and `sensitive`.
The host shows the suggestion in a box below the field. It treats inputs of types other than `text` and `search` as sensitive.
| Key | Action |
| --- | --- |
| Tab | Accept the suggestion. |
| Escape | Dismiss the suggestion. |
| Ctrl+Alt+Space (Cmd+Alt+Space on macOS) | Request a suggestion now. |
| Ctrl+Alt+Right (Cmd+Alt+Right on macOS) | Accept the next word. |
The RuneStone Markdown editor and code editor are also completion surfaces. They show the suggestion as faded italic text at the caret.
### Custom editors
`registerSurface({ id, snapshot, preview, insert })` connects a custom editor.
- `snapshot()` returns the current state: `documentId`, `revision`, `text`, `caret`, `selectionEnd`, `focused`, `composing`, `sensitive`, `readOnly`, `kind`, and `language`.
- `preview(text)` shows a suggestion. `null` removes it.
- `insert(text, expected)` inserts the accepted text. Do it as one undoable edit. Return `false` when the editor state no longer matches `expected`.
The returned handle has `changed()`, `request()`, `accept(word?)`, `dismiss()`, and `dispose()`. Call `changed()` after each edit.
### When the host asks for a suggestion
The host asks only when all of these conditions are true:
- The field has focus, and no selection.
- The field is not read-only or sensitive, and no IME composition is in progress.
- The text before the caret contains more than spaces.
- For prose, the caret is not in a table row, a link target, or an HTML tag.
- For prose, the caret is not in inline code, a code fence, or front matter.
## Register a provider
```javascript
const stop = api.completion.registerProvider({
id: "local",
delayMs: 200,
timeoutMs: 1000,
async complete(request, publish) {
const text = await suggest(request.prefix, request.suffix, request.signal);
return text;
}
});
```
Only one provider can be active in a window. A second registration throws an error.
| Field | Rule |
| --- | --- |
| `delayMs` | Wait after the last edit. Default 200, from 100 to 1,000 milliseconds. |
| `timeoutMs` | Time limit for an automatic request. Default 1,000, from 300 to 5,000 milliseconds. A manual request has 10 seconds. |
| `complete(request, publish)` | Returns the final text, or `null`. Call `publish(text)` to show partial text before the end. |
The request contains `surfaceId`, `documentId`, `revision`, `prefix`, `suffix`, `kind`, `language`, `manual`, and an abort `signal`.
`prefix` has at most 3,000 characters before the caret. `suffix` has at most 600 characters after the caret.
The host ignores a suggestion longer than 2,000 characters or one with control characters.
No text goes into the document until the user accepts it. Then the host makes sure that the document revision and the caret did not change.
Call `invalidate()` when the provider settings or its context change.
## Local transport
`transport(request, signal, onLine)` sends one request to a model server on the same computer, through the desktop host.
It calls `onLine` once for each response line. It is not a general HTTP API.
| Item | Rule |
| --- | --- |
| `endpoint` | `http` or `https` on `127.0.0.1`, `[::1]`, or `localhost`, with path `/` or `/v1`. No credentials, query, or fragment. |
| `route` | `/v1/models`, `/v1/chat/completions`, `/api/tags`, or `/api/generate`. |
| `body` | Optional JSON text, at most 32 KiB. With a body, the host sends POST. Without one, it sends GET. |
| `timeoutMs` | Default 5,000, from 100 to 15,000 milliseconds. The connection limit is 2 seconds. |
| Response | At most 64 KiB for each line and 256 KiB in total. |
| Concurrent requests | At most 16 across all windows. |
The host does not follow redirects and does not use a system proxy. It sends no credentials.
Abort stops the display at once. A blocked network read can continue until the request timeout.
## Trust
Plugins keep full application access. This API does not add a permission sandbox.
The API does not include context sources, remote model servers, or credential storage.
For tests, see `tests/unit/plugins/completion.spec.ts`.
File diff suppressed because it is too large Load Diff
+376
View File
@@ -0,0 +1,376 @@
# Development guide
[RuneStone](../README.md) · [Builds](builds.md) · [Releases](releases.md) · [Plugin development](plugin-development.md) · [Interface design](ui-design.md)
This guide is for developers who change RuneStone's source code. To use the app, see the [user guide](user-guide.md).
## Run from source
### Requirements
- Node.js 24 or later, and pnpm 10.
- A current stable Rust toolchain.
- The [Tauri prerequisites](https://v2.tauri.app/start/prerequisites/) for your platform.
On Windows, these are the Microsoft C++ Build Tools and WebView2.
On Linux, use the [Linux development guide](linux.md).
### First run
1. Clone the repository: `https://github.com/kwyvern-gh/RuneStone.git`.
2. In the repository folder, run `pnpm install --frozen-lockfile`.
3. Prepare the browser runtime. See [Built-in browser runtime](#built-in-browser-runtime).
4. Run `pnpm tauri dev`.
5. In the app, use the folder button to open a test workspace.
The first launch compiles the Rust app and its dependencies. Later launches reuse the Cargo cache in `src-tauri/target/`.
Do not run `cargo clean` as part of normal work.
## Daily workflow
`pnpm tauri dev` starts Vite on port 1420 through `beforeDevCommand` in `src-tauri/tauri.conf.json`. Then it opens the app in a native window.
Do not start a separate `pnpm dev` for this workflow.
| Change | What happens |
| --- | --- |
| Svelte, TypeScript, or CSS in `src/` | Vite updates the window. No Rust build. |
| Rust code in `src-tauri/src/` | Cargo rebuilds the changed code, and Tauri restarts the app. |
| Rust dependencies or build settings | Cargo compiles the affected crates. This can take several minutes. |
| JavaScript dependencies, after a pull | Stop the session, run `pnpm install --frozen-lockfile`, and start it again. |
| Tauri configuration, capabilities, or Vite configuration | Restart `pnpm tauri dev`. The content security policy applies only to a built app, not to `pnpm tauri dev`. See [Content security policy](plugin-host.md#content-security-policy). |
| A plugin in a sibling repository | Build and package that plugin, then install the new ZIP through Settings. See [Build examples](plugin-development.md#build-examples). |
| Installer or release behavior | Use the [build guide](builds.md). |
The app reads and writes real files. Use a test workspace with sample documents.
Save open documents before a change that restarts the app. A Rust restart ends terminal sessions.
An installed copy of RuneStone does not show source changes. Use the window that `pnpm tauri dev` opens.
To see frontend errors, press Ctrl+Shift+I in the development window to open the web inspector.
Rust errors appear in the terminal that runs `pnpm tauri dev`.
## Architecture
RuneStone is a Tauri 2 app. A Rust host gives native services to a Svelte 5 and TypeScript interface.
CodeMirror drives the editor. Each open document has one editor state, and Write and Source are two configurations of it.
Windows is the primary platform. macOS and Linux builds are experimental.
### Desktop host: `src-tauri/src/`
| Module | Responsibility |
| --- | --- |
| `lib.rs` | App setup, command registration, window events |
| `error.rs`, `fsutil.rs` | The shared error type, and the shared file mechanics: name and link checks, limited reads, atomic writes |
| `workspace.rs` | The workspace root of each window, path checks, atomic saves, the file watcher, search |
| `plugins.rs` | Plugin package review, installation, enable state, removal, and recovery |
| `plugin_sources.rs` | Plugin downloads from Gitea releases |
| `git.rs` | The Git service of the Git feature. It runs the `git` program. |
| `features.rs` | Reads the old plugin packages of the native features one time, for the first-start migration. It changes no plugin file. |
| `pty.rs`, `terminal_platform.rs` | The shell sessions of the Terminal feature, the shell search, and terminal windows. A session belongs to the window and the page that opened it. |
| `browser.rs` | The process of the built-in browser engine |
| `backgrounds.rs` | The image folder of the Background feature: the folder dialog, the kept folder (`background-folder.json` in the app data folder), the image list and reads, the sidecar file, and the folder migration from the Background Slideshow plugin |
| `spelling.rs` | Spelling suggestions from the operating system (Windows) |
| `settings.rs`, `theme.rs` | The Settings window and theme export |
| `preferences.rs` | The settings file of the user. It reads, writes, and migrates the file, and replaces a damaged file. |
| `tab_transfer.rs` | Tab transfer between windows. The offers stay in memory. |
| `completion.rs` | A local proxy to a completion model server |
The interface calls Rust commands through Tauri `invoke`. Most calls go through the wrappers in `src/lib/workspace/api.ts`.
A new command needs an entry in `generate_handler!` in `lib.rs`, in the command list in `src-tauri/build.rs`, and in the capability files in `src-tauri/capabilities/`.
`default.json` must list every command. `settings.json` and `browser.json` list subsets. See [Window capabilities](plugin-host.md#window-capabilities).
### Interface: `src/lib/`
| Folder | Responsibility |
| --- | --- |
| `layout/` | The app shell: `Workbench.svelte` holds the state and the commands, and `WorkbenchHeader`, `PluginRibbon`, `LeftPane`, `DocumentArea`, `RightPane`, and `StatusBar` draw its regions. `ViewModes` is the Write, Source, and Read control of each document pane. Also the file tree, tabs, panes, Settings, and dialogs |
| `editor/` | The document editor (`DocumentEditor.svelte`) with its Write and Source configurations, Markdown lists, tables, links, images, and editor menus |
| `formulas/` | Table formulas: the parser and evaluator (`engine.ts`), the rendered results, the formula help, and the `tableFormulas` setting (`index.ts`) |
| `workspace/` | Tauri wrappers, document buffers, the workspace session (`session.svelte.ts`: marks, renames, change events, and the note index), paths, templates, and tab transfer (`tabTransfer.ts`) |
| `settings/` | The settings store (`store.ts`), and the code that moves the old browser values to the settings file (`migration.ts`) |
| `plugins/` | The plugin runtime, the host types (`sdk.ts`, which also exports the SDK types), and Settings → Plug-ins |
| `browser/` | The interface of the built-in browser |
| `features/` | The native features with an off switch: the catalog (`catalog.ts`), the switches (`state.ts`), the first-start migration, the loader, the launch rules, and the Background settings (`backgroundSettings.ts`). Each feature has a folder: `git/`, `background/`, `terminal/`, `pdf/`, and `pm/`. The main-bundle files of Terminal are `terminalKeys.ts`, `terminalSettings.ts`, `terminalHost.ts`, `TerminalHost.svelte`, and `TerminalSettings.svelte`. The main-bundle files of Project Management are `pmSettings.ts`, `pmBoards.ts`, and `ProjectManagementSettings.svelte`. See [Native features](#native-features). |
| `completion/` | Contracts and services that plugins use |
| `git/` | The Git service and its types, for the Git feature and the line history in the status bar |
| `theme/` | Appearance settings, palettes, and the theme tokens (`tokens.css`) |
| `ui/` | Shared menus, pickers, and action icons |
| `i18n/` | Interface text in English, French, Japanese, and Simplified Chinese |
### Other folders
| Folder | Content |
| --- | --- |
| `browser-runtime/` | The browser engine, its tests, filter lists, and third-party notices |
| `packages/plugin-sdk/` | The plugin SDK `@runestone/plugin-sdk`. See [Plugin SDK](#plugin-sdk). |
| `tests/unit/<area>/` | Unit tests (`*.spec.ts`) that run in Node |
| `tests/smoke/<area>/` | Browser smoke tests (`*.smoke.mjs`) and their shared harness in `_harness/` |
| `tests/native/` | Tests that attach to a running desktop app |
| `scripts/` | Build, release, package, and audit tools, and the smoke test runner |
| `fixtures/` | A sample workspace (`fixtures/sample/`), a sample plugin, and a completion test page |
| `design/` | Icon drafts |
| `docs/` | User and developer documentation |
### Where data lives
| Data | Location |
| --- | --- |
| Documents | Ordinary files in the workspace folder |
| Workspace state: tab order, pins, bookmarks, templates, and the boards, cards, labels, and images of Project Management (`.runestone/pm/`) | `.runestone/` in the workspace |
| Installed plugins and their settings | The app data folder. See [plugin storage](plugin-host.md#storage-and-recovery). |
| Preferences: general settings, appearance, custom themes, display language, feature switches, Background, Terminal, Project Management | `settings.json` in the app config folder |
| The image folder of Background | `background-folder.json` in the app data folder. The image of the image source stays in the WebView storage (IndexedDB). |
| Browser profiles, bookmarks, history, browser settings, and Chromium caches | `browser/` in the local app data folder. On Windows, this is `%LOCALAPPDATA%\com.runestone.app\browser\`. See [Built-in browser runtime](#built-in-browser-runtime). |
| Window layout, the open tabs of each workspace, and the view state of each Project Management tab (`runestone.pm.viewStates`) | The WebView storage (`localStorage`) of the app. RuneStone can lose these values without harm. |
#### The settings file
`src-tauri/src/preferences.rs` keeps the preferences in `settings.json` in the Tauri `app_config_dir()`.
On Windows, this is `%APPDATA%\com.runestone.app\`, the same folder as the app data.
On macOS, it is `~/Library/Application Support/<identifier>/`. On Linux, it is `~/.config/<identifier>/`.
```json
{
"schema": 1,
"revision": 12,
"general": { "autosaveEnabled": true, "autosaveSeconds": 5, "showInternalFolder": false, "tableFormulas": true },
"appearance": { "theme": "default", "mode": "dark" },
"customThemes": [],
"customThemesLegacy": [],
"language": "en",
"features": { "git": true, "background": true, "terminal": true, "pdf": true, "pm": true },
"background": { "source": "folder", "seconds": 60, "order": "name", "paused": false, "targets": ["app"], "overlay": 0, "position": "center", "size": "cover" },
"terminal": { "defaultProfile": "", "fontSize": 13, "scrollback": 10000, "cursorBlink": true },
"projectManagement": { "priorityLevels": 3 }
}
```
| Rule | Detail |
| --- | --- |
| Sections | `general`, `appearance`, `customThemes`, `customThemesLegacy` (the original version 1 themes), `language`, `features` (the switches of the native features), `background` (the source, the timing, the targets, and the folder layout of Background), and `terminal` (the default profile, the font size, the scrollback, and the cursor of Terminal). `projectManagement` holds the priority levels of Project Management. The host does not interpret their values. The frontend normalizes each section. |
| Size | At most 8 MiB in total. The appearance can hold an image data URL of up to 3,000,000 characters. |
| Writes | `settings_write` replaces one section. The host writes a complete temporary file and renames it. Then it sends `settings-changed` to all windows with the section, the revision, and the value. |
| Damaged file | The host moves the file to `settings.corrupt-<seconds>.json` and writes a new file with the defaults. The first window that reads the settings shows a message one time. |
| First start | When no file exists, the window reads the old `localStorage` keys and normalizes their values. The keys are `runestone.settings`, `runestone.appearance`, `runestone.custom-themes`, `runestone.custom-themes.legacy`, and `runestone.language`. `settings_migrate` writes the values only when no file exists. RuneStone keeps the old keys for one release, but does not use them. |
| Browser preview | Without the desktop host (`pnpm dev`), the preferences stay in `localStorage` under the old keys. |
Each window loads all sections one time before its first render (`src/routes/+layout.ts`).
After that, `src/lib/settings/store.ts` reads the sections from memory and tells subscribers about changes.
## Product boundaries
- Workspace documents stay ordinary local files. Users keep access to them when plugins are disabled.
- The core includes Markdown table editing, rendering, and table formulas.
- Native file access, file watching, search, Git, and terminals belong in Rust.
- Built-in features with an off switch live in `src/lib/features/`. Other optional features ship as plugins. The [plugin development reference](plugin-development.md) defines the package format and the API.
- For sync, prefer a local Git clone. Do not use a live network share as the sync path.
These stay outside the product:
- A plugin marketplace
- Compatibility with Obsidian or VS Code plugins
- Cloud sync, live collaboration, or a mobile app
- A debugger or a full IDE
- Automatic commits on save
Track plans and roadmaps in RuneStone Project Management, not in these docs.
## Checks
Run these commands from the repository folder. They do not need an installer.
| Command | Checks |
| --- | --- |
| `pnpm check` | Svelte and TypeScript types of the app, the unit tests (`tests/tsconfig.json`), the plugin SDK, and the example plugin. Then the catalog audit. See [Interface text](#interface-text). |
| `pnpm test` | Unit tests in `tests/unit/` |
| `cargo test --manifest-path src-tauri/Cargo.toml --lib` | Rust unit tests |
| `pnpm smoke` | Browser smoke tests. See [Browser smoke tests](#browser-smoke-tests). |
| `pnpm build` | The production frontend build |
| `pnpm check:menus` | The inventory of menu surfaces. See [Interface design](ui-design.md). |
| `pnpm check:features` | A full build. It fails when a native feature module loads at start. See [Native features](#native-features). |
To run one test file, use `node --experimental-strip-types --import ./tests/unit/_svelte/register.mjs --test tests/unit/tables/selection.spec.ts`.
The `--import` hook compiles `.svelte.ts` modules, so a test can import them.
For type errors while you edit, run `pnpm check:watch`.
Some tests need files from outside this repository. Without those files, the tests skip and state the reason:
- `tests/unit/release/installerVersion.spec.ts` needs the NSIS compiler that the Tauri CLI downloads on Windows.
- The Rust terminal tests start the real shells on the computer.
### Interface text
All text that a user reads goes through the catalog in `src/lib/i18n/messages.ts`. Each row has the English key and the French, Japanese, and Simplified Chinese text.
1. Translate the text with `$t("…")` in a Svelte component or `tr("…")` in a TypeScript module.
2. For a value in the text, use a placeholder: `tr("Created {path}", { path })`. Do not join strings.
3. When a variable carries a key to the call, mark the key where you write it: `message("Bold")`.
4. Add a catalog row with all four languages.
Errors of the plugin API stay in English, because they are for plugin developers.
`pnpm check` runs `scripts/i18nAudit.mjs`. 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 translations.
## Native features
Git, Background, Terminal, PDF Viewer, and Project Management are native features: host code with an off switch in **Settings → Features**. They do not use the plugin API.
| Part | File |
| --- | --- |
| The catalog: ID, old plugin ID, name, views, commands, and document types | `src/lib/features/catalog.ts` |
| The switches: the `features` settings section | `src/lib/features/state.ts` |
| The first start: each switch takes the state of the old plugin package, or the default of the feature when `followsPackage` is false | `src/lib/features/migration.ts` and `src-tauri/src/features.rs` |
| One import at first need in each window | `src/lib/features/loader.ts` |
| A start without a view: the launch rules, also the rule for browser windows | `src/lib/features/launch.ts` |
| Views, commands, and document tabs in the workbench | `src/lib/features/session.ts` and `src/lib/plugins/external.ts` |
| The feature code | `src/lib/features/<feature>/index.ts` and its components |
- The catalog holds only static data, so the main bundle stays small. The feature code loads when the user first opens a view, a tab, or a command of the feature. An off feature loads nothing.
- A command without a view loads the feature and calls `FeatureInstance.run`. A launch rule starts the instance at once when it wants it, and again after each change of its settings.
- Background has a launch rule: it loads when the `background` section selects a folder, or an image that exists. Its settings section and its "has a source" test are in `src/lib/features/backgroundSettings.ts`, in the main bundle. It also runs in browser windows. In the settings window, only its settings component loads (`mountSettings`).
- The first start makes the `background` section from the kept settings of the Background Slideshow plugin and from the old background image. `background_migrate` copies the folder of the old plugin grant to the host only when the host has no folder.
- Terminal has no view and no launch rule. `TerminalHost.svelte` puts the panel in the workbench and in the terminal window, and the first use loads the module. `terminalKeys.ts` holds the shortcuts and the Help rows. Settings → Terminal (`TerminalSettings.svelte`) loads no xterm.
- `@xterm/xterm` and `@xterm/addon-fit` are host dependencies. `pnpm check:features` keeps them out of the start chunks.
- PDF Viewer has a document type and no view. The file tree marks PDF files through `identifyPdf` in `src/lib/features/pdfDocument.ts`, in the main bundle. The first PDF tab loads the module and calls `FeatureInstance.mountDocument`. Each tab reads its file with `workspace_read_bytes` and starts its own PDF.js worker. Closing the tab, or Off, stops the worker.
- `pdfjs-dist` is a host dependency. `src/lib/features/pdf/engine.ts` loads the minified build. The worker, the character maps, the standard fonts, and the image decoders are Vite assets of the app, so PDF.js makes no network request. `build.assetsInlineLimit` in `vite.config.js` keeps these files out of the code.
- Project Management has one editor view, `planning`, with `launch: true`. The view pattern `board-<hex of the board ID>` gives each board its own tab. Its ribbon button in `PluginRibbon.svelte` calls the launch, which opens the default board of the workspace or All tasks. It has no command.
- Project Management reads and writes only `.runestone/pm/`. `storage/legacy.ts` finds data in the old format of visible notes. The interface then offers the migration, with backups in `.runestone/pm/backups/`. It migrates only after the user chooses it.
- Project Management deletes no files. A description draft is `.runestone/pm/drafts/<hex of the card ID>.json`. The data of its unsaved images is in `<hex of the card ID>.images.json` in the same folder. Thus a text change does not write the images again.
Only a save of the description or the card writes `.runestone/pm/images/<image ID>.json`. **Save** and **Cancel** of the description replace the draft and its image record with empty records. As a result, a discarded draft leaves no image file.
- `pm/storage/` and `pm/model/` stay pure TypeScript without host modules, so the `runestone-project-management` skill can bundle them. They mark their user-visible text with `message()` from `storage/message.ts` and keep it in English. The interface translates that text with `localize()` in `pm/ui/text.ts`.
- The `projectManagement` section holds the priority levels (`pmSettings.ts`). The default board is `defaultBoardId` in `.runestone/pm/workspace.json`, so each workspace has its own. Appearance → Background reads the board list from the same file through `pmBoards.ts`, without the feature code.
- The first start makes the `projectManagement` section from the kept settings of the Project Management plugin. When `localStorage` has no view states, it also copies the view states of the plugin.
- `yaml` is a host dependency of Project Management. The card descriptions use the markdown-it of the host.
- [THIRD_PARTY_NOTICES.md](../THIRD_PARTY_NOTICES.md) gives the version, license, and source of each third-party package that a feature includes. Update it when you add or update such a package.
- The first start makes the `terminal` section from the `runestone.terminal` key of `localStorage`, which the Terminal plugin wrote. The old key stays.
- Before Terminal goes off, Settings asks `pty_running` for the shells of all windows. Off closes the sessions of each window.
- Host code never imports a feature folder statically. `pnpm check:features` builds the app. It fails when a feature module, or a library that only a feature needs, is in a chunk that loads at start.
- Saved tabs and tab transfers keep the ID of the old plugin package as the owner ID, for example `runestone.git`. `builtInPackages` in `external.ts` lists the old package, so it never loads.
- Off stops the feature at once in each window and closes its views. The loaded module stays in memory until the window reloads.
- To add a feature, add its entry to `catalog.ts`, its import to `loader.ts`, its folder to `FEATURE_FOLDERS` in `scripts/featureChunks.mjs`, and its old plugin ID to `LEGACY_PACKAGES` in `src-tauri/src/features.rs`. Add a launch rule only when the feature must run without a view.
## Plugin SDK
The plugin SDK in `packages/plugin-sdk/` is the only source of the public plugin types.
The host imports it with relative paths in `src/lib/plugins/sdk.ts`, `src/lib/ui/actionIcons.ts`, and `src/lib/ui/tooltip.ts`.
Change a public type in the SDK, not in the host. Keep host-only types, such as the native transports, in `src/lib/plugins/sdk.ts`.
The menu types in `src/lib/ui/actionMenu.ts` and `src/lib/ui/managedActionMenu.ts` are the exception: they keep their own declarations.
`tests/unit/sdk/features.spec.ts` makes sure that their types and the SDK menu types are the same.
The SDK source must not import host files. It must use only TypeScript syntax that Node.js can remove, because the unit tests load it directly.
| Command | Result |
| --- | --- |
| `pnpm sdk:build` | Compiles the SDK into `packages/plugin-sdk/dist/` with declaration files. The folder is outside Git. |
| `pnpm release:sdk --release-url <url> --version <version> [--dry-run]` | Builds the SDK and writes its package file and `sdk.json` in `releases/plugin-sdk/<version>/`. See [SDK releases](releases.md#sdk-releases). |
`pnpm check` type checks the SDK with `packages/plugin-sdk/tsconfig.json` and the example plugin with `fixtures/plugins/tsconfig.json`.
`pnpm test` runs the SDK tests in `tests/unit/sdk/` and the release script tests in `tests/unit/release/releaseSdk.spec.ts`.
## Browser smoke tests
Smoke tests run the real interface in headless Chromium with a mock of the desktop host.
They do not replace tests in the native app. Real folder access, file writes, and terminals need `pnpm tauri dev`.
| Command | Runs |
| --- | --- |
| `pnpm smoke` | All smoke tests, four at a time |
| `pnpm smoke tabs tables/drag` | The tests whose path contains one of the filters |
| `pnpm smoke --list` | Nothing. It lists each test, its requirements, and why a test would skip. |
| `pnpm smoke --csp` | All smoke tests under the content security policy of the app. A test fails on any policy violation. |
The runner starts the Vite server when nothing serves `SMOKE_URL`, and stops it at the end.
Use `--no-serve` to require a running server, `--jobs <n>` to change the number of parallel tests, and `--timeout <seconds>` to change the limit for each test (default 180).
After the parallel run, the runner runs each failed test one more time, alone. A test that passes then is reported as `flaky`. It does not fail the run, but the summary lists it. Use `--retries 0` to turn this off.
Each test writes its output to `output/smoke/logs/<area>__<name>.log`. Screenshots go to `output/smoke/<area>/<name>/`.
Playwright is a development dependency. When its own Chromium is not installed, the runner uses an installed Chrome or Edge.
To use the Playwright browser, run `pnpm exec playwright install chromium`.
A test states what it needs near its top. The runner skips the test, with the reason, when a requirement is missing:
| Line | Requirement |
| --- | --- |
| `// @requires repo:RuneStone_Local_Autocomplete/src` | A file or folder in a sibling plugin checkout |
| `// @requires electron` | The browser engine dependencies. Run `npm ci --prefix browser-runtime`. |
| `// @known-issue <defect>` | The test fails because of a known app defect. The run reports it as `known`. If the test passes, the run fails, so that someone removes the line. |
| Variable | Use |
| --- | --- |
| `SMOKE_URL` | The frontend address. The default is `http://127.0.0.1:1420`. When the runner starts Vite, it uses the port of this address, so two checkouts can run tests at the same time. |
| `RUNESTONE_PLUGIN_REPOS` | The folder of the sibling plugin checkouts. The default is the parent folder of this repository. |
| `RUNESTONE_CSP` | `1` sends and checks the content security policy. `--csp` sets it. |
| `CHROME_PATH` | A Chromium browser for Playwright |
| `PLAYWRIGHT_MODULE` | A different Playwright package |
To write a smoke test, start from an existing test in the same area. The harness in `tests/smoke/_harness/index.mjs` starts the browser, mocks the Tauri commands, and gives an in-memory workspace.
The harness also has default handlers for the settings file, for tab transfers, and for the `pty_*` shells of Terminal. All pages of one browser context share them.
The mock shell sends its output through the channel of `pty_open`. To send more, use `window.__TEST__.pty.output(id, text)` and `window.__TEST__.pty.exit(id, code)`.
To seed preferences, set the old `localStorage` keys before the first load. The app then migrates them.
To read or change a section later, use `window.__TEST__.settings(section)` and `window.__TEST__.writeSettings(section, value)`.
A failed test saves `failure.png` in its output folder and prints the page console errors and warnings.
You can also run one test file directly while `pnpm dev` runs, for example `node tests/smoke/tabs/order.smoke.mjs`.
### CSP mode
`--csp` sets `RUNESTONE_CSP=1`. With this variable, `vite.config.js` sends the policy from `src-tauri/tauri.conf.json` as a `Content-Security-Policy` header with each HTML page, as the installed app does.
It adds only what the dev server needs:
| Directive | Addition | Reason |
| --- | --- | --- |
| `script-src` | The SHA-256 hash of each inline script in the page | Tauri adds the same hashes in the installed app. The SvelteKit start script is inline. |
| `connect-src` | `ws://<address of the page>` | The Vite hot-reload WebSocket |
The harness records the `securitypolicyviolation` events of each page and frame, and fails the test when there is one. Violations inside workers do not reach the harness.
The runner refuses to use a server at `SMOKE_URL` that does not send the policy. Stop that server, or set `SMOKE_URL` to a free port.
The smoke tests do not replace a check in the installed app. The page there is the Tauri web view, and some plugins are not in the smoke tests. See [Content security policy](plugin-host.md#content-security-policy).
The tests in `tests/native/` attach to a running desktop app through the WebView2 remote-debugging port, and `pnpm smoke` does not run them.
Set `NATIVE_CDP_URL` to the debugging address, for example `http://127.0.0.1:9224`.
Before you start the app, set `WEBVIEW2_ADDITIONAL_BROWSER_ARGUMENTS=--remote-debugging-port=<port>`. Each file states its port and variables at the top.
## Built-in browser runtime
The browser interface is in `src/lib/browser/`. The browser engine, its tests, and its notices are in `browser-runtime/`.
The engine is a separate download. Users install it on first use. To build and publish it, see [Build the browser engine](builds.md#build-the-browser-engine).
1. Run `npm ci --prefix browser-runtime`.
2. Run `pnpm browser:check` and `pnpm browser:test`.
3. Run `pnpm browser:test:engine` for the native engine tests.
4. Run `npm --prefix browser-runtime run package`.
5. Run `pnpm browser:stage` to use this engine in `pnpm tauri dev`.
Each browser window gets a session token at startup. Native requests check that token, and cleanup revokes it.
### Engine download
Each host build pins one engine version in `src-tauri/browser-engine.json`: the version, the protocol, and the URL, size, and SHA-256 hash for each platform.
A platform key is the operating system and the processor, for example `windows-x86_64`. Without an entry for its platform, the host reports that no engine is available.
On request, `src-tauri/src/browser_engine.rs` downloads the ZIP over HTTPS into `browser-engine/.download/` in the local app data folder. A redirect must also use HTTPS.
The host stops when the size or the SHA-256 hash differs from the pin. It extracts the ZIP into a new folder, refuses unsafe paths and links, and needs the engine program at the root of the archive.
Then it writes `installed.json` and renames the folder to `browser-engine/<version>/`. It removes the other versions.
At each start, the host compares `installed.json` with the pin. It does not hash the files again. **Install from file** applies the same size, hash, and archive checks to a local ZIP.
| Engine | When the host starts it |
| --- | --- |
| `src-tauri/browser-engine/`, from `pnpm browser:stage` | Debug builds without a manifest override |
| `browser-engine/<version>/` in the local app data folder | Release builds, and debug builds with `RUNESTONE_BROWSER_ENGINE_MANIFEST` |
`RUNESTONE_BROWSER_ENGINE_MANIFEST` names a manifest file for a native test. Only debug builds read it. With it, the host also accepts HTTP links, for a local test server.
The engine sends `protocol` and `version` with its `ready` event. The host stops an engine with a different protocol.
`PROTOCOL` in `browser_engine.rs` and the `ready` event in `browser-runtime/src/engine-main.mjs` must change together. After a change, package and stage the engine again.
The browser data is in the Tauri `app_local_data_dir()`. Releases up to 0.1.48 kept it in `app_data_dir()`, which roams on Windows.
Before the engine starts, `src-tauri/src/browser.rs` moves an old `browser` folder to the new place. Across volumes, it copies the folder and then deletes the old one.
If the new folder exists, the host uses it and leaves the old folder. If the move fails, the engine does not start, and the error names both folders.
On macOS and Linux, the two folders are the same, so nothing moves.
## Development help
| Problem | Action |
| --- | --- |
| Port 1420 is in use | Stop the other development server, then try again. Vite uses a fixed port. |
| The window shows the old interface | Look for compile errors in the terminal. Restart `pnpm tauri dev` if necessary. |
| A page says that desktop features need `pnpm tauri dev` | You opened the Vite server in a browser. Use the native window. |
| Windows cannot find `link.exe` | Install the C++ build tools and the Windows SDK from the Tauri prerequisites. Open a new terminal. |
| A smoke test cannot find Chromium | Run `pnpm exec playwright install chromium`, or set `CHROME_PATH` to an installed browser. |
| `cargo test --offline` reports missing crates | Run the command without `--offline` one time while you are online. |
+111
View File
@@ -0,0 +1,111 @@
# Images, diagrams, and tables
[RuneStone](../../README.md) · [User guide](../user-guide.md)
This guide explains how to insert and edit images, read diagrams, edit Markdown tables, and calculate in tables.
## Insert and edit images
| Source | Result |
| --- | --- |
| Drag an image from the navigator into a Markdown editor | RuneStone inserts a relative link to the existing file. Press Escape to cancel the drag. |
| Drop an image from your system file manager, or paste an image | RuneStone copies the image into the workspace `attachments/` folder with a unique name, then inserts a link. |
| Paste an image that you copied with **Copy image** in the RuneStone browser | RuneStone saves the original file that the page loaded. A GIF keeps its animation, also from a website that refuses downloads. |
| Paste a GIF, WebP, or AVIF image that you copied in another web browser | That browser copies only the first frame. RuneStone downloads the original file from the image address, so the animation stays. If the website refuses the download, RuneStone saves the first frame and shows a message. |
Undo removes the inserted link. It keeps the image file.
In Write, the image shows and its Markdown stays hidden. To edit the Markdown, choose **Edit image source**. To hide it again, choose the same button, press Escape, or move the cursor away.
Select an image, then right-click it or press Shift+F10 for these actions:
- **Copy image**, **Copy Markdown**, **Swap image…**, and **Remove image**
- **Zoom in**, **Edit image source**, and **Open in new tab**
- **Copy path** and **Show in Explorer**, for workspace images
**Remove image**, or the Delete key, removes the image link from the note. It does not delete the file. Undo restores the link.
Zoom works in Write, Read, and Split. It can fit the image or magnify it. Press Escape to close it.
## Read diagrams and document properties
Write, Read, and Split show wiki links, note callouts, and Mermaid diagrams.
RuneStone renders Mermaid diagrams locally. If a diagram is not valid, RuneStone shows an error message and the diagram source.
Read shows frontmatter in a collapsed **Properties** section.
## Edit tables
Tables keep readable column widths. A `<br>` in a cell shows as a line break. Wide tables scroll inside the document.
- Select a cell to edit its contents.
- To add a column, hover beside the right edge of the table and select +. To add a row, hover below the bottom edge.
- Right-click a cell for the **Row** and **Column** menus. They insert, move, duplicate, delete, and sort at that cell.
Sort is stable and natural, so 2 comes before 10. Blank cells go last, and the header row stays in place.
### Move rows or columns
Grips show above columns and beside body rows when you hover or focus the table.
1. Drag a grip. A line shows the drop position.
2. Release the grip at the new position.
To scroll, drag near an edge. To cancel, press Escape. You can also focus a grip and move it with the arrow keys.
A row move keeps the header row in place. A column move keeps the column alignment.
### Select, copy, and format cells
Drag across cells, or Shift+click, to select a rectangle. Shift+arrow keys extend the selection.
Then right-click for these actions:
| Group | Actions |
| --- | --- |
| Clipboard | Cut, copy, and paste |
| Format | Bold, italic, strikethrough, highlight, code, math, comment, and clear formatting |
| Layout | Alignment, clear cells, and delete cells |
Ctrl+X, Ctrl+C, Ctrl+V, Ctrl+B, Ctrl+I, and undo also work on the selected cells. Undo reverts each action in one step.
- When you paste tab-separated text or a Markdown table, RuneStone fills the cells and adds rows or columns as necessary.
- Alignment applies to whole columns, because Markdown sets alignment per column.
- **Clear cells** empties the cells. **Delete cells** removes complete rows or columns, or moves the remaining cells of a partial selection to the left.
- Math uses inline `$…$` syntax. A comment uses `%%…%%` and does not show in Read.
### Work with text inside a cell
Right-click selected text in a cell for note links, external links, workspace search, formatting, and paste as rich or plain text.
**Extract current selection…** saves the selected Markdown to a new note and replaces the selection with a link to that note.
Undo restores the original text. It does not delete the new note.
## Calculate with table formulas
RuneStone calculates formulas in Markdown tables.
To show formulas as text, turn off **Settings → General → Table formulas**. The setting does not change your files.
Start a cell with `=` to make a formula. Columns use letters A, B, … AA. Row 1 is the header, so the first data row is row 2.
| Example | Result |
| --- | --- |
| `=B2+C2` | Adds two cells. |
| `=AVERAGE(B2,C2)` | Averages two cells. Commas separate arguments. |
| `=AVERAGE(B2:C2)` | Averages every cell from B2 through C2. A colon sets a range. |
| `=SUM(B2:B10)` | Adds a range. |
| `=ROUND(B2/3, 2)` | Rounds to two decimal places. |
| Feature | Supported values |
| --- | --- |
| Operators | `+`, `-`, `*`, `/`, `^`, parentheses, and postfix `%` |
| Functions | SUM, AVERAGE, MIN, MAX, COUNT, ABS, and ROUND |
Functions that take a range ignore text and blank cells. Arithmetic uses zero for a blank cell.
Results update in Write, Read, and Split. Select a result to edit its formula. Enter saves the formula, and Tab moves to the next cell.
The **Formulas** control below each table explains the syntax. The active cell shows its address.
A formula that is not valid, a missing cell, or a circular reference shows an error label.
The Markdown file keeps the formula text, so other apps show readable source.
To keep text that starts with `=` as text, use code formatting or type `\=`.
Formula limits:
- References stay inside the current table.
- References are fixed positions. When you copy, insert, delete, sort, or move cells, RuneStone does not update the addresses.
- RuneStone has no automatic fill.
+53
View File
@@ -0,0 +1,53 @@
# Git guide
[RuneStone](../../README.md) · [User guide](../user-guide.md)
This guide explains how to review changes, stage files, commit, push, and pull with Git in RuneStone.
Git is part of RuneStone and is on by default. It needs the `git` program on the system path. To turn it off, see [Turn features on or off](../user-guide.md#turn-features-on-or-off).
## Review and stage changes
1. Open the root folder of the repository as the workspace.
2. Select **Source control** in the navigation buttons at the top of the side pane.
3. Select a file to open its diff in an editor tab. **Open file** in that tab opens the file in the editor.
4. Select the plus button beside a file to stage it, or the minus button to unstage it. The button beside a group stages or unstages all files in that group.
Source control shows the current branch and the **Changes** section with two groups. **Staged changes** go into the next commit. **Unstaged changes** holds the files that still need review or staging.
A file shows in both groups when only part of its content is staged. Unstage keeps the content of the working file.
Source control reads the repository again after each change in the workspace, also in the `.git` folder, and when the window gets focus. **Refresh source control** reads it at once.
A diff tab shows the file as it was when you selected it. Select the file again to update the diff. Git reads the files on disk, so save your edits first.
## Commit
1. Stage the files for the commit.
2. Enter a commit message.
3. Select **Commit staged**, or press Ctrl+Enter (⌘+Enter on macOS).
A commit contains only the staged changes. Git hooks and signing settings apply as usual. Set your author name, email, and signing tools in Git outside RuneStone.
If a hook stops the commit, the error stays visible, and the message stays in the field.
## Push and pull
**Push to the upstream branch** and **Pull from the upstream branch** use the upstream branch of the current branch and your current Git sign-in.
Pull accepts only a fast-forward update. It stops when local changes or diverging commits prevent that update. RuneStone never forces a push, and it does not set an upstream branch.
## Commit graph
Select **Show Git graph** in Source control, or run **Show Git graph** from the command palette (Ctrl+Shift+P). The graph opens in an editor tab.
The graph shows the latest 100 commits with their branches, tags, IDs, authors, dates, and messages. Dashed lines continue to parents outside these 100 commits.
Select a commit to see its changed files, then select a file to see its diff. The arrow keys, Home, and End move through the commits.
## Line history
While a saved text file is open, the status bar shows the author and the date of the last commit for the line of the cursor. A new or changed line can show no author until you commit it.
## Limits
- Parent repositories and linked worktrees with their metadata outside the workspace do not work. Open the repository root.
- RuneStone does not include a Git program.
- Create repositories, switch branches, resolve conflicts, and set remotes with Git outside RuneStone. RuneStone has no discard, reset, or force push.
- A Git operation stops after 30 seconds or 2 MiB of output. If an operation stops, refresh to see its result before you do it again.
- The diff of a new text file shows at most 512 KiB. A binary file shows a notice instead of a diff.
+175
View File
@@ -0,0 +1,175 @@
# Project Management guide
[RuneStone](../../README.md) · [User guide](../user-guide.md)
This guide explains how to plan work with boards, lists, and cards in RuneStone. It also explains the timeline and calendar views of the same cards.
Project Management is part of RuneStone and is on by default. To turn it off, see [Turn Project Management off](#turn-project-management-off).
## Open Project Management
Select **Project Management** (the board icon) in the left ribbon. It opens the default board of the workspace, or **All tasks** when the workspace has no default board. See [Choose the default board](#choose-the-default-board).
Each board opens in its own tab. To open another board in the same tab, select the board name in the toolbar. Then select a board or **All tasks**.
A workspace without boards shows **Create your first board**. Select it and enter a name.
## Boards and lists
A board holds lists, and a list holds cards. A new board starts with the lists **To do**, **In progress**, and **Done**.
| Action | How |
| --- | --- |
| Create a board | **More actions** (the three dots) → **New board** |
| Rename a board | **Rename board** beside the board name, or **More actions** → **Rename board** |
| Archive or restore a board | **More actions** → **Archive board** or **Restore board** |
| Delete a board | **More actions** → **Delete board**. The cards stay in All tasks. You cannot undo this action. |
| Add a list | **Add a list** in the toolbar of a board |
| Rename a list, or set its status | List actions (the button in the list header) → **Edit list** |
| Move a list | Drag its header, or use **Move left** and **Move right** in the list actions |
| Set a card limit | List actions → **Set list limit**. A warning shows at the limit. Cards can still go into the list. |
| Archive all cards of a list | List actions → **Archive all cards** |
| Delete a list | List actions → **Delete list**. Its cards go to **Unlisted**. Their status does not change. |
| Collapse or expand a list | The collapse button in the list header. A collapsed list is a narrow strip with its name and card count. |
**Status when a card enters this list** sets the status of each card that you move into the list. Choose **Do not change status** to keep the status of the card.
## Cards
| Action | How |
| --- | --- |
| Create a card | **Add a card** at the bottom of a list, or **More actions** → **New card** |
| Open the card details | Select the card |
| Move a card on the board | Drag the card, or use **Move to list**, **Move up**, and **Move down** in the card actions |
| Put a card on another board | Card actions → **Move to board** |
| Take a card off this board | Card actions → **Remove from board**. The card stays in All tasks and on its other boards. |
| Archive or restore a card | Card actions → **Archive** or **Restore**. **More actions** → **Show archived** shows the archived cards. |
| Delete a card | Card actions → **Delete card**. It removes the card from all boards. You cannot undo this action. |
| Work with more than one card | **Select cards** in the toolbar. Then move the selected cards to a list or a board, or delete them. |
| Find a card | **Search tasks** in the toolbar. The search looks in titles, descriptions, tags, labels, assignments, and custom fields. |
A card can be on more than one board, with a different list on each board.
The card details have the title, the labels, and the description in Markdown.
A change to the description stays a draft until you select **Save**. **Cancel** restores the saved text. When you close the card with a draft, the card shows an unsaved marker.
An image that you paste or drop into a draft stays with the draft. **Save** adds the image to the card. **Cancel** removes it.
Board and list changes save at once. Other fields save when you close the card details.
### Card details
Select **Add details** in the card details to add one of these fields:
| Field | Use |
| --- | --- |
| **Priority** | The urgency of the card, apart from its labels |
| **Labels** | Colored labels that all boards of the workspace share |
| **Tags** | Plain words for the search |
| **Planned dates** | The first and the last day of the work. The Gantt view shows them as a bar. |
| **Deadline** | The due date. Gantt and Calendar show it with ◆. |
| **Work session** | A start time and an end time. The Calendar view shows the session. |
| **Assignments** | People, teams, or customers |
| **Color** | The color of the card |
| **Custom field** | A name and a value of your choice |
| **Subtasks and linked cards** | Smaller tasks of the card, and other cards that block it, that it blocks, or that relate to it |
| **Card cover** | An image of the card that shows on the board |
**More actions** → **Add existing note** makes a new card from a Markdown note of the workspace. The card gets the file name as its title and the note text as its description.
The note does not change. Later edits to the note do not change the card.
## Labels and priority
Select **Manage labels** (the tag icon) in the toolbar to add, rename, recolor, or delete labels.
All boards of the workspace share the labels. A change of name or color applies to each card with the label. When you delete a label, RuneStone removes it from all cards.
Priority has two, three, or five levels. To change the number of levels, see [Change the Project Management settings](#change-the-project-management-settings).
## Views
The buttons at the left of the toolbar change the view of the board.
| View | Shows |
| --- | --- |
| **Kanban** | The lists and their cards |
| **Gantt** | Each card with its planned dates as a bar and its deadline as ◆, for 28 days from the visible date |
| **Calendar** | Deadlines and work sessions by **Day**, **Week**, or **Month**, in the time zone of your computer |
**Previous**, **Today**, **Next**, and the date field change the visible dates of Gantt and Calendar.
In Calendar, you can create a card from a date:
- In **Month**, select the number of a day to create a card with that deadline.
- In **Day** or **Week**, select an hour to create a card with a one-hour work session.
Gantt and Calendar do not move a card when you drag it. To change dates, open the card and edit **Planned dates**, **Deadline**, or **Work session**.
## All tasks
**All tasks** shows the cards of all boards of the workspace in one view.
- Lists with the same name on different boards share one column. The match ignores uppercase and lowercase letters.
- In each column, the cards show below the name of their board. Cards without an active board show below **No active board**.
- You cannot drag cards between columns. To move a card, open it and change **Board** or **List**, or open its board.
- A new card in All tasks needs a board. Choose the board and the list in the card details.
## Images
To add an image to a card, paste it or drop it into the description, or select **Add image**.
Use a PNG, JPEG, GIF, or WebP image of at most 50 MiB.
To show an image on the board, add **Card cover** and choose one of the images of the card.
A web browser copies only the first frame of an image. When you paste a GIF or WebP image from a browser, RuneStone downloads the original file.
Then the animation stays.
Some websites refuse that download. Then the card gets the first frame, and RuneStone shows a message.
To keep the animation, use **Copy image** in the RuneStone browser. That copy keeps the original file that the page loaded.
**More actions** → **Customize background** sets an image behind the open board, or behind All tasks.
To show the Background slideshow on the boards, see [Choose where the background shows](themes.md#choose-where-the-background-shows).
## Choose the default board
1. Open **Settings → Project Management**, or select **More actions** → **Project Management settings**.
2. Select **Default board**.
3. Select a board, or **All tasks**.
Each workspace has its own default board. The ribbon button then opens that board. Restored tabs keep their board.
An archived or deleted default board opens All tasks.
## Change the Project Management settings
Open **Settings → Project Management**. The page shows only while Project Management is on. Each change saves at once.
| Setting | Values |
| --- | --- |
| **Priority levels** | **2** (High and Low), **3** (High, Medium, and Low), or **5** (Highest through Lowest). The default is 3. The priorities of existing cards do not change. |
| **Default board** | **All tasks** or one board of the current workspace. See [Choose the default board](#choose-the-default-board). |
After an update, the first start copies the priority levels of the old Project Management plugin.
## Where the boards are
The boards, cards, labels, and images of a workspace are in `.runestone/pm/` in the workspace folder.
To see this folder in the file tree, turn on **Show .runestone folder** in Settings → General.
Git ignores `.runestone/pm/`, because RuneStone puts a `.gitignore` file there. To keep a copy of your boards, back up this folder separately.
## Move old Project Management notes
Early versions of the Project Management plugin kept boards and cards in visible Markdown notes, and labels in `runestone-pm-labels.json`.
RuneStone reads only `.runestone/pm/`. When a workspace has data in the old format, Project Management shows **Migrate Project Management data**.
1. Read the list of boards, task notes, and label files.
2. If the offer names notes with invalid properties, repair these notes first.
3. Select **Migrate**. RuneStone copies the data to `.runestone/pm/` and keeps exact backups in `.runestone/pm/backups/`.
4. Examine the boards.
5. Remove the original files that **Migration complete** lists, then select **Done**.
The migration does not change or remove the original files. **Not now** hides the offer in this tab.
## Turn Project Management off
1. Open **Settings → Features**.
2. Clear **Project Management**.
Off closes the Project Management tabs and removes the ribbon button and the settings page in all windows.
Your boards stay in `.runestone/pm/`, and your settings stay. Turn Project Management on again in the same place.
+115
View File
@@ -0,0 +1,115 @@
# Terminal guide
[RuneStone](../../README.md) · [User guide](../user-guide.md)
This guide explains how to use shells, scripts, and workspace tasks in the terminal of RuneStone.
Terminal is part of RuneStone and is on by default. The shells and script runtimes that you use must be installed on your computer. To turn Terminal off, see [Turn Terminal off](#turn-terminal-off).
## Open and arrange terminals
| Action | How |
| --- | --- |
| Show or hide the terminal panel | **Terminal** in the left ribbon, Ctrl+`, or Ctrl+J. Sessions and scrollback stay. |
| New terminal | Ctrl+Shift+` or the + button |
| Split the active terminal | Ctrl+Shift+5 or **Split terminal**. The new pane uses the same folder and profile. |
| New terminal window | Ctrl+Shift+Alt+`, or **New terminal window** in the profile menu |
| End the active session | **Kill terminal**, or Delete while an entry in the terminal list has focus |
| Change the panel size | **Maximize panel** or **Restore panel**. Shells do not restart. |
| End all sessions in the panel | **Close terminal (end all sessions)** |
The terminal list shows only when more than one session is open.
Closing a terminal window ends its sessions. When you close a workspace window with running sessions, RuneStone asks first.
You can type before a shell starts. RuneStone sends the text when the shell is ready.
## Choose a shell
Open **Terminal profiles and tasks** (the arrow beside the + button) to start a terminal with a specific profile.
| System | Profiles |
| --- | --- |
| Windows | PowerShell, PowerShell 7, Git Bash, and Command Prompt |
| macOS and Linux | Bash and PowerShell |
The menu shows only the shells that RuneStone finds on your computer.
The same menu has **Split terminal with profile**, **Terminal settings**, **Select the default profile**, and the task commands.
New terminals get the RuneStone environment, including `PATH`.
## Change the terminal settings
Open **Settings → Terminal**, or choose **Terminal settings** in the profile menu. The page shows only while Terminal is on.
| Setting | Values |
| --- | --- |
| **Default profile** | The shell of a new terminal. The JavaScript Debug Terminal is not a choice. |
| **Font size** | 9 to 28 pixels. The default is 13. |
| **Scrollback lines** | 100 to 100,000 lines. The default is 10,000. |
| **Blink cursor** | The cursor blinks in the focused terminal. On by default. |
A change saves at once and applies to all windows. Open terminals take the new font size, scrollback, and cursor. The default profile applies to new terminals.
After an update, the first start copies the settings of the old Terminal plugin.
The terminal colors come from the color theme. The text, the cursor, and the selection use the theme colors. The 16 ANSI colors use the `ansi-*` keys of the theme.
To change them, see [Edit a theme](themes.md#edit-a-theme) and [Color keys](themes.md#color-keys).
## Copy and paste
- Drag across terminal text to select it.
- Ctrl+C copies the selection. With no selection, Ctrl+C sends an interrupt to the shell.
- Ctrl+Shift+C copies the selection.
- Right-click a selection to copy it.
## Run scripts and recent commands
Open **More terminal actions** for these commands:
| Command | Result |
| --- | --- |
| **Scroll to the previous command** / **Scroll to the next command** (Ctrl+Up / Ctrl+Down) | Moves between command prompts. |
| **Clear the terminal** | Clears the scrollback. |
| **Run the active file** | Saves and runs the active file in the terminal. |
| **Run selected text** | Sends the text that is selected in the editor to the terminal. |
| **Start dictation** | Starts Windows voice typing. See [Debug JavaScript and use dictation](#debug-javascript-and-use-dictation). |
| **Go to a recent folder…** (Ctrl+G) | Changes to a recent folder. |
| **Run a recent command…** (Ctrl+Alt+R) | Runs a command from this session again. |
**Run the active file** supports Python, JavaScript, PowerShell, Bash, Ruby, Windows batch files, and executables.
The terminal keeps command history in memory only. PowerShell and Bash record a command after it finishes. Command Prompt records the text that you submit.
## Configure workspace tasks
A task is a named command that you can start from a menu.
1. Choose **Configure tasks…**. RuneStone creates or opens `.runestone/tasks.json`.
2. Add an object to the `tasks` array with `label` and `command`.
3. Optionally, add `profile` with one of these IDs: `powershell`, `pwsh`, `git-bash`, `cmd`, or `bash`.
4. Choose **Run a task…** and select the task.
Example (`.runestone/tasks.json`):
```json
{
"tasks": [
{ "label": "Run tests", "command": "pnpm test", "profile": "pwsh" }
]
}
```
Each task runs in its own terminal at the workspace root. Tasks run only when you select them.
## Debug JavaScript and use dictation
**JavaScript Debug Terminal** in the profile menu starts a Node.js REPL with a local inspector on a free port.
Attach an external debugger to the address that the terminal shows. RuneStone does not include a debugger.
**Start dictation** starts Windows voice typing (Win+H) in the focused terminal. Set up the microphone and voice typing in Windows first.
On other systems, use the dictation shortcut of the operating system.
## Turn Terminal off
1. Open **Settings → Features**.
2. Clear **Terminal**.
3. If a window runs a shell, RuneStone asks "Terminal sessions will end. Turn off Terminal?". Confirm to continue.
Off ends the terminal sessions of every window. The Terminal buttons, shortcuts, and Help rows do not show. A terminal window shows "Terminal is off. Turn it on in Settings → Features."
Your terminal settings and `.runestone/tasks.json` stay. Turn Terminal on again in the same place.
+171
View File
@@ -0,0 +1,171 @@
# Appearance and custom themes
[RuneStone](../../README.md) · [User guide](../user-guide.md)
This guide explains how to choose colors, show a background, and edit, create, or share a custom theme.
Open **Settings → Appearance**. Appearance settings apply to all workspaces on this computer and to all open windows.
## Choose a color theme
| Theme | Appearances |
| --- | --- |
| RuneStone | Light and dark |
| Claude | Light and dark |
| Sakura | Light only |
| Harvest Moon, Crimson Pilot, Silver Serpent | Dark only |
Select a theme card to use that theme. A check mark shows the current theme. In the cards, the arrow keys move to the next theme and select it.
Each named theme has its own fonts and syntax colors. Fonts come from your computer. RuneStone does not download fonts.
## Adjust transparency
**Transparent surfaces** tints work areas with a [background](#show-a-background) and compatible plugin surfaces.
Without a background image, menus are opaque. With an image, menus use the same transparency as other surfaces and blur the image.
Set **Transparency amount** from 0% to 100%. The default is 18%.
Turn off **Transparent surfaces** for opaque surfaces. Text and icons stay opaque in both cases.
## Show a background
The **Background** section shows a folder of images as a slideshow, or one image, behind the workspace.
Set **Background source** to **Folder**, **Image**, or **None**.
### Show a folder as a slideshow
1. Set **Background source** to **Folder**, or choose **Choose folder…**.
2. Select a folder with PNG, JPEG, GIF, or WebP images. Each image can be up to 64 MiB.
3. Set **Seconds per image** from 1 to 86,400.
4. Set **Image order** to **File name** or **Random**.
**File name** uses natural order, so `2.png` comes before `10.png`. **Random** does not repeat the current image when the folder has other images.
Images fade over two seconds. When your system reduces motion, the images change without a fade.
RuneStone reads the folder again when a window gets the focus, after a settings change, and after every 10 images.
Subfolders, links, and unreadable files do not show. When no image loads, the background goes away, and RuneStone tries again after the image time, at least 5 seconds.
**Remove folder** forgets the folder. It changes no file.
### Show one image
1. Set **Background source** to **Image**, or choose **Choose image…**.
2. Select a PNG, JPEG, WebP, or GIF file up to 50 MiB.
RuneStone keeps the image on this computer. **Remove image** deletes the saved copy. It does not change your file.
### Set the layout
- **Image size**: **Fill**, **Fit**, or **Actual size**.
- **Image position**: one of nine positions.
- **Image overlay**: from -100% to 100%. Negative values lighten the image, and positive values darken it.
The folder and the image keep separate layouts.
### Change one image of the folder
Portrait images show in full over a blurred fill by default. To change one image:
1. Open **Per-image appearance**.
2. Choose the image in **Image**. Type part of its name to find it.
3. Set **Fit**, **Position**, and **Overlay**. The preview shows the result.
4. Choose **Save image appearance**.
**Reset image appearance** returns the image to the folder layout.
RuneStone keeps these settings in `.runestone-backgrounds.json` in the image folder. When another program changed the file, choose **Reload image settings** and make the change again.
### Choose where the background shows
Under **Show the background in**, select **The workspace and new tabs**, **All Project Management boards**, or one board.
The board list shows the Project Management boards of the current workspace. A saved board that is not available shows as **Unavailable board**, so that you can clear it.
A blank tab of a browser window also shows the background.
### Next and Pause
- **Next background image** in the command palette (Ctrl+Shift+P) or **Next image** in the settings shows the next image in every window.
- **Pause background** in the command palette or **Pause slideshow** in the settings keeps the current image. Use the same command to resume.
### Turn Background off
Background is on by default. To turn it off, open **Settings → Features** and clear **Background**.
Off removes the background at once in all windows, and menus become opaque again. Your folder, image, and settings stay.
With **None** or without a folder or an image, Background does not load.
## Edit a theme
1. Select the theme that you want to start from.
2. Choose **Edit theme**. The theme editor opens as a tab in the workspace window.
3. Change a color with its swatch or its hex value. The window shows each change at once.
4. Choose **Save**.
A built-in theme does not change. **Save** creates a custom theme from it, with only the colors that you changed. The built-in theme stays its base.
- Each color shows its lowest contrast result. A warning icon marks a color that fails a [readability rule](../ui-color.md#readability-rules). Point to the result to see the failed checks.
- The reset button returns a color to the value of the base theme.
- **Discard** returns to the saved colors. **Duplicate** saves a copy and selects it.
- If you close the tab without **Save**, the window returns to the saved theme.
## Create a theme file
1. Select the theme and appearance that you want to start from.
2. Choose **Export theme template**.
3. Edit the saved JSON file in a text editor.
4. Choose **Install theme** and select the file.
The template contains every color and font of the theme. A custom theme has one fixed mode: light or dark.
A theme file can also be short. It gives only the colors that differ from its `base` theme. The base theme gives all other colors and its fonts.
Example (a short theme file that changes two colors of Harvest Moon):
```json
{
"schema": 3,
"id": "harbor",
"name": "Harbor",
"mode": "dark",
"base": "harvest-moon",
"colors": {
"accent": "#00c8ff",
"link": "#5cd6ff"
}
}
```
### Theme file rules
| Field | Rule |
| --- | --- |
| File | JSON, smaller than 64 KiB |
| `schema` | `3`. RuneStone also imports schema 1 and 2 files and converts them. A schema 1 file gives the palette of the current appearance. |
| `id` | Starts with a lowercase letter. Lowercase letters, numbers, and hyphens. Up to 64 characters. A theme with the same ID replaces the installed theme. |
| `name` | Up to 80 characters |
| `mode` | `light` or `dark` |
| `base` | Optional. The ID of a built-in theme that has a palette in `mode`: `default` (RuneStone), `claude`, `sakura`, `harvest-moon`, `crimson-pilot`, or `silver-serpent`. Without `base`, RuneStone is the base. |
| `colors` | The colors that differ from the base theme. Each value is a hexadecimal color with 3, 4, 6, or 8 digits. |
| `fonts` | Optional. Font stacks for `ui`, `prose`, `heading`, and `mono`, such as `"mono": "Cascadia Mono, monospace"`. Without a stack, the base theme gives it. |
An unknown key or a color that is not valid stops the installation with an error.
Some colors come from other colors when neither the file nor the base theme gives them. For example, `link` and `focus` come from `accent`.
Font stacks name fonts that are installed on the computer. A theme file cannot install fonts or contain scripts, style rules, or plugin code.
### Color keys
| Keys | Use |
| --- | --- |
| `bg`, `bg-elevated`, `bg-active`, `border` | The page, side panes and menus, hover fills, and borders |
| `text`, `text-dim`, `text-strong` | Normal, secondary, and prominent text |
| `accent`, `accent-2`, `accent-dim`, `accent-deep` | Theme colors for active states, indicators, and icons |
| `link`, `focus`, `on-accent` | Link text, keyboard focus outlines, and text on an accent fill |
| `selection`, `item-selection-bg`, `line-highlight`, `highlight`, `scrim` | Text selection, selected rows, the current line in Source, highlighted text, and the backdrop behind dialogs |
| `error`, `warn`, `warn-hot`, `ok`, `special` | Status and special content |
| `syntax-keyword`, `syntax-string`, `syntax-number`, `syntax-comment`, `syntax-type`, `syntax-function` | Code keywords, values, comments, types, and functions |
| `syntax-property`, `syntax-variable`, `syntax-constant`, `syntax-punctuation`, `syntax-heading` | Code properties, variables, constants, punctuation, and Markdown headings |
| `ansi-black` to `ansi-white`, `ansi-bright-black` to `ansi-bright-white` | The 16 terminal colors: black, red, green, yellow, blue, magenta, cyan, and white, and a bright variant of each |
Schema 1 and 2 files used other names for some code colors. RuneStone converts them: `syntax-local` to `syntax-variable`, `syntax-instance` to `syntax-property`, and `syntax-global` to `syntax-constant` and `syntax-punctuation`. Source never used `syntax-parameter` and `syntax-static`, so RuneStone ignores them.
Before you share a theme, check text, links, focus outlines, selections, and surfaces with a background image.
Keep informative text and symbols opaque. See the [functional color requirements](../ui-color.md).
## Share or remove a theme
To share a custom theme, select it and choose **Export theme template**. The other person installs the JSON file with **Install theme**.
**Remove custom theme** removes the theme and selects the RuneStone colors.
+78
View File
@@ -0,0 +1,78 @@
# Installation and updates
[RuneStone](../README.md) · [User guide](user-guide.md)
This guide installs, updates, or reinstalls RuneStone from a release file or from a package that you build.
| Platform | Release file | Notes |
| --- | --- | --- |
| Windows 10 or 11, x64 | [RuneStone_1.0.0_x64-setup.exe](https://github.com/kwyvern-gh/RuneStone/releases/download/v1.0.0/RuneStone_1.0.0_x64-setup.exe) | Installs for the current Windows account |
| macOS, Apple silicon | None | Build the app from source. See [macOS packages](builds.md#macos-packages). Intel Macs are not supported. |
| Linux, amd64 | None | Build a Debian package from source. See [Build Linux packages](builds.md#build-linux-packages). |
On Windows, you do not need Node.js, Rust, or a source checkout.
The built-in browser needs a separate engine download. See [Use the built-in browser](user-guide.md#use-the-built-in-browser).
## Install on Windows
1. Save `RuneStone_1.0.0_x64-setup.exe` and [windows-SHA256SUMS](https://github.com/kwyvern-gh/RuneStone/raw/master/docs/checksums/1.0.0/windows-SHA256SUMS) to Downloads.
2. Open PowerShell in Downloads.
3. Check the download:
```powershell
$expected = (Get-Content .\windows-SHA256SUMS).Split(' ')[0]
(Get-FileHash .\RuneStone_1.0.0_x64-setup.exe).Hash -eq $expected
```
If the result is not `True`, delete the file and download it again.
4. Open the setup file.
5. Complete setup. Keep the default destination unless you need another location.
6. Open RuneStone from the Start menu.
## Update or reinstall on Windows
1. Save your documents.
2. Close all RuneStone windows.
3. Open the installer for the same or a newer version.
4. Complete setup.
You do not need to uninstall first. Setup replaces the installed app in place, also for the same version.
Setup keeps your workspace files and settings. It does not install an older version over a newer one.
After an update from 0.1.48 or earlier, a browser tab asks you to download the browser engine one time.
## Install on macOS
Build the app on an Apple silicon Mac first. See [macOS packages](builds.md#macos-packages).
1. Copy `RuneStone.app` from `src-tauri/target/release/bundle/macos/` into Applications.
2. Open RuneStone from Applications.
## Update or reinstall on macOS
1. Save your documents and quit RuneStone.
2. Build the same or a newer version.
3. Copy the new `RuneStone.app` into Applications and confirm the replacement.
4. Open RuneStone from Applications.
## Install on Linux
Build the Debian package first. See [Build Linux packages](builds.md#build-linux-packages).
1. Open Terminal in the folder that contains the package.
2. Install the package. Use the file name of your build:
```bash
sudo apt install ./RuneStone_1.0.0_amd64.deb
```
3. Open RuneStone from your applications menu, or run `runestone` in Terminal.
APT installs the system libraries that the package declares. Run RuneStone as your ordinary desktop user.
## Update or reinstall on Linux
1. Save your documents and close RuneStone.
2. Open Terminal in the folder that contains the new package.
3. Install the newer package with the same `sudo apt install ./<file>.deb` command.
To reinstall the same version, run `sudo apt install --reinstall ./<file>.deb`.
+96
View File
@@ -0,0 +1,96 @@
# Linux development
[Development](development.md) · [Build Linux packages](builds.md#build-linux-packages) · [Install on Linux](installation.md#install-on-linux)
This guide gives the Linux-specific parts of source development and the native desktop checks for Linux.
For the general source setup, use [Run from source](development.md#run-from-source).
## Prerequisites
- The tools in [Run from source](development.md#run-from-source): Node.js 24, pnpm 10, and a stable Rust toolchain.
- The native libraries in [Tauri's Linux prerequisites](https://v2.tauri.app/start/prerequisites/#linux), including GTK and WebKitGTK 4.1.
- A graphical desktop session.
- A terminal with `node`, `pnpm`, and `cargo` on its `PATH`. If a command is missing, load the environment that its installer configured.
Do not copy `node_modules`, `src-tauri/target`, or `src-tauri/browser-engine` from a Windows checkout. They contain platform-specific binaries.
## Record the environment
Run these commands in the Linux session that you use for native checks:
```sh
cat /etc/os-release
uname -m
printf 'Desktop: %s\nSession: %s\n' "$XDG_CURRENT_DESKTOP" "$XDG_SESSION_TYPE"
```
Record the distribution, version, processor architecture, desktop, and session type with the source commit and the test results.
Test Wayland and X11 separately before you claim support for both. An x86_64 test does not prove ARM64 support.
## Browser runtime on Linux
Use the general steps in [Built-in browser runtime](development.md#built-in-browser-runtime). On Linux, these differences apply:
- Package and stage the runtime on the same architecture as the host build.
`npm --prefix browser-runtime run package` selects the current platform and architecture.
`package:linux` always builds x86_64. Do not use it on ARM64.
- `pnpm browser:stage` stops when the packaged runtime does not match the current platform and architecture.
- Staging makes sure that the `RuneStone-Browser` file is executable and sets the runtime folder to mode 755.
- Staging replaces the full `src-tauri/browser-engine` folder, so no files from an older package stay.
It moves the previous folder to `output/browser-stage-backups/`.
The Browser runtime always runs with the Electron sandbox. It stops when it receives `--no-sandbox`.
Run RuneStone as an ordinary desktop user, not as root.
Some distributions limit user namespaces, which the sandbox can need. Test the Browser on each target distribution.
The native host uses WebKitGTK and the Browser uses Electron. Test both.
Linux packages do not include the engine, and no Linux engine download exists yet. A package says that no engine is available for the platform. `pnpm tauri dev` starts the staged engine.
## Checks
Run the source checks in [Checks](development.md#checks) and the tests in [Browser smoke tests](development.md#browser-smoke-tests).
Then run `pnpm tauri dev` in the graphical session for the desktop checks below.
The source checks do not prove desktop compatibility.
Browser smoke tests use Chromium and simulated desktop calls. They do not test Linux file access or WebKitGTK.
## Desktop checks
Use a disposable workspace outside the installation folder.
Record each result, the source commit, and any error message.
Voice typing is not part of the Linux checks.
| Area | Pass criteria |
| --- | --- |
| Launch and windows | Open from the desktop. Move, resize, minimize, maximize, and close. Unsaved edits start the close guard. |
| Files and paths | Create, save, open again, rename, copy, and delete files. Check spaces, Unicode, and distinct `Note.md` and `note.md` files. |
| External edits | Edit a file in a different editor. RuneStone finds the change and does not silently replace conflicting edits. |
| Built-in Browser | In `pnpm tauri dev` with the staged engine, open a web page, type, scroll, open and close tabs, download a file, and restart the app. In a package, a browser tab says that no engine is available. |
| Editors | Edit Markdown, source code, tables, images, and diagrams. Check undo, keyboard shortcuts, and both themes. |
| Clipboard and dialogs | Copy and paste text, tables, and images. Check folder selection, external links, and file reveal. |
| Plugins | Install plugin ZIPs through Settings, enable them, restart, disable them, and remove them. Check that plugin data stays. |
| Terminal | Open the terminal panel. Bash starts in the workspace, accepts Unicode, resizes, and exits when its session closes. |
| Settings | Change preferences, restart, and make sure that they stay. Check separate workspace windows. |
For the use of Terminal, see the [Terminal guide](guides/terminal.md).
Check terminal profiles after a desktop launch too. A desktop launcher can have a different `PATH` from an interactive shell.
Known Linux limits:
- RuneStone rejects some names that Linux permits, for example names with `:` or `\`. Use portable filenames for baseline checks. Record a rejected name as a limit.
- On Linux, RuneStone uses the polling watcher only for paths that start with `//`. A share mounted at an ordinary path uses the native watcher, which can miss changes from other computers. Test network workspaces separately.
## Package builds
Use [Build Linux packages](builds.md#build-linux-packages) for Debian and AppImage builds, release files, and package checks.
For an example of a Linux test record, see the [Linux 0.1.44 validation](archive/linux-validation-0.1.44.md).
## Development help
| Problem | Action |
| --- | --- |
| Node.js, pnpm, or Cargo is missing | Load your toolchain environment. See [Prerequisites](#prerequisites). |
| The Browser runtime is missing | Package and stage it again. See [Browser runtime on Linux](#browser-runtime-on-linux). |
| Electron reports a sandbox or user-namespace error | Keep the sandbox on. Record the error and the distribution version. Run RuneStone as an ordinary desktop user. |
| A build stops | Record the first error, the command, the distribution version, and the free memory and disk space. |
+311
View File
@@ -0,0 +1,311 @@
{
"date": "2026-10-29",
"scope": [
"RuneStone",
"RuneStone_Local_Autocomplete",
"RuneStone_CSV_Viewer"
],
"limits": [
"Source patterns detect known menu construction routes. Browser evidence remains a separate check.",
"Native operating-system menus and embedded website controls keep platform presentation.",
"Older plugin hosts without ui.showActionMenu retain documented fallbacks."
],
"surfaces": {
"RuneStone/src/lib/browser/Browser.svelte": {
"counts": {
"action": 2
},
"design": "Shared action menu",
"check": "tests/smoke/browser/builtin.smoke.mjs; tests/smoke/browser/webData.smoke.mjs"
},
"RuneStone/src/lib/browser/Settings.svelte": {
"counts": {
"action": 1,
"localPopup": 2
},
"design": "Shared action menu",
"check": "tests/smoke/browser/builtin.smoke.mjs; tests/smoke/browser/webData.smoke.mjs"
},
"RuneStone/src/lib/browser/WebData.svelte": {
"counts": {
"action": 1
},
"design": "Shared action menu",
"check": "tests/smoke/browser/builtin.smoke.mjs; tests/smoke/browser/webData.smoke.mjs"
},
"RuneStone/src/lib/editor/codeMenu.ts": {
"counts": {
"action": 1
},
"design": "Shared action menu",
"check": "tests/smoke/menus/consistency.smoke.mjs; tests/smoke/links/linkEditing.smoke.mjs; tests/smoke/editor/surfaces.smoke.mjs"
},
"RuneStone/src/lib/editor/imageControls.ts": {
"counts": {
"action": 1
},
"design": "Shared action menu",
"check": "tests/smoke/menus/consistency.smoke.mjs; tests/smoke/links/linkEditing.smoke.mjs; tests/smoke/editor/surfaces.smoke.mjs"
},
"RuneStone/src/lib/editor/markdownMenu.ts": {
"counts": {
"action": 1
},
"design": "Shared action menu",
"check": "tests/smoke/menus/consistency.smoke.mjs; tests/smoke/links/linkEditing.smoke.mjs; tests/smoke/editor/surfaces.smoke.mjs"
},
"RuneStone/src/lib/editor/readingMenu.ts": {
"counts": {
"action": 1
},
"design": "Shared action menu",
"check": "tests/smoke/menus/consistency.smoke.mjs; tests/smoke/links/linkEditing.smoke.mjs; tests/smoke/editor/surfaces.smoke.mjs"
},
"RuneStone/src/lib/editor/spellingMenu.ts": {
"counts": {
"action": 1
},
"design": "Shared action menu",
"check": "tests/smoke/menus/consistency.smoke.mjs; tests/smoke/links/linkEditing.smoke.mjs; tests/smoke/editor/surfaces.smoke.mjs"
},
"RuneStone/src/lib/editor/tableSelectionControls.ts": {
"counts": {
"action": 1
},
"design": "Shared action menu",
"check": "tests/smoke/menus/consistency.smoke.mjs; tests/smoke/links/linkEditing.smoke.mjs; tests/smoke/editor/surfaces.smoke.mjs"
},
"RuneStone/src/lib/layout/ContextMenu.svelte": {
"counts": {
"action": 1
},
"design": "Shared action menu",
"check": "tests/smoke/menus/consistency.smoke.mjs"
},
"RuneStone/src/lib/layout/FileTree.svelte": {
"counts": {
"svelteMenu": 1
},
"design": "Shared action menu",
"check": "tests/smoke/menus/consistency.smoke.mjs"
},
"RuneStone/src/lib/features/git/GitGraph.svelte": {
"counts": {
"picker": 1
},
"design": "Commit history listbox of the native Git feature, not a popup menu",
"check": "tests/smoke/features/git.smoke.mjs"
},
"RuneStone/src/lib/layout/CommandPalette.svelte": {
"counts": {
"picker": 1,
"localPopup": 3
},
"design": "Shared searchable picker (rs-picker) for the command palette",
"check": "tests/smoke/layout/commands.smoke.mjs"
},
"RuneStone/src/lib/layout/QuickOpen.svelte": {
"counts": {
"picker": 1,
"localPopup": 3
},
"design": "Shared searchable picker used by quick file open and document link picker",
"check": "tests/smoke/workspace/openAndCreate.smoke.mjs; tests/smoke/links/linkMenus.smoke.mjs"
},
"RuneStone/src/lib/layout/TabBar.svelte": {
"counts": {
"action": 2
},
"design": "Shared action menu for tab actions and the list of all tabs",
"check": "tests/smoke/menus/consistency.smoke.mjs; tests/smoke/layout/titleBar.smoke.mjs"
},
"RuneStone/src/lib/layout/Workbench.svelte": {
"counts": {
"action": 1
},
"design": "Shared action menu",
"check": "tests/smoke/menus/consistency.smoke.mjs"
},
"RuneStone/src/lib/layout/WorkspacePicker.svelte": {
"counts": {
"picker": 1,
"localPopup": 8
},
"design": "Shared rich picker; paths retain a detail row",
"check": "tests/smoke/workspace/openAndCreate.smoke.mjs"
},
"RuneStone/src/lib/plugins/externalSession.ts": {
"counts": {
"action": 1
},
"design": "Shared action menu",
"check": "tests/smoke/menus/consistency.smoke.mjs"
},
"RuneStone/src/lib/plugins/PluginAccessMenu.svelte": {
"counts": {
"svelteMenu": 1
},
"design": "Shared action menu",
"check": "tests/smoke/menus/consistency.smoke.mjs"
},
"RuneStone/packages/plugin-sdk/src/api.ts": {
"counts": {
"action": 1
},
"design": "API type declaration, no renderer",
"check": "pnpm check"
},
"RuneStone/src/lib/ui/actionMenu.ts": {
"counts": {
"action": 1,
"localPopup": 3
},
"design": "Shared action menu. Submenus are manual popovers in the top layer (UI-043).",
"check": "tests/smoke/menus/consistency.smoke.mjs"
},
"RuneStone/src/lib/ui/managedActionMenu.ts": {
"counts": {
"action": 2
},
"design": "Shared action menu",
"check": "tests/smoke/menus/consistency.smoke.mjs"
},
"RuneStone_Local_Autocomplete/src/main.mjs": {
"counts": {
"action": 1,
"nativeChoice": 1
},
"design": "Host radio menu; native server select only on older hosts",
"check": "tests/smoke/plugins/choiceMenus.smoke.mjs"
},
"RuneStone_CSV_Viewer/src/index.js": {
"counts": {
"action": 1,
"picker": 1,
"localPopup": 5
},
"design": "Shared action menus for sorting, filters, and header actions. Persistent searchable column visibility dialog uses rs-picker rows and shared surfaces.",
"check": "RuneStone_CSV_Viewer/tests/browser.mjs; RuneStone_CSV_Viewer/tests/host.mjs"
},
"RuneStone/src/lib/layout/SettingsDialog.svelte": {
"counts": {
"action": 1,
"localPopup": 1
},
"design": "Shared action menu for interface language; settings retain ordinary controls",
"check": "tests/smoke/settings/displayLanguage.smoke.mjs; tests/smoke/menus/consistency.smoke.mjs"
},
"RuneStone/src/lib/features/background/BackgroundSettings.svelte": {
"counts": {
"action": 1,
"localPopup": 4
},
"design": "Shared action menu for the source, the order, the image position, and the image size. Theme choice stays on preview cards (UI-047).",
"check": "tests/smoke/features/background.smoke.mjs"
},
"RuneStone/src/lib/features/background/ImageEditor.svelte": {
"counts": {
"action": 1,
"picker": 2,
"localPopup": 2
},
"design": "Shared action menu for the fit and the position of one image. The image list is the shared searchable picker (rs-picker).",
"check": "tests/smoke/features/background.smoke.mjs"
},
"RuneStone/src/lib/features/terminal/TerminalDock.svelte": {
"counts": {
"action": 1
},
"design": "Shared action menu through showActionMenu",
"check": "tests/smoke/features/terminal.smoke.mjs"
},
"RuneStone/src/lib/features/terminal/TerminalPicker.svelte": {
"counts": {
"picker": 2,
"localPopup": 3
},
"design": "Shared searchable picker",
"check": "tests/smoke/features/terminal.smoke.mjs"
},
"RuneStone/src/lib/features/TerminalSettings.svelte": {
"counts": {
"action": 1,
"localPopup": 1
},
"design": "Shared action menu for the default profile in Settings → Terminal",
"check": "tests/smoke/features/terminal.smoke.mjs"
},
"RuneStone/src/lib/features/pm/ui/host.ts": {
"counts": {
"action": 2
},
"design": "The host layer of Project Management: showActionMenu of managedActionMenu.ts and the shared tooltip",
"check": "tests/smoke/features/pm.smoke.mjs; tests/smoke/find/pluginViews.smoke.mjs"
},
"RuneStone/src/lib/features/pm/ui/choices-ui.ts": {
"counts": {
"action": 1
},
"design": "Shared choice adapter: the native selects stay hidden for their values, and the host action menu shows the choices",
"check": "tests/smoke/features/pm.smoke.mjs; tests/smoke/find/pluginViews.smoke.mjs"
},
"RuneStone/src/lib/features/pm/ui/priority-ui.ts": {
"counts": {
"action": 1
},
"design": "Shared action menu for the card priority",
"check": "tests/smoke/features/pm.smoke.mjs; tests/smoke/find/pluginViews.smoke.mjs"
},
"RuneStone/src/lib/features/pm/ui/details-ui.ts": {
"counts": {
"picker": 1,
"localPopup": 4
},
"design": "Shared searchable picker classes (rs-picker) for the optional card details",
"check": "tests/smoke/features/pm.smoke.mjs; tests/smoke/find/pluginViews.smoke.mjs"
},
"RuneStone/src/lib/features/pm/ui/labels-ui.ts": {
"counts": {
"picker": 1,
"localPopup": 3
},
"design": "Shared searchable picker classes (rs-picker) for labels",
"check": "tests/smoke/features/pm.smoke.mjs; tests/smoke/find/pluginViews.smoke.mjs"
},
"RuneStone/src/lib/features/pm/ui/relations-ui.ts": {
"counts": {
"nativeChoice": 1,
"picker": 1,
"localPopup": 5
},
"design": "Shared relationship choice through the choice adapter and direct searchable picker rows",
"check": "tests/smoke/features/pm.smoke.mjs; tests/smoke/find/pluginViews.smoke.mjs"
},
"RuneStone/src/lib/features/pm/ui/tags.ts": {
"counts": {
"picker": 2,
"localPopup": 2
},
"design": "Shared searchable picker classes (rs-picker) for tag suggestions",
"check": "tests/smoke/features/pm.smoke.mjs; tests/smoke/find/pluginViews.smoke.mjs"
},
"RuneStone/src/lib/features/pm/ui/ui.ts": {
"counts": {
"action": 3,
"nativeChoice": 12,
"picker": 1,
"localPopup": 1
},
"design": "Board, list, card, scope, and background menus use the host action menu. Native selects stay hidden behind the shared choice adapter",
"check": "tests/smoke/features/pm.smoke.mjs; tests/smoke/find/pluginViews.smoke.mjs"
},
"RuneStone/src/lib/features/ProjectManagementSettings.svelte": {
"counts": {
"action": 1,
"localPopup": 2
},
"design": "Shared action menu for the priority levels and the default board in Settings → Project Management",
"check": "tests/smoke/features/pm.smoke.mjs; tests/smoke/find/pluginViews.smoke.mjs"
}
}
}
+472
View File
@@ -0,0 +1,472 @@
# Plugin development reference
[Development](development.md) · [Install and manage plugins](plugins.md) · [Plugin host internals](plugin-host.md)
This reference gives the package contract, the build procedure, and the API for RuneStone plugin authors.
- [Install the SDK](#install-the-sdk)
- [Package contract](#package-contract)
- [Build and package a plugin](#build-and-package-a-plugin)
- [Build examples](#build-examples)
- [Versions and releases](#versions-and-releases)
- [Plugin API](#plugin-api)
- [Use the SDK instead of native calls](#use-the-sdk-instead-of-native-calls)
- [Folder grants](#folder-grants)
- [Plugin services](#plugin-services)
## Install the SDK
The plugin SDK `@runestone/plugin-sdk` gives the API types, the feature checks, and the RuneStone icons and tooltip.
Install it in each plugin project from the URL of its package file on the RuneStone releases page.
```sh
pnpm add -D "https://github.com/kwyvern-gh/RuneStone/releases/download/plugin-sdk-v0.1.2/runestone-plugin-sdk-0.1.2.tgz"
```
- Always give the full URL. The SDK is not on the npm registry, and another account owns the `@runestone` scope there.
- npm accepts the same URL. The installation needs no access token and no `.npmrc` file.
- To change the SDK version, change the version in both parts of the URL: the tag and the file name.
- Bundle the SDK helpers into the entry module. A type-only import adds no code.
- Do not copy RuneStone source files into a plugin, and do not import them from a RuneStone checkout. Use the SDK types and the host APIs.
| SDK import | Contents |
| --- | --- |
| `@runestone/plugin-sdk` | `PluginApi` and its members, `PluginManifest`, `API_VERSION`, and the [feature checks](#compatibility) |
| `@runestone/plugin-sdk/icons` | `actionIcons` and `actionIcon(name)`. See [Commands](#commands). |
| `@runestone/plugin-sdk/tooltip` | `attachTooltip(element, label)`, the tooltip of RuneStone controls |
For menus, use `api.ui.showActionMenu`. See [Menus](#menus).
The SDK source is `packages/plugin-sdk/` in this repository. For its versions and releases, see [SDK releases](releases.md#sdk-releases).
The [SDK README](../packages/plugin-sdk/README.md) has a minimal plugin in TypeScript.
Example: `fixtures/plugins/workspace-overview/main.js` uses JSDoc types from the SDK and needs no compile step. `pnpm check` checks it with `fixtures/plugins/tsconfig.json`.
## Package contract
A plugin is one standard `.zip` file with `plugin.json` at the archive root.
All plugins use the same package format and the same install, enable, disable, and removal lifecycle.
The manifest type is `PluginManifest` in the [SDK](#install-the-sdk).
```json
{
"schemaVersion": 1,
"id": "org.example.hello",
"name": "Hello",
"author": "Example author",
"description": "Open a small example view.",
"version": "1.0.0",
"apiVersion": 1,
"entry": "main.js",
"access": "full-app"
}
```
| Field | Rule |
| --- | --- |
| `schemaVersion` | Must be `1`. |
| `id` | Lowercase letters, digits, dots, and hyphens. Starts with a letter. At most 120 characters. Cannot end with a dot. |
| `name`, `author`, `description` | Required text, at most 1,000 bytes each. |
| `version` | Three numeric parts with an optional lowercase letter suffix, such as `1.0.0` or `0.2.28a`. |
| `apiVersion` | Must be `1`. |
| `entry` | Path of a compiled `.js` or `.mjs` module in the package. |
| `access` | Must be `"full-app"`. |
The host rejects any other manifest field.
The `runestone.*` ID prefix follows the same rules as other IDs. An ID does not prove the identity of the publisher.
### Paths and limits
Package paths use ASCII letters, digits, dots, underscores, and hyphens, with `/` between folders.
Each path segment has at most 120 characters, and the full path has at most 180 characters.
The host rejects Windows device names, `.` and `..` segments, and segments that end with a dot.
It also rejects absolute paths, links, junctions, and paths that differ only in letter case.
| Limit | Value |
| --- | --- |
| Entries in the package | 5,000 |
| Expanded data | 100 MiB |
| One file | 25 MiB |
| Compressed ZIP | 100 MiB |
| `plugin.json` | 64 KiB |
| Installed path (application data folder, plugin ID, and package path) | 240 characters |
### Entry module
The entry is one compiled JavaScript module. Bundle all dependencies into it.
The host loads the module from a Blob URL, so relative imports do not resolve. Read packaged files with `api.assets.read`.
The host does not accept raw TypeScript, Svelte source, native libraries, dependencies on other plugins, or automatic updates.
### Package files
```text
org.example.hello-1.0.0.zip
plugin.json
main.js
assets/
README.md
LICENSE
```
The manifest and the entry module are required. Assets, a README, and a license are optional.
In the README, give the RuneStone version that the plugin needs, its purpose, the install steps, and a help contact.
Keep JavaScript readable. Do not minify or obfuscate code in a way that makes inspection difficult.
## Build and package a plugin
Use this procedure for every plugin. Each plugin project defines its own compile step.
1. Compile the plugin into a clean folder that contains `plugin.json`, the entry module, and the assets that it needs.
2. From the RuneStone repository, run `pnpm package:plugin <compiled-folder> [output-folder]`.
3. Install the ZIP in RuneStone through [Settings → Plug-ins](plugins.md#install-a-plugin).
4. Test the plugin features, then test Disable and Uninstall.
From another repository, run `node <RuneStone>/scripts/packagePlugin.mjs <compiled-folder> [output-folder]`.
The packager needs Node.js 24 or later.
The packager (`scripts/packagePlugin.mjs`) does these steps:
- It applies the [package contract](#package-contract) checks to the manifest, paths, entry module, and limits.
- It adds every file in the compiled folder. Keep dependencies, credentials, and unrelated build files out of that folder.
- It writes `<id>-<version>.zip`. Without an output folder, it uses `releases/` in the nearest parent folder that contains a `package.json` file.
- It stops when the output folder is inside the compiled folder.
- It writes the same bytes for the same input. It uses sorted paths, fixed timestamps, and DEFLATE compression.
- It keeps an existing ZIP with identical contents. It stops when an existing ZIP has different contents. It never overwrites a ZIP.
Keep each completed plugin ZIP in the `releases/` folder of its own plugin project, also when the RuneStone repository starts the build.
Use an explicit output folder only for checks and staging.
Other build tools can make the same ZIP layout. Do not put a parent folder above `plugin.json`.
The native installer applies the package checks again before installation.
In user instructions, do not tell users to load JSON, select a build folder, rename a release file, or install dependencies.
## Build examples
Each example is specific to one plugin. Read the package scripts of a plugin before you build it.
For the RuneStone source setup, see [Run from source](development.md#run-from-source).
### Example: CSV Viewer
Source: the CSV Viewer repository, a private repository: its `package.json`, `plugin.json`, `scripts/build.mjs`, and `README.md`.
| Item | Value |
| --- | --- |
| Prerequisites | Node.js 24 or later and pnpm. Run `pnpm install --frozen-lockfile` in the CSV Viewer folder. Put the RuneStone source checkout beside it, in a folder with the name `RuneStone`. The source imports shared interface files from `../../RuneStone/src/lib/ui/`. |
| Working folder | The CSV Viewer repository root |
| Command | `pnpm build` |
| Output | `releases/runestone.csv-viewer-<version>.zip` in the CSV Viewer folder. `<version>` is the `version` of `plugin.json`, for example `0.1.3`. |
The build compiles `src/index.js` with esbuild into a readable `dist/main.js`. It copies `plugin.json` and `README.md` into `dist/` and writes `dist/build.json`.
Then it runs `scripts/packagePlugin.mjs` of the RuneStone checkout on `dist/`. Set `RUNESTONE_ROOT` to use another RuneStone checkout for this step.
The build stops when the versions in `package.json` and `plugin.json` are different. It also stops when the release ZIP of the version exists. Set the next version in both files first.
To compile into `dist/` without a ZIP, run `pnpm compile`.
### Example: Workspace overview
Source: `fixtures/plugins/workspace-overview/` in this repository. It contains `plugin.json` and a `main.js` that needs no compile step.
| Item | Value |
| --- | --- |
| Prerequisites | Node.js 24 and the RuneStone source setup |
| Working folder | The RuneStone repository root |
| Command | `pnpm package:plugin fixtures/plugins/workspace-overview <output-folder>` |
| Output | `<output-folder>/org.runestone-example.workspace-overview-1.0.0.zip` |
Use an output folder outside the repository. Without one, the ZIP goes into the RuneStone `releases/` folder, which is for installers.
After you install and enable the ZIP, open **Plug-in views → Workspace overview**, or run **Commands → Show workspace overview**.
## Versions and releases
For version numbers and hotfix suffixes, see [Versions](releases.md#versions).
To publish a plugin ZIP, see [Publish a plugin release](releases.md#publish-a-plugin-release).
For the release format that Gitea-link installation accepts, see [Gitea downloads](plugin-host.md#gitea-downloads).
## Plugin API
The entry module exports `activate(api)`. Activation can return a cleanup function, or a promise for one.
```js
export function activate(api) {
api.registerView({
id: "hello",
title: "Hello",
mount(container) {
const text = document.createElement("p");
text.textContent = "Hello from a RuneStone plugin.";
container.append(text);
return () => text.remove();
}
});
api.registerCommand({
id: "show-hello",
title: "Show hello",
run: () => api.openView("hello")
});
}
```
### Compatibility
Members marked optional can be absent on older RuneStone hosts.
Before you call an optional member, make sure that it exists. If the plugin cannot work without it, show an error that tells the user to update RuneStone.
The SDK feature checks do this. Their error names each missing feature and tells the user to update RuneStone.
```ts
import { hasFeature, requireFeature, requireFeatures } from "@runestone/plugin-sdk";
requireFeatures(api, ["files", "workspace.readBytes"]);
const files = requireFeature(api, "files");
if (hasFeature(api, "settings.subscribe")) watchSettings();
```
Without the SDK, examine the member directly: `if (!api.workspace.readBytes) throw new Error("Update RuneStone to use this plugin.");`
Older hosts ignore unknown fields in objects that you pass to the host, such as a view `icon` or `launch` handler.
The host has no `api.backgrounds`. Only the native Background feature shows images behind the interface, and plugins cannot set or read its frames.
### Activation and cleanup
- The host limits activation, each view mount, and each cleanup callback to five seconds. A timeout reports an error.
After a cleanup timeout or failure, the user cannot enable or remove the plugin until RuneStone restarts.
- Plugins activate in every RuneStone window except browser windows.
- `api.signal` aborts when shutdown starts. Use it to stop pending work.
- After shutdown starts, every API call throws an error. Ignore results that arrive after shutdown.
- On disable, the host removes contributions, commands, and views first. Then it runs view cleanups and `onDispose` callbacks in reverse order.
- Remove timers, listeners, and other resources in cleanup. Closing a view and disabling the plugin share the same cleanup promise.
- Plugins have full application access. The SDK does not isolate plugin JavaScript.
### API reference
| Member | Optional | Contract |
| --- | --- | --- |
| `api.id` | | The installed plugin ID. |
| `api.signal` | | An `AbortSignal` that aborts when shutdown starts. |
| `onDispose(callback)` | | Register synchronous or asynchronous cleanup. |
| `contribute(key, value)` | | Register a host feature. See [Contributions](#contributions). |
| `registerCommand(command)` | | Add a command. See [Commands](#commands). |
| `registerView(view)` | | Add a view. See [Views](#views). |
| `openView(id, options?)` | | Open a view of this plugin. `options` is `{ split: "right" \| "down", relativeTo }`, where `relativeTo` is the ID of an open editor view of the same plugin. |
| `closeView(id)` | yes | Close the editor tabs of a view of this plugin. |
| `replaceView(currentId, nextId)` | yes | Show another editor view in the current tab. The tab keeps its position and pin state. |
| `replaceDocumentWithView(document, nextId)` | yes | Show an editor view in place of a document tab of this plugin. |
| `updateViewTitle(id, title)` | yes | Change a view title. At most 200 characters. |
| `updateViewIcon(id, image)` | yes | Set a tab icon from a base64 `data:image/...` URL (PNG, JPEG, GIF, WebP, ICO, or SVG) of at most 90,000 characters. `null` removes it. |
| `registerTabDrop(receive)` | yes | Accept a plugin tab that the user drags from another window. One receiver for each plugin. |
| `registerDocumentType(type)` | | Recognize workspace files and open them in a plugin editor. See [Document types](#document-types). |
| `openDocument(path)` | | Open a recognized document in its own tab. Rejects when no enabled plugin recognizes the file. |
| `openFile(path)` | yes | Open a workspace file in the normal RuneStone editor. |
| `renameDocument(document, name)` | yes | Rename a recognized document. Returns the new workspace path. |
| `workspace.*` | | Read and write files in the active workspace. See [Workspace files](#workspace-files). |
| `settings.read()` | | Read the saved JSON settings of the plugin. Returns `null` before the first write. |
| `settings.write(value)` | | Save JSON settings, at most 1 MiB. |
| `settings.subscribe(listener)` | yes | Receive a call when the saved settings change in any window. Returns a cleanup function. |
| `assets.read(path)` | | Read a package file as a `Uint8Array`. |
| `ui.showActionMenu(options)` | yes | Open the shared RuneStone action menu. See [Menus](#menus). |
| `completion` | yes | Autocomplete fields and providers. See the [completion API](completion.md). |
| `files` | yes | Folders outside the workspace that the user granted to the plugin. See [Folder grants](#folder-grants). |
| `services` | yes | Data that one plugin offers to other plugins. See [Plugin services](#plugin-services). |
### Commands
```js
api.registerCommand({ id: "next", title: "Next image", icon: "skip-forward", run: () => next() });
```
| Field | Rule |
| --- | --- |
| `id` | Lowercase letters, digits, dots, and hyphens. Starts with a letter. Unique among the commands of the plugin. |
| `title` | Required text. |
| `run` | Required function. Can return a promise. |
| `category` | `"action"` (default) adds the command to the **Commands** menu. `"open"` adds it to the **Plug-in views** menu. |
| `icon` | Optional. An `ActionIcon` name from the SDK, such as `play`, `pause`, `skip-forward`, or `refresh`, or a view icon name. |
Give each command a recognizable icon.
### Views
| Field | Rule |
| --- | --- |
| `id`, `title` | Same rules as for commands. View IDs are unique among the views of the plugin. |
| `mount(container, context?)` | Required. Draws the view and can return a cleanup function or a promise. `context.surface` is `"view"` or `"settings"`. |
| `placement` | `"dialog"` (default), `"editor"` for a tab in the editor area, or `"sidebar"` for the left pane. |
| `navigation` | `true` adds an icon button. See [Navigation buttons](#navigation-buttons). |
| `icon` | `list`, `kanban`, `puzzle` (default), `globe`, or `git`. |
| `settings` | `true` makes the view a configuration page in Settings. See [Settings pages](#settings-pages). |
| `launcher` | `false` keeps the view out of the **Plug-in views** menu. Use it for dynamic views that already have tabs. |
| `launch()` | Optional. Runs instead of `openView` when the user opens the view from a menu or a navigation button. |
| `pinned` | Initial pin state of an editor tab. |
| `tabActions({ pinned })` | Returns extra `ActionMenuItem` entries for the tab menu. |
| `find()` | Runs when the user starts Find in this tab. |
| `tabDragData({ pinned })` | Returns a string that moves with the tab to another window. The receiver is `registerTabDrop`. |
| `saveTabState()` / `restoreTabState(state)` | Save and restore view state when an editor tab moves to another window. |
| `toolbar` | Accepted. In the current host, it only removes the view from the ribbon. |
Dialog views open in a modal window. Editor views open as tabs beside documents. Document tabs keep their buffers when the user changes views.
Closing an editor tab or disabling the plugin disposes the view.
A `launch()` handler can select a default target and call `api.openView(id)`.
Explicit `api.openView` calls and restored tabs do not call `launch()`.
### Navigation buttons
- A view with `navigation: true` and `placement: "sidebar"` gets a button beside Files, Search, and Bookmarks at the top of the left pane. It opens in the left pane, and the **Plug-in views** menu does not show it.
- A view with `navigation: true` and another placement gets a button in the ribbon at the left edge of the window. The **Plug-in views** menu also shows it, unless `launcher` is `false`.
- Each button shows the view title as a tooltip on hover and keyboard focus.
### Settings pages
Register a view with `settings: true` to add a configuration page under the plugin name in Settings.
The host mounts that view in the Settings window with `context.surface` set to `"settings"`. The view does not appear in the **Plug-in views** menu.
The Settings window loads enabled plugins, so the page is available there.
To react to a change from another window, call `settings.subscribe(listener)`. Then read the new value with `settings.read()`.
The notification contains no data. Ignore reads that finish after shutdown, and do not let an older read replace newer settings.
RuneStone translates only its own interface. It does not translate plugin text or supply a translation API.
### Menus
`ui.showActionMenu({ x, y, items, label?, parent? })` opens the shared action menu at a screen position. It returns `{ close() }`.
Each item is `{ label, icon?, shortcut?, run?, children?, disabled?, checked?, radio?, title? }` or `{ separator: true }`. The SDK types are `ActionMenuItem` and `ActionMenuOptions`.
The menu closes on selection, outside click, resize, window blur, scroll, and plugin shutdown.
Use this menu instead of a custom menu. See the [interface design reference](ui-design.md).
### Document types
A document type lets a plugin open some workspace files in its own editor.
| Field | Rule |
| --- | --- |
| `id`, `title` | Same rules as for views. Unique among the document types of the plugin. |
| `extensions` | Required list of lowercase extensions without the dot, such as `["md"]`. |
| `identify(path, source)` | Returns `{ id }` with a stable document ID, or `null`. |
| `mount(container, { id, path })` | Draws the editor. Can return a cleanup function. |
| `icon` | `"file"` (default) or `"kanban"`. The file tree shows it. |
| `content` | `"text"` (default) or `"binary"`. |
| `create` | Optional `{ label, defaultName, extension, contents() }`. `extension` must be in `extensions`. `contents()` returns the complete file text. |
- Files that `identify` rejects, or that cause an error, stay available in the text editor.
- Each document opens in its own tab. A second open of the same document selects its tab.
- Closing a tab disposes only that mount. Disabling the plugin disposes all its mounts and removes its file tree icons.
- Creation never replaces an existing file.
- For binary types, `identify` receives an empty `source`. Identify the file from its path, then read bytes in `mount` with `workspace.readBytes`. Show errors about invalid data in the view.
`renameDocument({ id, path }, name)` renames a document that this plugin recognizes.
The host checks the document ID and the owner. It keeps the folder and the extension, rejects name conflicts, and updates open tabs.
Names can contain dots. Hidden names and reserved filename characters are invalid.
### Workspace files
All paths are relative to the active workspace of the window. The host rejects paths outside the workspace.
| Member | Optional | Contract |
| --- | --- | --- |
| `list(path?)` | | List one folder. Returns `{ name, rel_path, kind }` entries, where `kind` is `"file"` or `"folder"`. |
| `listMarkdown()` | yes | Return all `.md`, `.markdown`, and `.mdown` paths in sorted order, in one request. Skips names that start with a dot, and links. |
| `read(path)` | | Read a UTF-8 text file. |
| `readOptional(path)` | yes | Read a text file, or return `null` when the file does not exist. |
| `readMany(paths)` | yes | Read at most 64 text files with a total of at most 16 MiB. Returns `{ path, source }` or `{ path, error }` for each path. |
| `readBytes(path)` | yes | Read a file of at most 64 MiB as a `Uint8Array`. |
| `create(path, contents)` | yes | Create a text file. Fails when the file exists. |
| `write(path, contents, expected)` | | Save the file only if it still contains `expected`. `expected` is required. |
| `subscribe(listener)` | yes | Receive a call when workspace files change: from a plugin, the host, another program, or another window. Changes in `.runestone/` count too. Returns a cleanup function. |
In `readMany`, one failed file does not stop the other reads. More than 64 paths make the whole call fail.
`write` and `renameDocument` fail when the file is open in RuneStone with unsaved edits.
### Contributions
`contribute(key, value)` registers a host feature. The SDK type is `Contributions`.
Only one enabled plugin can own each key. The host removes contributions before cleanup starts.
| Key | Purpose | Owner |
| --- | --- | --- |
| `browser` | The built-in browser. `newTab(url?)` opens a browser tab. `open(url)` returns false when the system browser must open a web link, for example before the engine is installed. | RuneStone |
Earlier hosts also had `api.pty` and a `terminal` key for the Terminal plugin. They are gone, because RuneStone now includes Terminal as a native feature.
### Theme tokens
Style plugin views with the host CSS custom properties. The host sets them on the root element for the current theme.
Do not hard-code colors, and do not choose colors from a theme ID.
| Token | Use |
| --- | --- |
| `--rs-bg` | The page: document and editor surfaces |
| `--rs-bg-elevated` | Side panes, menus, cards, and dialogs |
| `--rs-bg-active` | Hover and pressed fills |
| `--rs-border` | Dividers and control borders |
| `--rs-text`, `--rs-text-dim`, `--rs-text-strong` | Body text, secondary text, and headings |
| `--rs-accent`, `--rs-accent-2` | Theme identity: active states, indicators, and icons |
| `--rs-link` | Link and action text |
| `--rs-focus` | Keyboard focus outlines |
| `--rs-on-accent` | Text and icons on an accent fill |
| `--rs-selection`, `--rs-selection-text` | Text selection. The fill is at most 65% opaque. |
| `--rs-item-selection-bg`, `--rs-item-selection-border` | Selected rows, cards, and cells |
| `--rs-highlight` | Highlighted text |
| `--rs-scrim` | The backdrop behind a dialog |
| `--rs-error`, `--rs-warn`, `--rs-warn-hot`, `--rs-ok` | Status. Show an icon or text with each status color. |
| `--rs-special` | One more distinct color, for example for numbers |
| `--rs-syntax-*` | Code colors. [Functional color](ui-color.md#roles-and-tokens) lists the roles. |
| `--rs-ansi-black` to `--rs-ansi-white`, `--rs-ansi-bright-black` to `--rs-ansi-bright-white` | The 16 terminal colors. Each keeps its ANSI hue in every theme. |
[Interface design](ui-design.md#shared-components-and-tokens) lists the size, menu, settings, and tooltip tokens.
The root element also has `data-theme` (`light` or `dark`) and `data-palette` (the theme ID). Use `data-theme` for differences between light and dark.
The window sends a `runestone-theme-changed` event after each theme change. A plugin that copies token values, for example into a canvas or a terminal, reads them again on that event.
## Use the SDK instead of native calls
Do not call `invoke`, `listen`, or other `@tauri-apps/api` functions from a plugin. Do not read the private files of other plugins.
Use the `api` members of the [API reference](#api-reference). They check plugin shutdown, and they will stay available when a later host runs each plugin in its own isolated context.
Make sure that an optional member exists before you use it.
The Local Autocomplete and CSV Viewer plugins make no native calls.
Their test scripts replace `window.__TAURI_INTERNALS__` with a test double. That is test code and does not go into the package.
## Folder grants
`api.files` (`version: 1`) gives access to folders outside the workspace. The user selects each folder. The plugin cannot supply a path.
A grant is `{ id, path, name }`. `id` is opaque. `path` and `name` are for display only.
| Member | Contract |
| --- | --- |
| `chooseFolder({ title? })` | Opens the folder picker. Returns a grant, or `null` on cancel. The same folder gives the same grant again. |
| `pictureFolder(name)` | Creates `RuneStone <name>` in the Pictures folder of the user if necessary, and returns a grant for it. `name` has letters, digits, spaces, hyphens, and underscores, at most 64 characters. |
| `grants()` | Returns the grants of this plugin. |
| `revoke(grant)` | Removes a grant. Returns `false` when the plugin has no such grant. |
| `list(grant)` | Returns `{ name, size }` for the ordinary files directly in the folder. Skips folders and links. |
| `readBytes(grant, name)` | Reads one file of at most 64 MiB as a `Uint8Array`. |
| `readSidecar(grant, name)` | Reads a sidecar file as text, or returns `null` when it does not exist. |
| `writeSidecar(grant, name, contents, expected)` | Saves a sidecar file only if it still contains `expected`. Use `null` when the file does not exist. |
Each plugin has its own grants. The host keeps them with the retained data of the plugin, so they stay after a restart, an update, or a removal.
A file name is one name without folder parts. The host rejects `..`, links, and files that resolve outside the granted folder.
When the granted folder is removed or becomes a link, its grant stops working. Ask the user to choose the folder again.
A sidecar is a small JSON file that the plugin keeps beside the files of the user. Its name has the form `.runestone-<name>.json`, where `<name>` has letters, digits, hyphens, and underscores.
A sidecar holds valid JSON of at most 1 MiB. The host writes no other files in a granted folder.
Store the grant `id` in the plugin settings. Before you use a saved grant, look for it in `grants()`.
### Example: the per-image settings of Background
The per-image settings file of the Background feature is `.runestone-backgrounds.json` in the image folder.
It is JSON with `"schema": 1` and an `images` object, at most 1 MiB. Each key is a file name. Each value can have `fit` (`cover`, `contain`, `auto`, or `blurred`), `position`, and `overlay`.
A plugin with a folder grant can read and write the same file with `files.readSidecar` and `files.writeSidecar`. `writeSidecar` compares the current file to `expected` (`null` when the file does not exist). It fails when the file changed, so external edits are not lost. The host checks only that the text is JSON. The plugin checks the schema.
Example: `src/lib/features/background/imageSettings.ts` reads the file and applies it.
## Plugin services
`api.services` (`version: 1`) lets a plugin offer data to other plugins in the same window. The host passes the calls, so no plugin reads the private files of another plugin.
| Member | Contract |
| --- | --- |
| `provide(name, methods)` | Offers an object of functions under a name. Returns `{ notify(), dispose() }`. One plugin can offer each name once. |
| `get(plugin, name)` | Returns the methods of a service of another plugin, or `null` when it is not available. |
| `subscribe(listener)` | Calls `listener(plugin, name)` when a service starts, stops, or calls `notify()`. Returns a cleanup function. |
A service name uses lowercase letters, digits, dots, and hyphens, and starts with a letter.
Each method call returns a promise. The host copies the arguments and the result with `structuredClone`. Use only data that this function can copy, not functions or DOM nodes.
When the provider stops, the host removes its services and notifies the subscribers. Calls through an old service object then fail. Call `get` again after a notification.
Make the data of a service a documented contract of the provider. Give its name, methods, and result shapes in the documentation of the provider plugin.
+270
View File
@@ -0,0 +1,270 @@
# Plugin host internals
[Development](development.md) · [Plugin development](plugin-development.md) · [Install and manage plugins](plugins.md)
This reference describes how RuneStone stores, installs, downloads, and removes plugins, for developers who change the plugin host.
- [Storage and recovery](#storage-and-recovery)
- [Gitea downloads](#gitea-downloads)
- [Content security policy](#content-security-policy)
- [Window capabilities](#window-capabilities)
- [Modules and checks](#modules-and-checks)
## Storage and recovery
The native plugin service is in `src-tauri/src/plugins.rs`. Its root is the Tauri `app_data_dir()`.
```text
<application-data>/
plugin-state.json catalog: manifest, hash, enabled state, install time, removal record
plugins/<plugin-id>/ installed packages
plugin-data/<plugin-id>/settings.json
plugin-staging/ review copies, update backups, and update-<uuid>.json journals
plugin-removals/<token>/ packages during confirmed removal
```
The preferences of the app are not plugin data. They are in `settings.json` in the Tauri `app_config_dir()`.
On Windows and macOS, this is the same folder as `app_data_dir()`. See [the settings file](development.md#the-settings-file).
**Settings → Plug-ins → Open plugins folder** opens `plugins/`.
The service writes `plugin-state.json` to a temporary file, then renames it. It reads at most 4 MiB from that file.
After each change, the service sends the `plugins-changed` event to all windows. A settings write sends `plugin-settings-changed` with the plugin ID.
The browser preview (`pnpm dev`) has no installed plugins unless a smoke test supplies a desktop mock.
The built-in browser and the theme editor use the plugin API, but they are not packages. `builtInModules` in `src/lib/plugins/external.ts` lists them. The host starts them in each window, and the plugin menus do not list their tools. A browser window starts only the browser.
`builtInPackages` lists the IDs of old packages for features that RuneStone now includes. The host never loads such a package. Settings → Plug-ins shows it as included with RuneStone, so that the user can remove it.
Native features, such as Git, Terminal, and Project Management, do not use the plugin API. `syncFeatures` in `external.ts` gives each feature that is on a feature session (`src/lib/features/session.ts`) under the ID of its old package, so that its views and document types share the tab model of plugin views. A view pattern in the catalog gives a feature many editor views, for example one for each board (`board-<hex>`). A tab transfer of such a view works before the feature loads. The file tree identifies the files of a feature document type, such as PDF files, without the feature code. A launch rule (`src/lib/features/launch.ts`) can start a feature at once: Background starts when a folder or an image is selected. Browser windows start only the features with a browser window rule, which is Background. See [Native features](development.md#native-features).
`features_legacy` (`src-tauri/src/features.rs`) reads the catalog row and the kept `plugin-data/<id>/settings.json` of an old package. It accepts only the IDs of native features and changes no file.
### Scans
Each window asks for a new snapshot at these times:
| Trigger | Source |
| --- | --- |
| Window start | `startExternalPlugins` in `src/lib/plugins/external.ts` |
| Window focus | The same function |
| **Refresh** in Settings → Plug-ins | `PluginManager.svelte` |
| `plugins-changed` event | Any change from another window |
There is no timed scan. A change from a file manager appears at the next focus or **Refresh**. RuneStone does not support packages that users copy into the folder.
A scan reads file metadata, and reads and hashes files only when necessary. It does not run code, install dependencies, or run scripts.
- A package with a changed hash gets an error and becomes disabled. The user must review it and enable it again.
- When a package folder is missing, the service removes its catalog entry. It never restores a missing package.
- A valid package that someone copies directly into `plugins/` appears as disabled, with an unknown install time.
- The service never scans `plugin-staging/`.
### Package hashes
The package hash is a SHA-256 hash of all file names and contents. To avoid a full read of each package at each scan, the service keeps a cache in memory:
| Step | Reads |
| --- | --- |
| Scan (`plugins_snapshot`), `plugins_data`, and the row checks of other commands | The metadata of the package folder: entry names, file sizes, and modification times. The service reads and hashes the files again only when this metadata changed. |
| Enable (`plugins_set_enabled`) and load (`plugins_load`) | All files. The hash must agree with the hash that the user saw (enable) or the installed hash (load). The cache cannot approve code. |
| Asset (`plugins_asset`) | The metadata, then the one file. The file must have the SHA-256 hash from the last full read. |
| Install, update, and removal | All files, as before. These steps also clear the cache entry of the package. |
The cache keeps the metadata from before each read. A file that changes during a read thus causes a new read at the next check.
An edit that keeps the file size and the modification time stays hidden from a scan. The next load or asset read finds it, and the plugin then becomes disabled at the next scan.
### Waits for other windows
An update and a removal disable the plugin, then wait until no window holds a lease, at most 10 seconds.
The wait uses a condition variable that `plugins_release` and window close signal. It does not keep the plugin lock while it waits.
### Install and update
1. The ZIP picker accepts at most 100 `.zip` files. Folders and loose manifests are not installation inputs.
2. For each ZIP, the service applies the [package contract](plugin-development.md#package-contract) and writes a review copy to `plugin-staging/<token>/`. It does not change the source file.
3. The review shows the name, author, version, description, source, and destination. For an update, it also shows the installed and new versions. Each review belongs to one window and expires after 30 minutes. Closing the window discards it.
4. At install, the service makes sure that the source and the review copy still have the reviewed hash.
5. The service saves the new catalog entry as disabled and moves the review copy into `plugins/<id>/`. Then it enables the plugin if the user chose **Install and enable**. A crash cannot enable a partial package.
A package with an installed ID starts an update:
1. The service disables the plugin and waits up to 10 seconds for every window to stop it.
2. It writes an `update-<uuid>.json` journal, moves the old package to a backup folder, and moves the new package into place.
3. It saves the catalog with the new hash and the previous enabled state. Settings in `plugin-data/` stay the same.
4. At startup, an uncommitted journal restores the old package, disabled. A committed journal deletes the backup.
Each package succeeds or fails independently. Cancel deletes the review copies.
### Removal
1. **Uninstall** makes a removal plan with a hash of the package folder. The plan belongs to one window and expires after 5 minutes.
2. Confirmation uses the plan token once. A changed package needs a new confirmation.
3. The service disables the plugin and waits up to 10 seconds for every window to finish cleanup. A cleanup failure blocks removal until RuneStone restarts.
4. The service saves a removal record with the SHA-256 hash of each file. Then it moves the folder to `plugin-removals/<token>/` and deletes it.
5. If deletion stops, Settings shows **Removal incomplete** and **Retry cleanup**. Retry deletes the folder only when every remaining file matches its recorded hash. Otherwise it stops and names the folder.
6. At startup, the service examines each removal record. If the package is still in `plugins/` and its removal folder does not exist, the service clears the record. The plugin stays disabled.
Removal keeps `plugin-data/`, source ZIPs, and workspace documents. Loaded JavaScript can stay in memory, so RuneStone asks for a restart.
The uninstall dialog puts focus on **Cancel**. Escape cancels.
### Runtime leases
`plugins_load` returns the entry module and records a lease for the window. `plugins_release` ends the lease and records any cleanup error.
Updates and removals wait for all leases to end. A recorded cleanup error blocks enable, update, and removal until RuneStone restarts.
Native services for plugins, such as the folder grant commands (`folders_*`), need a lease for the calling window.
## Gitea downloads
`src-tauri/src/plugin_sources.rs` gets a plugin ZIP from a Gitea release. It is separate from package checks and installation.
It does not clone the repository, compile code, install dependencies, or run scripts.
For the user procedure, see [Install from a Gitea link](plugins.md#install-from-a-gitea-link-experimental).
### Accepted links and releases
- The link is a repository root, `https://<host>/<owner>/<repository>`, with an optional `.git` or trailing slash. Gitea must run at the root of the host.
- Links with credentials, a query, or a fragment are invalid. SSH links and branch links are invalid.
- Without a tag, the service reads `/api/v1/repos/<owner>/<repository>/releases/latest`. Gitea excludes drafts and prereleases from this route.
- With a tag (at most 200 characters), it reads `/releases/tags/<tag>`. Use an explicit tag for a prerelease.
- The release must not be a draft. It must have exactly one `.zip` attachment. Automatic source archives are not attachments.
### Limits
| Limit | Value |
| --- | --- |
| Release metadata | 2 MiB |
| Plugin ZIP | 100 MiB |
| Redirects for each request | 5 |
| Total time for each request | 60 seconds |
| Connection time | 10 seconds |
The [package limits](plugin-development.md#paths-and-limits) also apply to the extracted files.
### HTTPS, HTTP, and credentials
- For an HTTPS repository link, the ZIP link must use HTTPS. The service refuses a redirect from HTTPS to HTTP.
- HTTP links work for trusted local servers. The form shows a warning that HTTP sends the token and the package without encryption.
- The service sends the token as `Authorization: token <value>`, only to the origin of the release API. Redirects to another origin do not get the token.
- The form clears the token after each request and when it closes. RuneStone does not save the token.
- A private repository needs a token with read access to the release metadata and the attachment.
### Review
The service writes the downloaded bytes to `plugin-staging/`, applies the same checks as a local ZIP, and deletes the archive.
The review shows the repository, the tag, and the attachment link without its query. It pins the downloaded hash.
A change to the remote release after review does not change the pending installation.
The same ID, enable, update, and removal rules apply to local and remote packages.
## Content security policy
`app.security.csp` in `src-tauri/tauri.conf.json` holds the policy. It limits what a page can load. It does not isolate plugins: a plugin module runs in the app window with the same access as the app.
The policy stops a script that comes in through rendered content, for example a `<script>` element or an event attribute in a Markdown document.
| Directive | Sources | Reason |
| --- | --- | --- |
| `default-src` | `'self'` | All other types come only from the app. |
| `script-src` | `'self' blob: 'wasm-unsafe-eval'` | `blob:`: plugin entry modules, which `external.ts` loads from Blob URLs. `'wasm-unsafe-eval'`: PDF.js in the PDF Viewer feature decodes JPEG 2000 and JBIG2 images and compiles PostScript functions with WebAssembly. Its worker is a file of the app and gets no policy, so this source applies only to PDF.js code on the page. It does not permit `eval`. |
| `style-src` | `'self' 'unsafe-inline'` | Svelte `style` attributes, the `style` attribute in `src/app.html`, Mermaid SVG styles, and the `<style>` elements of CodeMirror, xterm in the Terminal feature, the Vite dev server, and plugins (CSV Viewer). |
| `img-src` | `'self' data: blob: https: http:` | `data:`: workspace images, browser frames, tab and site icons, and icons in CSS. `blob:`: background images. `https:` and `http:`: remote images in Markdown previews. |
| `font-src` | `'self' data:` | `'self'`: fonts that the app serves. The app serves no font now. `data:`: PDF.js can load the embedded fonts of a PDF from data addresses. |
| `connect-src` | `'self' ipc: http://ipc.localhost blob:` | `ipc:` and `http://ipc.localhost`: Tauri commands. `blob:`: the blur worker of the Background feature reads its image from a Blob URL. |
| `worker-src` | `'self' blob:` | `'self'`: workers that the app serves, such as the PDF.js worker of each PDF tab. `blob:`: the blur worker of the Background feature. |
| `object-src` | `'none'` | RuneStone uses no plugins of the web view. |
| `base-uri` | `'self'` | |
| `form-action` | `'none'` | No form sends data to an address. |
| `frame-ancestors` | `'none'` | |
No source permits `'unsafe-eval'`. The app, CodeMirror, Mermaid, and the current plugins do not use `eval` or `new Function`.
`style-src` needs `'unsafe-inline'`, because style attributes and generated `<style>` elements have no nonce.
Tauri sends the policy as a header with each HTML page of the installed app. It adds the SHA-256 hash of the inline start script of SvelteKit to `script-src`.
`dangerousDisableAssetCspModification: ["style-src"]` stops Tauri from adding nonces to `style-src`, because a nonce disables `'unsafe-inline'`. Tauri still adds the script hashes.
`pnpm tauri dev` loads the page from the Vite server. Tauri does not apply the policy there. Use the [CSP mode](development.md#csp-mode) of the smoke tests, or an installed build.
Workers that the app loads from its own files get no policy. Workers from Blob URLs get the policy of the page.
## Window capabilities
`src-tauri/capabilities/` gives commands to window labels. A plugin can call every command that its window allows.
| Capability | Windows | Plugins | Commands |
| --- | --- | --- | --- |
| `default.json` | `main`, `workspace-*`, `terminal-*` | All enabled plugins | All app commands |
| `settings.json` | `settings-main`, `settings-workspace-*` | All enabled plugins | Settings, plugins, the Background folder, folder grants, completion, browser, `pty_profiles`, and `pty_running` |
| `browser.json` | `browser-*` | Only the built-in browser (`builtInModules` in `src/lib/plugins/external.ts`) | Browser, `plugins_snapshot`, settings, spelling, window controls, and the read commands of the Background folder (`background_folder`, `background_list`, `background_read`, `background_read_sidecar`) |
A browser window loads no installed plugin, so its capability has no workspace, file, Git, terminal, or plugin package commands. The Background feature runs there to show the background behind a blank tab, so the window can read the Background folder. `tests/unit/plugins/windowCapabilities.spec.ts` and `tests/smoke/browser/window.smoke.mjs` check this.
The other windows load every enabled plugin. A smaller command set for them would limit only the app code, not the plugins. That split belongs to the plugin isolation work. Findings for that work:
- Terminal windows use the `pty_*` commands of the Terminal feature, the plugin host commands, and `core:window:allow-destroy`. Other plugins in the same window expect the full host API.
- Settings windows use no `workspace_*` or `git_*` commands, but plugin settings views run there. Of the `pty_*` commands, they use only `pty_profiles` for Settings → Terminal and `pty_running` before Terminal goes off.
- Commands that need a workspace (`workspace_*`, `git_*`, `pty_open`, `pty_new_window`) fail in a window without a bound workspace.
- `pty_write`, `pty_resize`, and `pty_close` act only on the sessions of the calling window. A session of another window counts as a missing session.
- `pty_open` needs an output channel and a page ID. The first open of a new page in a window, after a reload, closes the sessions of the earlier page. The host refuses a late open from an old page.
- `folders_*` need a plugin lease of the calling window. The `background_*` commands of the Background feature need no lease. They take no path: the host keeps the folder that the folder dialog gave.
- `browser_request` needs the session token that `browser_connect` gives the window. A plugin lease does not replace it.
- A new command for plugins goes in `default.json` and, if settings views need it, in `settings.json`. Add it to `browser.json` only when the built-in browser needs it.
## Modules and checks
| Module | Owns |
| --- | --- |
| `src-tauri/src/plugins.rs` | Package checks, discovery, installation, updates, persistence, removal, leases, settings, and assets |
| `src-tauri/src/plugin_sources.rs` | Gitea link parsing and release downloads |
| `src-tauri/src/backgrounds.rs` | The image folder of the native Background feature. Plugins use folder grants |
| `src-tauri/src/folders.rs` | Folder grants for `api.files`: the picker, stored grants, listing, reads, and settings files beside the images |
| `src-tauri/src/pty.rs` | The shell sessions of the Terminal feature. Output goes as raw bytes through the channel of `pty_open`, in messages of up to 64 KiB or 8 ms. `pty_running` counts the sessions of all windows |
| `src/lib/plugins/sdk.ts` | The public package API types |
| `src/lib/plugins/externalSession.ts` | Activation, API checks, contributions, mounts, and shutdown |
| `src/lib/plugins/external.ts` | Native state sync, module loading, scans, views, tabs, and document types |
| `src/lib/plugins/registry.ts` / `contracts.ts` | Shared contributions and their types |
| `src/lib/plugins/access.ts` / `PluginAccessMenu.svelte` | The **Plug-in views** and **Commands** menus |
| `src/lib/plugins/PluginManager.svelte` | Settings → Plug-ins: review, switches, Gitea form, and uninstall dialog |
| `src/lib/plugins/PluginSettings.svelte` | Plugin configuration pages in Settings |
| `src/lib/plugins/PluginTools.svelte` / `PluginEditor.svelte` | Dialog views and editor views |
| `src/lib/plugins/backgrounds.ts` | The background frames of one window. The Background feature sets them, and Project Management reads the board targets. Plugins have no access. |
| `src/lib/plugins/nativeServices.ts` | The host side of `api.files`. It binds the plugin ID. The plugin never sends it |
| `src/lib/plugins/services.ts` | `api.services`: services that one plugin offers to another in the same window |
| `src/lib/completion/` | The [completion API](completion.md) |
| `scripts/packagePlugin.mjs` | The packager for plugin authors |
### Run the plugin checks
Run these commands from the RuneStone repository root.
For the general checks, see [Checks](development.md#checks). For the browser setup, see [Browser smoke tests](development.md#browser-smoke-tests).
Unit tests:
```powershell
node --experimental-strip-types --test tests/unit/plugins/plugins.spec.ts tests/unit/plugins/externalPlugins.spec.ts tests/unit/plugins/pluginPackaging.spec.ts tests/unit/plugins/pluginHostExtensions.spec.ts tests/unit/plugins/pluginDocuments.spec.ts tests/unit/plugins/pluginAccess.spec.ts tests/unit/plugins/completion.spec.ts tests/unit/plugins/windowCapabilities.spec.ts tests/unit/plugins/pluginNativeApis.spec.ts tests/unit/theme/backgrounds.spec.ts
```
Native tests use real temporary files and archives:
```powershell
cargo test --manifest-path src-tauri/Cargo.toml --lib plugin
```
Browser smoke tests mock desktop calls and use the real interface and module loader. Run them while `pnpm dev` runs:
```powershell
node tests/smoke/plugins/install.smoke.mjs
node tests/smoke/plugins/lifecycle.smoke.mjs
node tests/smoke/plugins/access.smoke.mjs
node tests/smoke/plugins/choiceMenus.smoke.mjs
node tests/smoke/find/pluginViews.smoke.mjs
node tests/smoke/tabs/lastTabAndSiteIcons.smoke.mjs
node tests/smoke/settings/general.smoke.mjs
node tests/smoke/browser/window.smoke.mjs
```
`pluginInstall.smoke.mjs` covers the link form, download errors, token clearing, cancel, focus, and disabled installation.
The native tests cover link parsing, release selection, redirects, credential boundaries, size limits, changed review copies, and invalid ZIPs.
Two native release tests are ignored by default:
| Test | Setup |
| --- | --- |
| `four_plugin_release_trial` | Set `RUNESTONE_GIT_TRIAL_PACKAGES` to a folder that contains exactly four plugin ZIPs. |
| `live_gitea_release_trial` | Set `RUNESTONE_GIT_TRIAL_URL`, `RUNESTONE_GIT_TRIAL_TAG`, and `RUNESTONE_GIT_TRIAL_ZIP` (the expected ZIP). Set `RUNESTONE_GIT_TRIAL_TOKEN` for a private repository. |
```powershell
cargo test --manifest-path src-tauri/Cargo.toml --lib four_plugin_release_trial -- --ignored --nocapture
```
+96
View File
@@ -0,0 +1,96 @@
# Install and manage plugins
[RuneStone](../README.md) · [User guide](user-guide.md)
This guide explains how to install, enable, update, and remove optional plugins.
Manage all plugins in **Settings → Plug-ins**. The built-in browser, table formulas, Git, Background, Terminal, PDF Viewer, and Project Management are not plugins. To turn Git, Background, Terminal, PDF Viewer, or Project Management off, see [Turn features on or off](user-guide.md#turn-features-on-or-off).
Plugins run with the full access of RuneStone, including your files. There is no permission sandbox, and the author field does not prove who published the plugin. Enable only code that you trust.
## Install a plugin
Get the release ZIP of the plugin, such as `runestone.csv-viewer-<version>.zip`. Do not extract it.
1. Open **Settings → Plug-ins**.
2. Choose **Install plugin ZIP**.
3. Select one or more ZIP files. You can select up to 100 at a time.
4. Review the name, author, version, source, and destination of each plugin.
5. Choose **Install and enable**, or choose **Install, keep disabled**.
RuneStone copies each plugin into its application data folder and keeps your ZIP unchanged.
The review and installation do not run plugin code.
Each package installs or fails separately. Read the result for each package.
## Enable or disable a plugin
Use the switch beside the plugin. The status shows **Enabled** or **Disabled**.
Your choice applies to all windows and stays after a restart. A new installation of RuneStone starts with all plugins disabled.
Disabling a plugin stops it and keeps its files, settings, and workspace documents.
If RuneStone asks for a restart, close all RuneStone windows and open the app again.
## Update a plugin
1. Get the new release ZIP of the plugin.
2. Open **Settings → Plug-ins** and choose **Install plugin ZIP**.
3. Select the ZIP.
4. Review the current and new versions.
5. Choose **Apply packages**.
RuneStone matches the update to the installed plugin by its ID. The update keeps the plugin settings and its enabled or disabled state.
RuneStone stops the plugin in every window before it replaces the files.
If the dialog contains an update, it shows only **Apply packages**. New plugins in the same selection install disabled.
## Uninstall a plugin
1. Open **Settings → Plug-ins**.
2. Choose **Uninstall** (the trash button) beside the plugin.
3. Read the plugin details and the deletion message.
4. Choose **Uninstall and delete files**.
RuneStone stops the plugin in every window, then deletes its installed folder.
It keeps your downloaded ZIP, the plugin settings, and your workspace documents.
If you install the plugin again, it can use the kept settings. You choose again whether to enable it.
**Cancel** changes nothing. **Disable instead** stops the plugin and keeps it installed.
## Install from a Gitea link (experimental)
Use this method when the publisher gives you a Gitea repository with a plugin ZIP attached to a release.
RuneStone downloads only the attached ZIP. It does not clone or build the repository. Other Git hosts, such as GitHub and GitLab, do not work.
1. Open **Settings → Plug-ins** and choose **Install from Git link**.
2. In **Repository link**, enter the repository root link, such as `https://git.example.com/owner/repository`.
3. In **Release tag**, enter a tag. Leave it empty to get the latest stable release.
4. For a private repository, enter a Gitea **Access token** with read access to the repository.
5. Choose **Review release**.
6. Review the package. Choose **Install and enable**, **Install, keep disabled**, or, for an installed plugin, **Apply packages**.
To install a prerelease, enter its tag. The release must have exactly one plugin ZIP attached. Source archives and branch links do not work.
Use HTTPS for a remote server. HTTP sends the token and the package without encryption.
RuneStone uses the token for this request only and does not save it.
## Plugin help
| Problem | Action |
| --- | --- |
| The ZIP fails review | Read the error. Get a complete release ZIP from the plugin author. |
| You have source code or a loose `plugin.json` | Get the release ZIP. You do not need to build a plugin. |
| The plugin is installed but does not work | Check its switch and any error message beside it. |
| The plugin files changed after you enabled it | Review the changed package, then enable the plugin again. |
| An update or uninstall reports a cleanup failure | Restart RuneStone, then do the action again. |
| The plugin shows **Removal incomplete** | Choose **Retry cleanup** to finish the removal. If the error names changed files, check that path first. |
| A Gitea release has no usable package | Check the release tag. Ask the publisher for a release with one attached plugin ZIP. |
| An old Browser plugin shows in the list | Uninstall it. The built-in browser keeps your profiles and bookmarks. |
| An old Git plugin shows in the list | Uninstall it. RuneStone includes Git, and the first start after the update kept the plugin state. See [Turn features on or off](user-guide.md#turn-features-on-or-off). |
| An old Background Slideshow plugin shows in the list | Uninstall it. RuneStone includes Background, and the first start after the update took the folder and the settings of the plugin. See [Show a background](guides/themes.md#show-a-background). |
| An old Terminal plugin shows in the list | RuneStone includes Terminal. The plugin stays inactive and shows **Included with RuneStone**. Uninstall it. The first start after the update kept the plugin state and its terminal settings. See the [Terminal guide](guides/terminal.md). |
| An old PDF Viewer plugin shows in the list | RuneStone includes PDF Viewer. The plugin stays inactive and shows **Included with RuneStone**. Uninstall it. The first start after the update kept the plugin state. See [Read PDF files](user-guide.md#read-pdf-files). |
| An old Project Management plugin shows in the list | RuneStone includes Project Management. The plugin stays inactive and shows **Included with RuneStone**. Uninstall it. The first start after the update kept the plugin state and its priority levels. Your boards in `.runestone/pm/` stay. If the workspace has boards in old visible notes, Project Management offers a migration. See [Move old Project Management notes](guides/project-management.md#move-old-project-management-notes). |
| An old Table Formulas plugin shows in the list | Uninstall it. RuneStone does not run it. Your formulas stay in your files. See [Calculate with table formulas](guides/document-tools.md#calculate-with-table-formulas). |
To see the installed files of a plugin, choose **Show files** beside it. **Open plugins folder** opens the folder for all plugins.
When you report a plugin problem, include the plugin name and version, the RuneStone version, and the error text.
To create a plugin, see the [plugin development reference](plugin-development.md).
+213
View File
@@ -0,0 +1,213 @@
# Release policy
[Builds](builds.md) · [Plugin development](plugin-development.md) · [Installation](installation.md)
This policy sets version numbers, release file storage, and publication steps for RuneStone and its plugins.
## Versions
RuneStone, the browser engine, and each plugin keep separate version numbers. Each project uses the form `zz.yy.xx`.
| Part | Increase it for | Then reset |
| --- | --- | --- |
| `xx` | Each new completed regular build. The number has no two-digit limit. | Nothing |
| `yy` | A deliberate release that is ready for build testing, by direction of the project owner | `xx` to zero |
| `zz` | A full release, by direction of the project owner | `yy` and `xx` to zero |
A build is a RuneStone installer, a browser engine ZIP, an SDK package, or a plugin ZIP, unless the project owner asks for a different distributable.
Development servers, test runs, and intermediate compilation output are not builds.
- Keep routine implementation work in the current `zz.yy` series.
- Keep the current version during source edits, fixes, improvements, documentation work, and automated checks.
- Do not change a version for an edit to agent instructions only.
- Set the next version when you produce the build. Keep all version fields of the project consistent.
- If no build completes, restore the previous version fields. Failed attempts and retries do not use a version number.
- Report a new version as available only after its build file exists.
- Publishing an existing build file does not change its version.
- Passing automated checks does not authorize a `yy` or `zz` increase.
| Project | Version fields |
| --- | --- |
| RuneStone | `package.json`, `src-tauri/tauri.conf.json`, the package version and `[package.metadata.runestone]` in `src-tauri/Cargo.toml`, and the `runestone` entry in `src-tauri/Cargo.lock` |
| Browser engine | `version` in `browser-runtime/package.json`, and the two `version` fields of `browser-runtime/package-lock.json` |
| Plugin | `plugin.json`, the project `package.json`, and any build metadata |
| Plugin SDK | `packages/plugin-sdk/package.json`. See [SDK releases](#sdk-releases). |
On Windows, `pnpm build:installer --version <version>` sets the RuneStone fields when the installer is complete. If the build fails, the fields keep the previous version.
See [Build the Windows installer](builds.md#build-the-windows-installer).
`pnpm build:browser-engine --release-url <folder URL> --version <version>` sets the engine fields and the pin in `src-tauri/browser-engine.json` when the ZIP is complete. If the build fails, they keep their previous contents.
See [Build the browser engine](builds.md#build-the-browser-engine).
## Hotfix versions
A hotfix fixes one item or a narrowly scoped problem in an existing release.
It keeps `zz.yy.xx` and adds or advances a lowercase letter suffix.
- Advance the suffix in this order: `a`, `b`, `c`, through `z`, then `aa`, `ab`, and later suffixes.
For example: `0.2.28` → `0.2.28a` → `0.2.28b`.
- The next regular build increases `xx` and removes the suffix: `0.2.28b` → `0.2.29`.
- Never use a numeric increment in place of a hotfix suffix.
Use the same literal hotfix version in `package.json`, `plugin.json`, build metadata, file names, release notes, and tags.
Example, from the file name rule in `scripts/packagePlugin.mjs`: the plugin `org.example.hello` at version `1.0.0a` produces `org.example.hello-1.0.0a.zip`, with the tag `v1.0.0a`.
If a package format rejects the suffix, add support for it or report the blocker before you build.
Do not bypass validation. Do not overwrite an existing release ZIP.
Older RuneStone hosts that accept only numeric plugin versions reject suffixed packages.
Some installer toolchains accept only numeric or SemVer versions.
For those fields, RuneStone uses a reversible encoding. See [Hotfix installer versions](builds.md#hotfix-installer-versions).
Visible version strings, release metadata, and file names keep the literal version.
## Release files
These rules apply to the main app, all existing plugins, and all new plugins.
| Release | Folder |
| --- | --- |
| RuneStone installer | `releases/<version>/` at the RuneStone project root |
| Browser engine ZIP | `releases/browser-engine/<version>/` at the RuneStone project root |
| SDK package | `releases/plugin-sdk/<version>/` at the RuneStone project root |
| Plugin ZIP | `releases/` at the root of that plugin project |
- Keep release notes, checksums, and build metadata with the release they describe, in the local release folder.
- Keep `releases/` out of Git.
- Use `dist/`, `build/`, `output/`, and toolchain folders only for compilation, staging, logs, and checks.
- After packaging, move the completed installer from the toolchain bundle folder into `releases/`.
Do not leave a second copy in the bundle folder.
- Never copy a plugin ZIP into the host project or into a different plugin project.
- Do not overwrite a release with different contents. Keep distinct versions and files with different contents.
- Remove a duplicate file only after its SHA-256 hash matches the file that you keep.
- Report a filename conflict before you change a file name.
- After each completed build, report the full path of the build file.
`pnpm build:installer`, `pnpm build:browser-engine`, `pnpm release:sdk`, and `pnpm package:plugin` obey these rules for their own output.
The installer, engine, and SDK scripts stop if the release file exists. The plugin packager reuses an identical ZIP and stops if the existing ZIP has different contents.
## Publish an installer
Publish RuneStone installers on the [RuneStone releases page](https://github.com/kwyvern-gh/RuneStone/releases). Browser engine ZIPs and SDK packages use the same page.
1. Build the installer and complete the [installer checks](builds.md#installer-checks).
2. Create a release with the tag `v<version>` on the commit that sets the version.
3. Attach only installer binaries.
4. Leave the release description empty.
5. Publish the release.
6. Put the installation checksums in `docs/checksums/<version>/`.
7. Link the checksums from the [installation guide](installation.md).
8. Update the download links in the README.
The empty description lets users reach the downloads directly.
Do not attach Markdown files, release notes, checksums, metadata, logs, or screenshots.
Put release notes, test results, and installation instructions in the repository documentation.
Keep the other build records in the local release folder.
## Publish a browser engine
Each host build downloads the URL in its pin, so the engine ZIP must download without a sign-in.
1. Build the engine ZIP with the URL of its release folder on the RuneStone releases page. See [Build the browser engine](builds.md#build-the-browser-engine).
2. Commit `src-tauri/browser-engine.json` and the engine version fields.
3. Create a release with the tag `browser-engine-v<version>` on that commit.
4. Attach only the engine ZIP. Leave the release description empty. The ZIP is about 164 MB, so the server must accept files of that size.
5. Make sure that the `url` in `engine.json` downloads the ZIP without a sign-in, and that its size matches.
6. Build the installer that pins this engine.
Keep each published engine ZIP. Installed RuneStone versions download the engine that they pin.
To move a published engine to a different location, upload the same ZIP there and change only the `url` in the pin. The size and the hash stay the same.
## Publish a plugin release
These rules apply on all hosting services. The service stores the files. RuneStone defines the package format, the versions, and the installation checks.
1. Build the ZIP with the procedure in [Build and package a plugin](plugin-development.md#build-and-package-a-plugin).
2. Install the ZIP in RuneStone. Test its features, the disable action, and removal.
3. Create a tag that identifies the source commit of that ZIP.
4. Attach the tested `<id>-<version>.zip` to a release for that tag.
5. Publish the release.
6. Download the published ZIP and test it in RuneStone.
Use `v<version>` for an ordinary release tag.
For a temporary prerelease, use a clearly named trial tag and mark the release as a prerelease.
Give users that explicit tag.
After publication, test these with the published ZIP:
- Download, review, installation in the disabled state, enable, disable, and removal
- Cancellation, which must leave no installed package
- An update of an installed plugin ID, which must keep its settings and enabled state
- The repository link with the explicit tag, if RuneStone can install from that service
Rules for the release:
- Publish one plugin ZIP for each release. Attach only that ZIP and leave the release description empty.
- The ZIP contains `plugin.json` at its root, the compiled entry module, and all required assets and dependencies.
See the [package contract](plugin-development.md#package-contract).
- Never use a repository source archive as the plugin package.
- Keep published release files unchanged. Moving an unchanged release to a different service needs no new package or version.
- Put release notes in the plugin repository documentation. Give the required RuneStone version, plugin version, changes, and known limits.
- Give users a link to the ZIP and to the [plugin installation guide](plugins.md).
- For a private release, users need permission to download the package.
| Service | How users install | Publisher notes |
| --- | --- | --- |
| Gitea | Download the ZIP, or use the experimental Gitea link installation | See the list below. |
| GitHub | Download the attached ZIP and install it in **Settings → Plug-ins** | Automatic source archives do not replace the attached ZIP. Installation from a GitHub link needs a download adapter and tests. That work is in the future. |
| GitLab and other services | Download the ZIP and install it in **Settings → Plug-ins** | RuneStone has no repository-link adapter for these services. |
Gitea link installation needs these conditions:
- The link is the repository root, with an optional trailing `.git`.
- The Gitea server runs at the host root.
- The release has exactly one attached `.zip` file. Automatic source archives do not count.
- The latest-release route skips drafts and prereleases. Use an explicit tag for a prerelease trial.
- For a private repository, the user needs read access to the release metadata and the attachment.
- The server uses HTTPS. HTTP sends the token and the package without encryption.
For download limits, credential handling, and redirects, see [Gitea downloads](plugin-host.md#gitea-downloads).
For GitHub publication steps, see [GitHub's release instructions](https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository).
## SDK releases
The plugin SDK `@runestone/plugin-sdk` has its own version, in `packages/plugin-sdk/package.json`.
The [version rules](#versions) and the [hotfix rules](#hotfix-versions) apply.
An SDK release is one package file, `runestone-plugin-sdk-<version>.tgz`, on the RuneStone releases page with the tag `plugin-sdk-v<version>`.
Plugin authors install the SDK from the URL of that file. See [Install the SDK](plugin-development.md#install-the-sdk).
`pnpm sdk:build` output in `packages/plugin-sdk/dist/` is compilation output, not a release.
### Release the SDK
1. Commit the SDK changes in RuneStone. Run `pnpm check` and `pnpm test`.
2. Run `pnpm release:sdk --release-url <folder URL> --version <version> --dry-run`. Read the plan.
The folder URL is the download folder of the release, for example `https://github.com/kwyvern-gh/RuneStone/releases/download/plugin-sdk-v0.1.2`.
3. Run the same command without `--dry-run`.
4. On the RuneStone releases page, create a release with the tag `plugin-sdk-v<version>` on the `source` commit in `sdk.json`.
5. Attach only the `.tgz` file. Leave the release description empty.
6. Make sure that the `url` in `sdk.json` downloads the file without a sign-in, and that its SHA-256 matches.
7. Commit the new version in `packages/plugin-sdk/package.json`.
The script builds the SDK and writes two files in `releases/plugin-sdk/<version>/`:
| File | Contents |
| --- | --- |
| `runestone-plugin-sdk-<version>.tgz` | The package: `dist/`, `package.json`, `README.md`, `LICENSE`, and `NOTICE`, in a `package/` folder |
| `sdk.json` | The URL, the size, the SHA-256, the npm integrity value, and the source commit |
The package files have a fixed time and mode, so the same files give the same package bytes.
The new version goes into `packages/plugin-sdk/package.json` only after both files exist.
If a step fails, the script restores that version field and removes the files of that attempt.
The script stops before it changes a file in these conditions:
| Condition | Action |
| --- | --- |
| The version is not greater than the version in `packages/plugin-sdk/package.json` | Give a greater version. |
| `packages/plugin-sdk/` has no `LICENSE` or `README.md` file | Add the file. The SDK uses the Apache License 2.0. |
| `packages/plugin-sdk/` has changes that are not committed | Commit them, so that the release has a source commit. |
| The release URL is not HTTPS, or it has credentials, a query, or a fragment | Give the plain HTTPS URL of the release folder. |
| A file exists in `releases/plugin-sdk/<version>/` | Give a new version. Never replace a published package. |
Keep each published SDK package unchanged. A plugin lock file records the integrity value of the package, so a different file at the same URL stops its installation.
To move the SDK to another service, upload the same files there. Plugin authors then change only the URL.
+110
View File
@@ -0,0 +1,110 @@
# Functional color
[Interface design](ui-design.md) · [Design decisions](design-decisions.md)
This guide sets the color rules for RuneStone and its plugins, for human developers and agents.
Agents also apply the user-level `ui-functional-color` skill. This guide adds the project roles, references, thresholds, and evidence.
## Default
- Start accents, priority, status, selection outlines, syntax, and important data with vivid, distinct candidates. Full saturation and full HSV value are normal options.
- Pick the stronger candidate when readability, meaning, and distinction stay correct.
- Do not soften a color only to look quiet, refined, professional, premium, minimal, or cohesive. A softer choice needs a concrete reason and before-and-after evidence.
- A quiet layout comes from spacing, hierarchy, and the amount of color on screen. It does not need a faded palette.
- Existing muted values are not an approved soft design.
- Keep informative text and symbols opaque.
## Roles and tokens
A theme is data. Each built-in theme is one file in `src/lib/theme/themes/`, with one palette for each mode that it offers.
`src/lib/theme/roles.ts` lists the color roles. Each role is the CSS token `--rs-<role>`.
A theme gives the base roles. One rule for all themes fills each other role from the base roles, unless the theme gives a value.
No code outside the theme data names a theme ID. `tests/unit/theme/contrast.spec.ts` checks this.
Correct a wrong color in the theme data or in the derivation rule. Do not add local saturation or opacity overrides.
| Role | Tokens | Requirement |
| --- | --- | --- |
| Theme identity | `--rs-accent`, `--rs-accent-2` | Keep the characteristic hues of the reference at their strength. |
| Status | `--rs-error`, `--rs-warn`, `--rs-warn-hot`, `--rs-ok` | Use clear, assertive colors. Pair color with a shape or text. |
| Priority (Project Management) | `--pm-priority-color` in `src/lib/features/pm/ui/style.css` | Full saturation and value, with opaque symbols and readable text. |
| Links and actions | `--rs-link` (from `--rs-accent` unless the theme sets it) | Keep actionable text distinct and readable on its actual surface. |
| Text on an accent fill | `--rs-on-accent` (black or white, whichever is more readable) | Readable text and icons on accent buttons and badges. |
| Focus | `--rs-focus` (from `--rs-accent` unless the theme sets it) | A visible outline on every surface. |
| Selection | `--rs-item-selection-*`, `--rs-selection`, `--rs-selection-text` | Show a clear state change and boundary. Content inside the selection stays readable. |
| Highlighted text | `--rs-highlight` | A fill that keeps the text readable. |
| Syntax | `--rs-syntax-*`, one for each role in `SYNTAX_ROLES` | Give each meaning a distinct color. A palette has at least 7 distinct syntax colors. |
| Terminal | `--rs-ansi-*` and `--rs-ansi-bright-*`, one for each color in `ANSI_COLORS` | Each color keeps its ANSI hue in every theme. Blue stays blue, also in a red theme. |
| Surfaces and dividers | `--rs-bg`, `--rs-bg-elevated`, `--rs-bg-active`, `--rs-border`, `--rs-line-highlight`, `--rs-scrim`, `--rs-image-*` tints | Support the content. Choose their strength by function. |
| Disabled states | Role tokens of the control | Keep labels readable. Do not apply disabled opacity to enabled content. |
The Terminal feature uses these tokens directly (`src/lib/features/terminal/theme.ts`). Text is `--rs-text`, the cursor is `--rs-accent` on `--rs-bg`, and the selection is `--rs-selection` with at most 65% alpha. The 16 ANSI colors are the `--rs-ansi-*` tokens. The terminal reads them again after each theme change.
Do not fade a whole badge, row, or container when only its background needs transparency.
Plugins use the same tokens. [Theme tokens](plugin-development.md#theme-tokens) lists them for plugin authors.
## Theme references
- Read the current reference cards, and obey the source priority that the user gives.
- RuneStone takes its accent from the rune glow of the app icon (`src-tauri/icons/icon.png`). Claude takes its colors from the Anthropic brand guide. Sakura takes its colors from the palette image in its data file.
- A text role keeps the hue of its reference color. Change only its lightness until it reaches the readability minimum, and call the result an adaptation.
- Harvest Moon (Holo) uses the current fan art. Removed images do not count for later palette decisions.
- Crimson Pilot (Asuka) and Silver Serpent (Malfoid) use their reference cards. For Malfoid, the books win over fan art, so the eyes are grey.
- A character color goes to the accents, the selection, and the syntax roles. Surfaces and borders get low-chroma tints of the character, so status colors stay visible.
- Take the colors of the character. Exclude scenery, lighting, alternate clothing, and unrelated details.
- The trading screenshot and the Bloomberg example show clear information and state distinctions. They do not ask for a terminal-like appearance.
## Known failures
The October 13 review found these problems. The values record that correction. They are not quotas for future themes.
| Palette | Problem | Correction |
| --- | --- | --- |
| Harvest Moon (Holo) | Marsh green and pink roles did not match the identity. | Warm copper, chestnut, amber, and red |
| Crimson Pilot (Asuka) | Repeated green and similar cyan roles | Red, orange, yellow, and blue carry distinct meanings. |
| Silver Serpent (Malfoid) | Sage accent and near-gray syntax | Emerald accent, saturation from about 29% to 76% |
| Priority marks | Too dark to draw attention | Full saturation and value, with readable text |
The [October 13 menu and color review](archive/menu-audit-2026-10-13.md) holds the measurements and the image-surface limits.
## Readability rules
`src/lib/theme/contrast.ts` holds these rules. `tests/unit/theme/contrast.spec.ts` applies them to every built-in palette. The theme editor can show the same results.
Each surface is the color that the app draws: a translucent role is composited onto `bg`. Text selection is at most 65% opaque.
| Rule | Check | Minimum |
| --- | --- | --- |
| `text` | `text`, `text-dim`, and `text-strong` on `bg`, `bg-elevated`, `bg-active`, `selection`, and the item selection fill over `bg-elevated` | 4.5:1 |
| `accent-text` | `accent`, `accent-2`, and `link` on `bg`, `bg-elevated`, and `bg-active` | 4.5:1 |
| `status-text` | `error`, `warn`, and `ok` on `bg` and `bg-elevated` | 4.5:1 |
| `syntax` | Each syntax role on `bg`, `bg-active`, `line-highlight`, and the item selection fill over `bg` (search and selection matches in Source) | 4.5:1 |
| `ansi` | Red, green, yellow, blue, magenta, and cyan terminal colors, and their bright variants, on `bg` | 4.5:1 |
| `focus` | `focus` on `bg`, `bg-elevated`, and `bg-active` | 3:1 |
| `on-accent` | `on-accent` on `accent` | 4.5:1 |
| `highlight` | `text` on highlighted text | 4.5:1 |
| `selection-outline` | `accent` on the item selection fill over `bg-elevated` | 3:1 |
| `status-distinct` | OKLab distance between `accent`, `error`, `warn`, and `ok`, in pairs | 0.1 |
| `syntax-variety` | Distinct syntax colors | 7 |
| `light-page` | In a light palette, `bg` is lighter than `bg-elevated` and `bg-active` | — |
`accent` on `selection` is exempt from the 4.5:1 text check. Run the tests with `pnpm test`.
Every built-in palette passes every rule. A palette that fails a rule fails the test.
`tests/unit/theme/characterPalettes.spec.ts` adds the checks of each character palette, for example over image tints. It measures text selection as the app draws it: at most 65% opaque over the page.
Over a user image, contrast depends on the composite surface. Measure the 82% and 90% tints over the image that the change uses. Do not claim contrast over every possible image or overlay.
When contrast fails, change the foreground, background, surface, or role before you reduce color strength.
## Evidence for review
Record the evidence that the `ui-functional-color` skill lists for each changed role. For RuneStone, also record:
- The shared token and the affected controls.
- Each named palette and appearance that uses the token.
- Contrast on the actual composite surface, including image tints, overlays, and selected states.
- Screenshots at normal scale of the content, code, menus, and priority marks where the token appears.
- For a softer choice, the stronger candidate and the requirement or measured problem that rejected it.
- Checks that you could not run. Browser mocks do not replace native desktop checks.
Correct unexplained muting, or record it as unresolved, before the work moves to Review.
A deliberate departure needs an exception entry in the [design decision log](design-decisions.md). The entry alone does not authorize it.
Decision: [UI-024](design-decisions.md#ui-024--assertive-functional-color-by-default).
+355
View File
@@ -0,0 +1,355 @@
# Interface design
[Development](development.md) · [Functional color](ui-color.md) · [Design decisions](design-decisions.md)
This guide holds the interface rules for RuneStone and its plugins.
## Design principles
- Keep attention on the user's work. Use quiet structure for the active view. Keep strong color for theme identity, status, and actions that need attention.
- Show only what the current task needs. Keep optional forms hidden until the user chooses an add action.
- Let users collapse sections and hide panes. A collapsed section keeps its name, count, and expand control. Do not remove its data or hide errors that need attention.
- Show each board and view name once. Do not repeat view names, instructions, or descriptions when the visible content explains the view.
- Keep switching, renaming, and adding as separate controls with clear targets.
- Tabs can join visually with their content area. A selected view does not need a bright border or a repeated heading.
- Use familiar icons and visual previews to explain choices. Use a preview for visual choices such as themes and table styles.
- These principles apply to shared components and plugin interfaces. In a review, examine the user's work area first. Controls must support that work and not compete with it.
## Shared components and tokens
Before you add a control, find its shared component and an existing example. Extend the shared component when the change helps other callers.
When a control differs from its peers, examine local style overrides. Correct the shared component or token that causes the problem.
Do not copy feature-specific colors into a shared control.
| Need | Use |
| --- | --- |
| Icon button | `src/lib/ui/IconButton.svelte` (28-pixel target, accessible name, tooltip) |
| Icons | `src/lib/ui/Icon.svelte` and `src/lib/ui/actionIcons.ts` (one 24-pixel grid and stroke weight) |
| Tooltip on a DOM control | `attachTooltip` in `src/lib/ui/tooltip.ts` |
| Action menu | `src/lib/ui/actionMenu.ts`. Svelte callers can use `src/lib/layout/ContextMenu.svelte`. |
| Menu with dismissal and focus return | `showActionMenu` in `src/lib/ui/managedActionMenu.ts`. Editor surfaces give their own focus return. Plugins call it as `api.ui.showActionMenu`. |
| Undo, Redo, clipboard, and search rows | `src/lib/ui/menuItems.ts` |
| Menu and picker presentation | `src/lib/ui/menu.css` |
| Find | `src/lib/editor/FindPanel.svelte` and `src/lib/ui/find.css`. Write and Source search with `editorSearch.ts`. Read and plugin views search with `readingSearch.ts`. |
| Dimensions and fixed colors | `src/lib/theme/tokens.css` |
| Theme colors | The roles in `src/lib/theme/roles.ts` and the theme data in `src/lib/theme/themes/`. See [Functional color](ui-color.md#roles-and-tokens). |
| Token | Default | Use |
| --- | --- | --- |
| `--rs-titlebar-height` | 36px | Custom window headers in the main window and Settings |
| `--rs-control-radius` | 5px | Controls, menu rows, and navigation highlights |
| `--rs-item-selection-radius` | `--rs-control-radius` | Selection outlines |
| `--rs-item-selection-bg`, `--rs-item-selection-border`, `--rs-item-selection-width` | per theme | Selection fill, border color, and border width |
| `--rs-settings-row-padding` | 10px | Settings rows |
| `--rs-settings-control-height` | 28px | Settings controls |
| `--rs-settings-heading-size` | 18px | Settings headings |
| `--rs-settings-description-size` | 12px | Settings descriptions and picker hints |
| `--rs-settings-gap` / `--rs-settings-section-gap` | 8px / 16px | Settings spacing |
| `--rs-menu-width` | 248px | Standard menu width |
| `--rs-menu-padding` | 5px | Inset around menu rows |
| `--rs-menu-row-height` | 24px | Minimum row height |
| `--rs-menu-row-padding` | 2px 10px | Row padding |
| `--rs-menu-font-size` | 13px | Menu text |
| `--rs-menu-icon-size` / `--rs-menu-icon-gap` | 14px / 8px | Menu icon and its gap to the label |
| `--rs-menu-border` | `transparent` | Borderless panel. `--rs-menu-shadow` supplies the edge. |
| `--rs-menu-bg`, `--rs-menu-active-bg` | `--rs-bg-elevated`, `--rs-bg-active` | Opaque menu surface and hover or focus fill. With a background image: the surface tint and the `--rs-hover-bg` veil. |
| `--rs-hover-bg` | `--rs-bg-active` | Hover fill of rows and controls in the work area, and the fill of the workspace button. With a background image: a 6% veil of `--rs-text-strong`. |
| `--rs-menu-backdrop` | `none` | With a background image: `blur(18px) saturate(1.2)` |
| `--rs-surface-opacity` | 82% | Shared surface tint. Appearance settings adjust it. |
## Icons and labels
- Use a recognizable icon for actions, navigation, menus, and settings categories. Icons help users who do not rely on English words, and they save space.
- Add a short visible label when an icon has more than one likely meaning. Keep labels that help users learn or tell functions apart.
- Use icon-only controls for familiar actions in compact spaces, such as toolbars. Do not add a caption to one familiar toolbar action while its peers use icons.
- Every icon control needs an accessible name, a tooltip on hover and keyboard focus, and a comfortable target.
- Reuse the existing icon artwork. Use the same icon for the same function everywhere, with consistent size and stroke weight.
- Do not force an icon onto a setting, label, or explanation without a clear visual equivalent. Use text alone, and omit decoration that does not help understanding.
- Recognition and accessibility come before fitting more controls on screen.
## Controls, corners, and focus
- Controls, menu rows, and navigation highlights use `--rs-control-radius`. This includes hover, active, and selected states.
- Keep readable labels, visible focus indicators, and comfortable click targets in compact layouts. A target is at least 24 by 24 pixels.
- Keyboard focus shows a 2-pixel `--rs-focus` ring outside the control. Menu rows draw the ring inside the row. Hover never shows the ring.
- Hover gets a neutral fill. An active toggle also gets the accent color, the selection fill, and a 2-pixel accent bar, so it differs from hover.
- A disabled control uses `--rs-text-dim` at full opacity. Do not fade a control with opacity.
- A composite widget, such as the file tree, has one Tab stop. The arrow keys move inside it.
- A splitter takes keyboard focus. The arrow keys move it by 16 pixels, and Home and End go to its limits.
- Native form controls, such as checkboxes, take their accent from `--rs-accent`, not the browser default ([UI-030](design-decisions.md#ui-030--settings-installation-checkbox-theme-drift)).
- Document tables are the exception. Keep their grid, cells, and cell selection outlines square. Table toolbars and table menus stay rounded.
## Selection
These rules apply to navigation rows, file and folder trees, lists, grids, and table cells.
- Use the `--rs-item-selection-*` tokens for fill, border color, border width, and radius. Table-cell selection is the reference for fill and outline.
- Adjacent selected items form one region with a continuous fill. Outline only its exposed perimeter. Do not draw borders or rounded gaps on shared internal edges.
- Round the exposed corners of a region, except in document tables.
- A single selected item gets a complete outline. Groups that unselected items or physical gaps divide keep separate outlines.
- Find adjacency from the visible order, including sorting and expanded tree branches. At an indentation change, keep the exposed edges and omit the parts that selected rows share.
- Ordinary table grid lines can stay inside a region. They must not become highlighted selection borders.
- A menu choice and a file selection have different purposes. File selections use the selection fill and outer outline. Hover uses the shared active background on both.
## Menus and pickers
Use one menu design for context menus, action menus, and their submenus in the host and in plugins.
### Renderer and presentation
- Build every action menu with `actionMenu.ts`. Do not create a separate menu renderer. Do not add local style overrides for a feature.
- Use the `--rs-menu-*` tokens and `--rs-control-radius`. One menu family shares font, row height, padding, icon size, label alignment, separators, and shadow.
- A menu can grow wider when its content needs more space. All other measurements stay shared.
- Keep the padding inset around every row, so hover and focus fills do not touch the panel edge.
- The panel is borderless, with a shadow. Its surface is opaque through `--rs-menu-bg` and `--rs-menu-active-bg`. Only with a background image, it uses the surface tint (82% by default) and blurs the image, and a hovered row gets the veil of `--rs-hover-bg`. Host menus, plugin menus, submenus, and the workspace picker all use this surface.
- Submenus show as popovers in the top layer, so the blur of the parent menu cannot clip them.
- Plugins call `api.ui.showActionMenu` for the host menu, when the host API exists. The host handles dismissal, focus return, and plugin cleanup.
### Rows and columns
- Give a recognizable action an icon and a short label. Use the same icon for the same function in every menu.
- A menu with only text choices omits the icon column. A mixed menu reserves the icon column on every row.
- Shortcut text and submenu arrows use separate trailing columns.
- A common text action has the same label, icon, and shortcut in every menu. Build Undo, Redo, the clipboard rows, and the search row with `menuItems.ts`.
- One function has one icon: `copy` puts content on the clipboard, `duplicate` makes a second file or row, `template` marks template actions, and `tab` opens in a new tab. The action that shows a file in the file manager takes its label from `revealLabel()`.
- A file menu follows one order: open, clipboard, organize, show and copy path, history, then Delete. Delete and Delete permanently use `danger`, which gives them the error color.
- Write shortcut labels with `src/lib/ui/shortcuts.ts`: `keys("Mod+Shift+P")` gives Ctrl+Shift+P on Windows and Linux and ⇧⌘P on macOS. A workbench command takes its label from `commandShortcut()` in `workbenchKeys.ts`. Do not write "Ctrl" in interface text or in the catalog. Use a placeholder.
- Use inset separators between related groups.
- Enabled rows share one hover fill. Keyboard focus adds a 2-pixel ring inside the row.
- Disabled rows stay readable: dim text at full opacity. Keyboard navigation skips them, and they do not run.
- Radio choices mark the current option with a check mark in the icon column, and no fill. The current enabled radio choice gets focus when the menu opens.
- A row can have a default action and a submenu. A click on the label, Enter, or Space runs the default action. Hover, the submenu arrow, or Right opens the submenu.
### Keyboard and viewport
- Support the arrow keys, Home, End, Enter, Space, and Escape.
- Right opens a submenu. Left returns to its parent.
- Dismissal with the keyboard restores focus to the trigger.
- Keep menus inside the viewport. Long menus scroll inside their panel.
### Choice lists and pickers
- Use the shared action menu for short option lists, such as board, list, appearance, and language choices.
- Visual choices, such as themes, use preview cards. The cards are one radio group, and a check mark marks the current choice.
- Use a searchable picker for long lists.
- Replace native selects with the shared action menu wherever the host API exists. Native selects stay only as documented fallbacks for older plugin hosts.
- Rich pickers and dialogs can have their own layout when they contain search fields, descriptions, or forms. These layouts do not need an exception entry.
- Picker panels and result rows still use the shared menu presentation: `rs-picker`, `rs-picker-row`, `rs-picker-icon`, and `rs-picker-hint` from `menu.css`. Do not use the layout allowance to change panel color, row padding, font, or focus states.
- Embedded website controls keep the website design.
### Specific menus
- In the main editing menu, spelling corrections come first. Add to dictionary follows them, before the ordinary editing actions.
- Native editing menus keep recognized editing, spelling, and emoji commands. The host removes system sharing, writing direction, dictation, and unnamed tools before shared display or native fallback.
- New note creates a blank note. Its submenu contains templates and Manage templates.
Decisions: [UI-002](design-decisions.md#ui-002--share-the-requested-dropdown-design), [UI-003](design-decisions.md#ui-003--quiet-menu-choices), [UI-006](design-decisions.md#ui-006--borderless-shared-menus), [UI-007](design-decisions.md#ui-007--repeated-menu-drift), [UI-008](design-decisions.md#ui-008--keep-native-editing-menus-focused), [UI-026](design-decisions.md#ui-026--compact-shared-menu-rows), [UI-027](design-decisions.md#ui-027--direct-spelling-corrections), [UI-043](design-decisions.md#ui-043--opaque-menus), [UI-061](design-decisions.md#ui-061--translucent-menus-and-hover-fills-over-images).
## Window and navigation
- The main header holds navigation, document tabs, Save, the outline toggle, and window controls. The other tools are in the left ribbon, so the tabs keep their room. A detached tab window has no ribbon, so its header keeps those tools.
- A bar at the bottom of the side pane holds the workspace switcher, Help, and Settings, as in Obsidian. The switcher names the workspace and opens the workspace list above it.
- The left ribbon is always present. It holds the tools, then a line, then the plugin view shortcuts. The tools are New browser tab, Terminal, Project Management, Plug-in views, and Commands. A tool of an off feature does not show. Its menus open at its right. While the side pane is closed, the workspace switcher, Help, and Settings move to the bottom of the ribbon, so they stay reachable.
- Tabs keep a minimum width of 120 pixels and scroll. Fades show tabs out of view, and ⌄ lists all tabs. A drag area of 120 pixels sits after the tabs. In a narrow header, the tabs shrink first, and the drag area keeps at least 48 pixels.
- Windows and Linux title bars use square caption buttons, 46 pixels wide and full height. Rest the pointer on maximize for Snap Layouts on Windows 11. macOS keeps its native traffic lights, and title bars leave `--rs-titlebar-inset-start` free for them.
- Files, Search, Bookmarks, Source control (while Git is on), and the sidebar views of installed plugins share the top navigation group. The active navigation button shows which view fills the left pane.
- Plugin editor views can use the left ribbon.
- The built-in browser and Project Management open from their own ribbon buttons. The Project Management button is active while a board tab or All tasks is the active tab. Plug-in views lists only plugin views. Keep Plug-in views in the ribbon, away from the new-tab button.
- Document and plugin tabs share the tab bar. The new-tab button follows the tabs. Tabs keep their order and pin state when a plugin replaces its view.
- The main window keeps an empty New tab after its last tab closes. A secondary window closes with its last tab. The unsaved-edit and active-terminal confirmations still apply, and Cancel keeps the tab open.
- Sidebar widths and visibility persist across window sessions. A different editor does not restore a hidden outline.
- Side panes give way when the window becomes narrow: the outline below 1100 pixels, and the side pane below 800 pixels. They come back when the window grows again. A pane that the user opens in a narrow window stays open, and the saved layout keeps the choice of a wide window.
- A detached tab window holds the tab work area and window controls only. It has no side panes, plugin ribbon, or pane switches, and it does not change the main window layout.
Decisions: [UI-004](design-decisions.md#ui-004--detached-tab-work-area), [UI-039](design-decisions.md#ui-039--close-secondary-windows-after-the-last-tab).
## Settings
- Follow the Obsidian settings pattern. Navigation pairs icons with labels. Each page uses readable text and ordinary controls.
- Use the `--rs-settings-*` tokens for spacing, control height, headings, and descriptions.
- Every boolean setting uses the one switch design: `<input type="checkbox" role="switch" class="rs-switch">` (`src/lib/ui/switch.css`).
- Settings apply at once: a switch or a choice on change, and a text field when it loses focus. No page has a Save button.
- The Settings window opens with the focus on its search field.
- Put related plugin metadata and actions in compact rows.
- Controls wrap at narrow widths, and the content area scrolls. Long navigation must leave room for the selected page.
- General offers the interface language through the shared action menu.
- **Features** lists each native feature in one card: its name, one line of description, and a switch. The page sits between Appearance and Plug-ins, and the `toggle` icon marks it. A failed load shows its cause under the switch in the error color.
- A feature that is off shows no controls: no navigation button, ribbon button, command, or tab. A settings section of an off feature shows one line that names Settings → Features.
- **Terminal** is a Settings page with the `terminal` icon, after Plug-ins and Browser. It shows only while Terminal is on. **Terminal settings** in the profile menu of the terminal panel opens it. No dialog of the panel holds terminal settings.
- **Project Management** is a Settings page with the `kanban` icon, after Terminal. It shows only while Project Management is on. It holds **Priority levels** and **Default board**, with pickers on the shared action menu. **More actions** → **Project Management settings** on a board shows the same component in a popup.
- The transparency slider covers 0% to 100% and uses the accent and surface tokens of the current theme.
- Appearance shows a preview card for each theme. The arrow keys move between the cards and select a theme. The current card has the selection outline and a check mark.
- **Edit theme** opens the theme editor as a workbench tab in the window that opened Settings. The editor shows every color role in groups, with a swatch, a hex field, the lowest contrast result, and a reset button. Each change shows at once in that window. Save writes a short schema 3 theme with a base.
- Custom theme files use schema 3: one `mode`, an optional built-in `base` theme, the `colors` that differ from the base, and `fonts` stacks for interface, prose, headings, and code. The export writes every color and font. Schema 1 and 2 imports convert to schema 3. A schema 1 import selects the palette of the current appearance.
Decisions: [UI-028](design-decisions.md#ui-028--adjustable-surface-transparency-and-fixed-custom-palettes), [UI-042](design-decisions.md#ui-042--theme-file-format-3-and-terminal-colors), [UI-047](design-decisions.md#ui-047--theme-editor-tab-and-theme-cards), [UI-055](design-decisions.md#ui-055--settings--features-and-native-git), [UI-057](design-decisions.md#ui-057--background-replaces-background-image-and-background-slideshow), [UI-058](design-decisions.md#ui-058--settings--terminal-and-theme-colors-in-the-terminal), [UI-060](design-decisions.md#ui-060--native-project-management).
## Typography and tables
- The interface uses `--rs-font-ui`. Prose uses `--rs-font-prose`. Headings use `--rs-font-heading`.
- Source and Terminal share `--rs-font-mono` and `--rs-code-font-weight` (default 300). The monospace stack starts with Cascadia Mono, then Cascadia Code, JetBrains Mono, Fira Code, and Consolas. Terminal font size is a separate setting in Settings → Terminal.
- Document headings use space between sections, not separator lines. Heading fold controls use the shared chevron and take keyboard focus.
- Tables use shared cell padding and line height. Entering a cell does not change its row height.
- A table row needs an unescaped pipe. Write and Read use the same row rule. A paragraph after a table stays a paragraph when the separator line is removed.
- A table link shows its Markdown source when the caret enters it. The caret stays at the chosen label character. Edit link selects the full target inside the cell. Test ordinary clicks and keyboard entry before menu actions ([UI-025](design-decisions.md#ui-025--table-links-hide-their-source-after-repeated-fixes)).
Decisions: [UI-005](design-decisions.md#ui-005--heading-spacing).
## Themes and background images
Background images come from the native Background feature (`src/lib/features/background/`). Appearance → Background holds its settings: the source (a folder, one image, or none), the layout, the per-image editor, and the targets.
### Palettes
- Color choices obey [Functional color](ui-color.md).
- In a light palette, the page is the lightest surface. The side panes have a slight tint.
- RuneStone uses neutral surfaces. The rune cyan of the app icon is its accent.
- The Claude palette follows the [Anthropic brand guide](https://github.com/anthropics/skills/blob/main/skills/brand-guidelines/SKILL.md): warm light and dark surfaces, an orange accent, Lora body text, and Poppins headings, with their fallbacks. In light mode, text uses a darker orange, because the brand orange is not readable on the light grays.
- Named palettes have one fixed appearance. Each local font stack has fallbacks. Code keeps the shared monospace stack.
| Palette | Appearance | Controls | Prose | Headings |
| --- | --- | --- | --- | --- |
| Harvest Moon | Dark | Candara | Constantia | Constantia |
| Crimson Pilot | Dark | Bahnschrift | Segoe UI | Bahnschrift |
| Silver Serpent | Dark | Corbel | Palatino Linotype | Palatino Linotype |
- A saved choice for a removed palette returns to RuneStone and keeps its mode and background settings. A renamed palette keeps its colors and backgrounds.
- The theme preview includes code colors.
Decisions: [UI-009](design-decisions.md#ui-009--character-theme-appearances), [UI-012](design-decisions.md#ui-012--retain-three-stronger-character-themes), [UI-018](design-decisions.md#ui-018--named-palettes-and-local-fonts), [UI-023](design-decisions.md#ui-023--separate-theme-font-roles), [UI-024](design-decisions.md#ui-024--assertive-functional-color-by-default), [UI-044](design-decisions.md#ui-044--core-palettes-and-the-lightest-page), [UI-045](design-decisions.md#ui-045--character-palettes-from-the-reference-cards).
### Surfaces over images
- The app image fills the work area below the titlebar, including new tabs and document views. It stays fixed while content scrolls.
- Sidebars use `--rs-image-sidebar-bg` (82% tint). Editor surfaces use `--rs-image-editor-bg` (90% tint). Without an image, both are opaque.
- Write, Source, Read, and Split share the editor surface. CodeMirror layers stay transparent above it.
- Code blocks in Write and Read use `--rs-code-block-bg`.
- Hovered rows and controls in the work area, hovered menu rows, and the workspace button use `--rs-hover-bg`. With an image, it is a 6% veil of the strong text color. The image stays visible, and the hover shows over light and dark image areas. Dialogs and Settings keep opaque fills.
- New-tab buttons use `--rs-image-control-bg` and `--rs-image-control-hover-bg`. Their tint keeps labels readable while the image stays visible. The new-tab screen shows only its action buttons, with icons, labels, and shortcuts.
- Headers and dialogs keep their own surfaces.
- The app work area and Project Management keep separate images and settings in every theme. The one image of Background can be up to 50 MiB. Its bytes stay in IndexedDB, and the appearance settings keep a small reference.
- The folder and the one image each have a size, nine alignment positions, and an overlay from -100% (lighter) to 100% (darker), set with a slider or a typed value.
- Without a background frame, every surface and menu is opaque. With Background off, no image shows.
Decisions: [UI-010](design-decisions.md#ui-010--background-surface-visibility), [UI-011](design-decisions.md#ui-011--backgrounds-across-the-work-area), [UI-016](design-decisions.md#ui-016--translucent-code-blocks), [UI-061](design-decisions.md#ui-061--translucent-menus-and-hover-fills-over-images).
### Project Management surfaces
- Without its own image, Project Management shows the host image through a transparent root. A saved or temporary board image keeps its own area.
- The host gives `--rs-workarea-plugin-bg` and `--rs-workarea-surface-opacity` for saved board images and slideshow frames.
- With an image, lists, cards, card details, and search fields share the 82% tint. Gantt and calendar views use one tinted panel, and their date cells show the image.
- Selected cards use the shared selection treatment. Nested surfaces keep their own tint.
- Card detail buttons have a transparent resting background. Hover, pressed, and focus states stay visible.
Decisions: [UI-014](design-decisions.md#ui-014--readable-project-management-surfaces), [UI-017](design-decisions.md#ui-017--quiet-card-detail-controls).
### Slideshow
- A folder of the Background feature is a slideshow. Its frame overrides the saved board image while it is active. A temporary board frame comes before the all-board frame. Removal restores the saved image.
- When the app and Project Management show the same frame, the host draws it once across both sidebars and the board. Distinct board frames keep their own area.
- Images fade over two seconds. Reduced motion removes the fade. Short intervals and manual Next can interrupt it.
- The next image loads and decodes before its fade starts. A new frame changes only the custom properties with a new value.
- Portrait images show in full over a blurred cover layer by default. The image editor previews a per-image fit, position, and overlay, and saves or resets the override. The folder layout applies to other images. The sidecar file `.runestone-backgrounds.json` in the folder keeps the overrides.
- **Next background image** and **Pause background** are in the command palette. Next reaches every window. Pause keeps the current image and stops the timer.
- A new browser tab on `about:blank` shows the host background, also in a browser window. A loaded page keeps its own rendering, even when it is empty.
Decisions: [UI-015](design-decisions.md#ui-015--slower-slideshow-fades), [UI-020](design-decisions.md#ui-020--per-image-slideshow-layout), [UI-057](design-decisions.md#ui-057--background-replaces-background-image-and-background-slideshow).
## Tooltips and text selection
- Use one tooltip per control, with no duplicate native `title`. Tooltips use the `--rs-tooltip-*` tokens for padding, font size, surface, text, and shadow. Table cell hints use the same surface.
- Hover and keyboard focus show a tooltip. Escape dismisses it. It stays inside the viewport.
- Text selection uses `--rs-selection` and `--rs-selection-text` in Write, Source, Read, and Project Management fields. A CodeMirror selection layer must override its generated default styles.
- Text selection keeps the theme hue at 65% opacity or less, so the background shows through. A lower explicit opacity stays unchanged. Text stays opaque. Theme exports keep the source colors.
Decisions: [UI-019](design-decisions.md#ui-019--one-tooltip-surface), [UI-029](design-decisions.md#ui-029--text-selection-transparency).
## Document panes and Find
- A workspace link can open another document in a pane to the right. A duplicate target focuses its existing pane.
- Closing a split keeps its tab and unsaved text. The focused pane controls Save, the outline, and the Terminal selection.
- Narrow work areas stack the panes vertically. Pane layouts stay local to the window.
- Write, Source, Read, and plugin editor views share `FindPanel.svelte` and `find.css`.
- A plugin document editor without a Find handler searches its visible rendered text through `readingSearch.ts`. Rendered-text Find has no replace controls. Plugin Find handlers stay in use for views with their own search engine.
- Generic plugin views and Kanban documents have no fallback Find.
- Ctrl+F opens Find. Enter and Shift+Enter move between matches. Escape closes Find and returns focus. Find and Replace fields turn off saved-input suggestions.
Decisions: [UI-021](design-decisions.md#ui-021--workspace-links-in-document-panes), [UI-031](design-decisions.md#ui-031--shared-find-controls-in-plugin-views), [UI-034](design-decisions.md#ui-034--find-scope-and-shared-list-names).
## Project Management lists
- A list can set an optional card maximum through its action menu. Show the active count and the maximum together.
- At or above the maximum, show an opaque warning icon with a tooltip. Extra cards stay permitted. The count includes active cards outside the current search results.
- Lists collapse to narrow strips with a vertical name and card count. The expand control keeps its accessible name, tooltip, focus, and expanded state.
- Named boards save collapse state with their lists. All Tasks saves its own collapse state, and does not change board lists or card placement.
### All Tasks
- All Tasks merges lists with the same name into one column. The match ignores case and outer spaces. Distinct and empty lists stay visible.
- Each column groups cards under board-name dividers. A shared card shows once per column, under a heading that names each matching board. Cards without an active board go under No active board. Empty groups stay hidden.
- Merged columns have no capacity limits. Named board lists keep their own limits.
- Card drag and quick move actions are off in All Tasks. Card details and named boards keep their move controls.
- New cards from a column or New card need an active board. The Board and List controls come from the shared card editor and host menus. The destination is the list with a matching name, or the default list of the board.
### Cards and boards
- A description edit stays a draft until Save. Cancel restores the saved text. Closing card details keeps the draft, and the card then shows an unsaved marker. Edit opens the draft. Use the labels Save and Cancel, and leave readable space below long descriptions.
- Board and list changes save at once. Close and an outside click use the same save path for other fields.
- Each workspace can set a fixed default view: All tasks or one board. Restored tabs and explicit links keep their targets. An unavailable default returns to All tasks. A workspace without boards shows **Create your first board**.
- Project Management is host code (`src/lib/features/pm/ui/`). The board scope, the select choices, and the details pickers use the shared action menu. Icon-only controls use the shared tooltip and the shared action icons. All interface text comes from the catalog.
- New cards record their creation time, and card details show it. Existing cards show Unknown when no reliable time exists. Moves and edits do not change it. Board cards do not show timestamps.
Decisions: [UI-033](design-decisions.md#ui-033--list-capacity-and-a-frozen-all-tasks-overview), [UI-034](design-decisions.md#ui-034--find-scope-and-shared-list-names), [UI-035](design-decisions.md#ui-035--board-dividers-in-all-tasks), [UI-036](design-decisions.md#ui-036--compact-list-collapse-and-assigned-creation), [UI-037](design-decisions.md#ui-037--saved-metadata-and-explicit-description-drafts), [UI-038](design-decisions.md#ui-038--fixed-workspace-default-board), [UI-060](design-decisions.md#ui-060--native-project-management).
## Review checklist
Examine each changed control in these conditions:
- Light and dark themes, and each named palette that the change affects
- Narrow windows and viewport edges
- Empty, populated, and long content, such as long plugin lists in Settings
- Normal, hover, keyboard focus, selected, and disabled states
- Keyboard use and focus return
- For selection: single items, contiguous ranges, separate groups, and nested rows
- For tabs: plugin views and pinned tabs
- For menus: file, folder, pane, tab, editor, table, and submenu examples, with icon alignment
Run these checks:
| Change | Command |
| --- | --- |
| Shared menu code | `node tests/smoke/menus/consistency.smoke.mjs` against the [development server](development.md#run-from-source). Set `SMOKE_URL` for a different server. Set `PLAYWRIGHT_MODULE` and `CHROME_PATH` when the environment needs explicit paths. |
| Any menu, select, or picker work | `pnpm check:menus` (runs `node scripts/menuSurfaceAudit.mjs`) before Review |
The audit compares source entry points with the inventory in `docs/menu-surfaces.json`, across the host and sibling plugins. A new or changed entry point needs an inventory review. The audit covers source only. It does not prove runtime compliance.
For a card, open the exact control in each screenshot of the card. A neighboring control does not satisfy the card.
Record this evidence in the card or change review:
- The affected controls, the guide section, and the shared component or token. Explain any separate implementation and any local override.
- Screenshots of the changed states in light and dark themes, including narrow layouts, at normal scale.
- The check results. State each check that you could not run.
- A check against the [design principles](#design-principles): repeated headings, competing accents, extra controls, and space for the user's work.
- A link to a decision entry when a rule changes, a problem recurs, or an exception applies.
Browser tests with mocked desktop services do not replace native window and installer checks. Automated checks do not decide whether the interface keeps attention on the work.
Label accepted screenshots with their control, theme, state, and rule, and use them as references. Replace them when the rule changes. An unreviewed screenshot is not an accepted design.
Move work to Review after the relevant checks pass. Keep unresolved work In progress. Done needs the user's acceptance.
## Decision records
This guide holds the current rules. The [design decision log](design-decisions.md) records why rules changed, recurring problems, and exceptions.
| Change | Record |
| --- | --- |
| Isolated correction, such as a menu restored to its specified color | Card or commit record only. No log entry. |
| Rule change, such as a new interface font, even for one control | Update this guide and add a rule-change entry in the same change. |
| Recurring problem, such as repeated wrong menu colors | Add or update one problem entry. Link the occurrences, and record the cause and the prevention check. |
| Exception | Add an exception entry with the user benefit, exact scope, and review date or trigger. Link it from the affected rule here. |
- A log entry does not authorize a departure from the current rule.
- Repeated symptoms do not prove a cause. Record an unknown cause as unknown.
- Clarify this guide only when a rule is missing or unclear.
Decisions: [UI-001](design-decisions.md#ui-001--separate-design-decisions-from-routine-corrections).
+314
View File
@@ -0,0 +1,314 @@
# User guide
[RuneStone](../README.md) · [Installation](installation.md)
This guide explains how to work with files, documents, tabs, settings, and the built-in browser in RuneStone.
| Task | Go to |
| --- | --- |
| Open or create a workspace | [Open a workspace](#open-a-workspace) |
| Create, find, or organize files | [Create and find files](#create-and-find-files) |
| Write, read, or follow a link | [Edit documents](#edit-documents) |
| Work with images, diagrams, or tables | [Images, diagrams, and tables](guides/document-tools.md) |
| Read a PDF file | [Read PDF files](#read-pdf-files) |
| Start a note from a template | [Use note templates](#use-note-templates) |
| Arrange tabs and windows | [Manage tabs](#manage-tabs) |
| Save, or recover from a changed file | [Save your work](#save-your-work) and [Resolve file conflicts](#resolve-file-conflicts) |
| Change the language or colors | [Change settings](#change-settings) and [Appearance](guides/themes.md) |
| Review changes and commit with Git | [Git guide](guides/git.md) |
| Plan work on boards, a timeline, and a calendar | [Project Management guide](guides/project-management.md) |
| Turn a built-in feature on or off | [Turn features on or off](#turn-features-on-or-off) |
| Add plugins | [Install and manage plugins](plugins.md) |
| Browse websites | [Use the built-in browser](#use-the-built-in-browser) |
| Run commands or scripts | [Terminal guide](guides/terminal.md) |
## Open a workspace
A workspace is a folder on your computer. RuneStone reads and writes its files directly.
1. Select the workspace name at the bottom of the sidebar, or press Ctrl+O. When the sidebar is hidden, select ⇕ at the bottom of the left ribbon.
2. Choose a recent workspace, **Open another folder…**, or **New workspace…**.
Each workspace opens in its own window. The current window keeps its documents and terminals.
**New workspace…** creates a named folder at the location that you choose. It does not replace an existing folder.
The recent list keeps the 20 most recent folders. Select × beside a folder to remove it from the list. This does not change the folder.
The navigator, Quick Open, and search hide `.git`, `.obsidian`, `.runestone`, and temporary save files.
They do not apply Git ignore rules, and the navigator does not follow folder symbolic links.
To show workspace settings and plugin data in the navigator, turn on **Settings → General → Show .runestone folder**.
## Create and find files
| Action | How |
| --- | --- |
| New file | Press Ctrl+N and type the full name with its extension, such as `notes/meeting.md` or `scripts/check.py`. RuneStone does not add an extension. |
| New note | Select **New note** in an empty tab, or right-click the navigator and choose **New note**. RuneStone creates a Markdown file. Rename it from the note title. |
| Find a file by path | Press Ctrl+P. |
| Search all files | Press Ctrl+Shift+F. The results come in groups by file, with the count and the matches marked. |
| Find in the document | Press Ctrl+F. |
| Show or hide the sidebar | Press Ctrl+\. |
| Find a command | Press Ctrl+Shift+P, type part of the command name, and press Enter. The list also shows each shortcut and the plugin commands. |
| Rename | Select an item in the navigator and press F2. RuneStone selects the name without the extension. |
| Move | Drag files between folders. |
| Bookmark | Right-click a file and choose **Bookmark**. The Bookmarks pane lists it with its folder. Select × beside a bookmark to remove it. |
Right-click a file or folder for more actions, such as **Make a copy**, **Copy path**, and **Open in default app**. **Delete** is last in the menu, in the error color.
With the navigator focused, Ctrl+X, Ctrl+C, and Ctrl+V cut, copy, and paste files.
The navigator is one Tab stop. Up and Down move between items, and Shift+Up or Shift+Down extends the selection. Right opens a folder or enters it. Left closes a folder or goes to its parent. Home and End go to the first and last item. Type the start of a name to go to it.
Ctrl+Z undoes a file move or rename, and Ctrl+Shift+Z or Ctrl+Y repeats it.
### Delete files
**Delete** moves the selected items to the Recycle Bin or Trash. To get them back, restore them from there. Ctrl+Z does not restore deleted files.
- Select items in the navigator and press Delete, or right-click and choose **Delete**. On macOS, you can also press Cmd+Backspace.
- RuneStone asks for confirmation before it moves a folder or several items. One file moves without a question.
- **Delete permanently** (Shift+Delete, or Cmd+Option+Backspace on macOS) removes the items from the disk. RuneStone always asks first.
- A link is deleted as a link. The file or folder that it points to stays.
Network drives, removable drives, and some Linux setups have no trash. There, **Delete** shows an error and keeps the files. Use **Delete permanently** if you want to remove them.
### Names of new files
A new name cannot contain these characters: `< > : " | ? *`. Windows does not allow them. This rule applies on every platform, so that a workspace that you share, for example through Git, also opens on Windows.
On macOS and Linux, you can still open, edit, rename, and delete existing files whose names contain these characters.
## Edit documents
Each document pane has one view control with three choices, and a **Split** button:
| Choice | Shows |
| --- | --- |
| **Write** | Formatted Markdown. The active line shows its Markdown source. |
| **Source** | The plain source with line numbers and syntax colors |
| **Read** | The rendered document, without editing. Markdown files only. |
| **Split** | Read beside Write or Source. Narrow panes stack the two views. Select **Split** again to close it. Markdown files only. |
Press Ctrl+E to switch between Write and Source. Press Ctrl+Shift+E to switch between Read and the editor. The tab menu has the same choices under **View**.
The control shows icons only. Hover over an icon, or focus it with the keyboard, to see its name and shortcut. The arrow keys move the choice.
The status bar shows the save state, the line and column of the cursor, the word count, the line endings (LF or CRLF), and the current view. For a folder on a network drive, it also shows **Polling for changes**. A tab without a document, such as the theme editor, has no outline and no document facts. The bar above the document shows the folder of the file, and the tab shows the file name.
Write keeps your Markdown source, frontmatter, and Windows line endings. Read shows frontmatter in a collapsed **Properties** section.
Select a checkbox to complete a task. Copy code blocks without their Markdown fences with the **Copy code** button.
In a list item, press Tab to make a nested item. Press Shift+Tab to move it one level up. RuneStone renumbers the list.
Nested ordered lists show letters, then Roman numerals. The Markdown source keeps the numbers, for example `1.`.
Tab in other text indents by 4 spaces.
To rename a note, select its title in Write and type a new name. Press Enter or leave the field to save the name. Press Escape to cancel.
The file keeps its folder, extension, contents, and edit history.
To hide the title in Write and Read, turn off **Settings → General → File name title**. Then use F2 or **Rename…** in the tab menu.
Read follows CommonMark: a single line break inside a paragraph is a space. To show each line break of the source in Read, turn on **Settings → General → Keep line breaks**.
### Links and backlinks
- Ctrl+click a link in Write or Source. In Read, a normal click follows the link.
- A workspace file link opens in a new tab and keeps the current document open.
- A heading link, such as `guide.md#save-your-work` or `#save-your-work`, scrolls to that heading.
- A wiki link, such as `[[Meeting notes]]`, finds the note by name anywhere in the workspace. If two notes have the same name, use a relative or workspace path.
- The **Backlinks** section below the outline lists notes that link to the current note. Select an entry to open it.
If backlinks look out of date, select **Rebuild note index**. Your Markdown files do not depend on this index.
### Format text
Right-click Markdown text, or press Shift+F10, to open the context menu. Use the arrow keys for submenus. Press Escape to return to the text.
| Menu | Actions |
| --- | --- |
| Format | Bold, italic, strikethrough, highlight, code, math, comment, and clear formatting |
| Paragraph | Bulleted and numbered lists, tasks, headings 1–6, body text, and quotes |
| Insert | Footnotes, tables, callouts, horizontal rules, code blocks, and math blocks |
In Write, these shortcuts format the selected text:
| Format | Shortcut |
| --- | --- |
| Bold / Italic | Ctrl+B / Ctrl+I |
| Strikethrough / Highlight | Ctrl+Shift+X / Ctrl+Shift+H |
| Link (`[text]()`, with the cursor in the address) | Ctrl+K |
The menu also has link, search, extraction, and clipboard actions. RuneStone has no formatting toolbar.
Right-click a misspelled word to see spelling suggestions from the operating system.
## Read PDF files
Select a PDF file in the file tree. It opens in its own tab. The file tree marks PDF files with a document icon.
| Action | How |
| --- | --- |
| Change the page | Select **Previous page** or **Next page**. Or type a number in the page field and press Enter. With the page area focused, press Page Up or Page Down. |
| Zoom | Select **Zoom in** or **Zoom out**, from 25% to 400%. **Fit width** fits the page to the tab again. |
| Rotate | Select **Rotate clockwise**. Each click turns the page by 90 degrees. |
| Copy text | Select text on the page with the pointer, then press Ctrl+C. |
| Show changes from another program | Select **Reload PDF**. The tab stays on the same page. |
| Open a protected PDF | Type the password, then select **Unlock**. RuneStone does not save the password. |
- A PDF file must be in the workspace and at most 64 MiB.
- The tab shows one page at a time. It does not edit PDF files, fill forms, open links, run scripts in a PDF, or print.
- Scanned pages show as images, so you cannot select their text.
- If a PDF does not open, the tab shows the error. Select **Reload PDF**, or try another copy of the file.
PDF Viewer is a built-in feature. To turn it off, see [Turn features on or off](#turn-features-on-or-off).
## Use note templates
A template is a Markdown file in the workspace folder `.runestone/templates/`.
1. Right-click a Markdown file or its tab.
2. Choose **Save as template** and type a name.
3. To use the template, choose **New note** in an empty tab or in the navigator, then select the template.
New notes are copies. A change to a new note does not change the template.
To create, rename, edit, or delete templates, choose **New note → Manage templates…** in the navigator.
## Manage tabs
Each open tab keeps its undo history, cursor, and scroll position.
| Action | How |
| --- | --- |
| New empty tab | Select + or press Ctrl+T. The next file that you open uses this tab. |
| Next or previous tab | Ctrl+Tab or Ctrl+Shift+Tab |
| Close the tab | Ctrl+W |
| Reorder | Drag the tab. Press Escape to cancel. With a tab focused, press Alt+Shift+Left or Alt+Shift+Right. |
| Pin, close others, or close all | Right-click the tab. |
| Find a tab | Select ⌄ after the tabs for a list of all tabs. The list marks pinned and unsaved tabs. Fades at the ends of the tab strip show that more tabs are out of view. |
| Move to a new window | Drag the tab out of the tab strip, or right-click it and choose **Open in new window**. |
| Move to another window | Drag the tab to the tab strip of the other window. |
RuneStone moves the current text of the tab, also unsaved text. It closes the source tab only after the new window accepts the tab.
If the move fails, the source tab stays open.
When you start RuneStone again, it opens the document tabs of the workspace. It keeps their order, pins, and active tab.
This includes PDF tabs and plugin tabs that show a file. RuneStone reads the contents again from disk. Missing files do not stop the other tabs from opening.
## Save your work
Auto-save is on by default. It saves changed files every 5 seconds, also in background tabs. RuneStone does not write unchanged files.
Press Ctrl+S to save the active file immediately.
To change auto-save, open **Settings → General**. Set an interval from 1 to 300 seconds, or turn auto-save off.
**Restore defaults** sets auto-save on with a 5-second interval.
If you close a tab with unsaved edits, RuneStone asks whether to save them: **Save**, **Don't save**, or **Cancel**. If you close a window with unsaved edits or running terminal sessions, RuneStone asks before it closes.
Unsaved text and terminal sessions do not survive a restart or a crash.
## Resolve file conflicts
When another program changes an open file, RuneStone does one of two things:
- If the tab has no unsaved edits, RuneStone loads the new file contents.
- If the tab has unsaved edits, RuneStone keeps your edits and shows a message. Expand **View disk version** to compare. Auto-save pauses for this tab until you choose an action.
Then choose one action:
| Action | Result |
| --- | --- |
| **Keep my edits** | Keeps your edits. The next save replaces the file on disk. |
| **Save a copy** | Saves your edits to a new file. |
| **Use disk version** | Replaces your edits with the file on disk. The button is last, in the error color. |
If the file is deleted, the tab keeps your text. Use **Save a copy**, or **Retry** after the file is back.
Before it saves, RuneStone compares the file on disk with the version that it last read. It writes a complete temporary file, then replaces the original.
If a write fails, your edits stay in the tab. RuneStone does not lock files, so another program can still write at the same time.
## Change settings
Select the gear at the bottom of the sidebar, or press Ctrl+,. When the sidebar is hidden, the gear is at the bottom of the left ribbon. Use the search field to find a setting.
Settings apply at once to all workspaces on this computer and update all open windows. A text field applies when you leave it.
| Category | Settings |
| --- | --- |
| General | Display language, **File name title**, **Keep line breaks**, **Table formulas**, **Show .runestone folder**, and auto-save |
| Appearance | Color theme, transparency, background (a folder slideshow or one image), and custom themes. See [Appearance and custom themes](guides/themes.md). |
| Features | Turn Git, Background, Terminal, PDF Viewer, and Project Management on or off. See [Turn features on or off](#turn-features-on-or-off). |
| Plug-ins | Install, enable, update, and remove plugins. See [Install and manage plugins](plugins.md). |
| Browser | Homepage, search engine, profiles, ad blocking, and web data |
| Terminal | Default profile, font size, scrollback lines, and cursor blink. The page shows only while Terminal is on. See [Change the terminal settings](guides/terminal.md#change-the-terminal-settings). |
| Project Management | Priority levels and the default board of the workspace. The page shows only while Project Management is on. See [Change the Project Management settings](guides/project-management.md#change-the-project-management-settings). |
### Turn features on or off
Git, Background, Terminal, PDF Viewer, and Project Management are built-in features with an off switch. Open **Settings → Features** and use the switch beside the feature.
- A feature that is on uses no extra memory until you first use it. Examples are Source control, a terminal, a PDF file, or a board. Background loads at the start only when you selected a folder or an image.
- A feature that is off does not load. Its buttons, commands, and tabs do not show.
- Terminal off ends the terminal sessions of every window. When a window runs a shell, RuneStone asks first.
- A change applies at once in all windows. The code that a window loaded stays in memory until you restart RuneStone.
After an update, Git takes the state of its old plugin package: on when the package was enabled, off when it was disabled. Without an old package, Git starts on.
Terminal does the same with the old Terminal plugin, and it copies the terminal settings of that plugin. PDF Viewer does the same with the old PDF Viewer plugin.
Project Management does the same with the old Project Management plugin, and it copies the priority levels of that plugin.
Background starts on for every user. It takes the folder, the timing, and the targets of the Background Slideshow plugin when that plugin was on. Otherwise it shows your old background image, if you had one. See [Show a background](guides/themes.md#show-a-background).
Settings → Plug-ins shows an old package as **Included with RuneStone**. You can uninstall it.
### Display language
**Display language** sets the RuneStone controls to English, Français, 日本語, or 简体中文.
It does not translate documents, plugin content, or operating system messages. Some error messages stay in English.
Reopen a document to update its editor tooltips after a language change.
## Use the built-in browser
RuneStone includes a Chromium-based browser. It needs no plugin, but its engine is a separate download of about 160 MB.
1. Select the globe button in the left ribbon to open a **New browser tab**.
2. The first time, select **Download the engine**. RuneStone downloads the engine, makes sure that it is complete, and opens the page.
3. Type an address or a search.
Without internet access, select **Install from file…** and choose the engine ZIP for your RuneStone version.
If a download fails, the tab shows the cause. Select **Retry** to start the download again.
Until the engine is installed, web links in your documents open in your system browser.
After a RuneStone update that needs a new engine, a browser tab offers **Update the engine**.
In a page, middle-click a link to open it in a new tab. Middle-click other content to scroll, then move the pointer in the direction to scroll.
Right-click an image for **Open image in new tab**, **Save image as…**, **Copy image**, and **Copy image address**.
**Copy image** keeps the original file. A GIF that you paste into a document or a card keeps its animation.
Use **Settings → Browser** to set the homepage and search engine, manage profiles, block ads, and clear cookies, cache, or history.
**Settings → Browser → Browser engine** shows the installed version. **Remove engine** frees the disk space. Your profiles, bookmarks, and history stay.
Each profile keeps its own cookies and bookmarks. Web bookmarks show in the Bookmarks pane.
To open web links from your documents in your system browser instead, turn off **Open web links in RuneStone**.
## Keyboard reference
This table lists the Windows and Linux keys. On macOS, Cmd replaces Ctrl, and RuneStone shows the macOS symbols, such as ⇧⌘P. Help lists every shortcut.
| Action | Shortcut |
| --- | --- |
| Find a command | Ctrl+Shift+P |
| Open a workspace | Ctrl+O |
| Find a file / New file | Ctrl+P / Ctrl+N |
| New tab / Close tab | Ctrl+T / Ctrl+W |
| Next tab / Previous tab | Ctrl+Tab / Ctrl+Shift+Tab |
| Move the focused tab | Alt+Shift+Left / Alt+Shift+Right |
| Save | Ctrl+S |
| Find in document / Search workspace | Ctrl+F / Ctrl+Shift+F |
| Switch Write and Source | Ctrl+E |
| Switch Read and the editor | Ctrl+Shift+E |
| Nest a list item / Move it up | Tab / Shift+Tab |
| Leave the text, then move the focus on | Esc, then Tab |
| Bold / Italic / Link (Write) | Ctrl+B / Ctrl+I / Ctrl+K |
| Strikethrough / Highlight (Write) | Ctrl+Shift+X / Ctrl+Shift+H |
| Show or hide the sidebar | Ctrl+\ |
| Rename | F2 |
| Delete to the trash / Delete permanently | Delete / Shift+Delete |
| Context menu | Shift+F10 |
| Resize a pane | Tab to its divider, then press the arrow keys |
| Settings / Help and about | Ctrl+, / F1 |
The [Terminal guide](guides/terminal.md) lists the terminal shortcuts.
## Limits
- Math shows as formatted source text. RuneStone does not typeset formulas.
- Source colors syntax, but has no language services such as error checks or go to definition.
- RuneStone does not support Obsidian Bases.
- Plugins have full access to RuneStone and your files. See [Install and manage plugins](plugins.md).
## Get help
Press F1, or select the question mark at the bottom of the sidebar or of the left ribbon, for **Help and about**. It shows the app version, basic steps, and every shortcut.
When you report a problem, include the app version, operating system, steps, expected result, and error text.