Add interface languages and improve themes and workspace controls for 0.1.36

This commit is contained in:
Knotty Wyvern
2026-10-15 10:55:59 -07:00
parent b066359b66
commit 68e86ab6eb
98 changed files with 5499 additions and 874 deletions
+30 -15
View File
@@ -4,18 +4,18 @@
RuneStone installs JavaScript plugins from local ZIP files and experimental Gitea release downloads.
Open Settings → Plug-ins to install, enable, disable, or uninstall them.
See [plugin names and source folders](plugin-names.md) for display names, stable IDs, and pending manual folder changes.
Terminal and Table formulas use the same installed package system as all other plugins.
See [plugin names and source folders](plugin-names.md) for display names, stable IDs, and checkout locations.
Terminal and Table Formulas use the same installed package system as all other plugins.
## Build and install the feature packages
1. Clone `RuneStone_TableFormulas` beside RuneStone and run `pnpm install --frozen-lockfile` in that checkout.
2. Run `pnpm build:plugins` from the RuneStone repository root for Table formulas.
1. Clone `RuneStone_Table_Formulas` beside RuneStone and run `pnpm install --frozen-lockfile` in that checkout.
2. Run `pnpm build:plugins` from the RuneStone repository root for Table Formulas.
3. In Settings → Plug-ins, choose Install plugin ZIP.
4. Select the ZIP files in `../RuneStone_TableFormulas/releases/`, then choose Install and enable.
4. Select the ZIP files in `../RuneStone_Table_Formulas/releases/`, then choose Install and enable.
The build creates `runestone.table-formulas-0.1.0.zip`.
Table formulas is a development package in its [own repository](https://git.knottywyvern.com/kwyvern-gitea/RuneStone_TableFormulas).
The build creates `runestone.table-formulas-<version>.zip` in that plugin's `releases/` folder.
Table Formulas is a development package in its [own repository](https://git.knottywyvern.com/kwyvern-gitea/RuneStone_TableFormulas).
Set `RUNESTONE_TABLE_FORMULAS_ROOT` to use a different checkout location.
That repository also supports `pnpm package:plugin`, with `RUNESTONE_ROOT` selecting the host packager.
The folders beside them contain build output for inspection and tests.
@@ -23,8 +23,7 @@ Use the ZIP files for installation and releases.
Terminal development lives in the separate [RuneStone_Terminal repository](https://git.knottywyvern.com/kwyvern-gitea/RuneStone_Terminal).
In that repository, run `pnpm install --frozen-lockfile`, then `pnpm build`.
Install `releases/runestone.terminal-0.1.0.zip` through the same plugin ZIP installer.
Version 0.1.0 marks Terminal as a development package.
Install `releases/runestone.terminal-<version>.zip` through the same plugin ZIP installer.
The local source folder is `../RuneStone_Terminal/` when both repositories share a parent directory.
No plugin starts automatically in a fresh installation.
@@ -298,8 +297,8 @@ 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 |
| 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.
@@ -345,6 +344,9 @@ export function activate(api) {
| --- | --- |
| `api.id` | The installed plugin ID |
| `api.signal` | An abort signal triggered before shutdown |
| `api.i18n.locale` | Current interface language: `en`, `fr`, `ja`, or `zh-CN`. Optional API |
| `api.i18n.t(message, values?, catalogs?)` | Translate an explicit interface message with optional plugin catalogs and named placeholders |
| `api.i18n.subscribe(listener)` | Receive the current language immediately and subsequent changes. Returns cleanup and stops when the plugin is disabled |
| `contribute(key, value)` | Register a typed terminal or table formula contribution |
| `registerCommand({ id, title, run })` | Add a command to Commands in the toolbar |
| `registerCommand({ category: "open", ... })` | Add a launch action to Open tab or view |
@@ -365,6 +367,7 @@ export function activate(api) {
| `workspace.list(path?)` | List a directory in this window's active workspace |
| `workspace.listMarkdown()` | Return sorted visible Markdown paths in one native request. Optional API |
| `workspace.read(path)` | Read a workspace text file |
| `workspace.readMany(paths)` | Optional batched text read. Accept at most 64 paths and return a source or error for each path |
| `workspace.readBytes(path)` | Read workspace bytes as a Uint8Array, with a 64 MiB limit. Requires the binary document host update |
| `workspace.readOptional(path)` | Read text, or return null when the file is absent. Added in 0.1.6 |
| `workspace.create(path, contents)` | Create complete text without replacing an existing file. Added in 0.1.6 |
@@ -374,9 +377,14 @@ export function activate(api) {
| `settings.subscribe(listener)` | Receive saved settings changes across windows. Optional API |
| `assets.read(path)` | Read package bytes as a `Uint8Array` |
Check for `workspace.readMany` before calling it. Older hosts require individual reads.
Each result contains `path` and either `source` or `error`. One failed file does not discard the remaining results.
The native batch accepts at most 64 paths and 16 MiB of combined UTF-8 text.
Workspace path checks and plugin shutdown checks apply to these reads.
Command and view IDs must be unique within their respective plugin collections.
Plugin commands can supply an optional `icon` from the view icon set.
Use the same icon for the command and its view. Older hosts can ignore this field.
Plugin commands can supply an optional `icon` from the shared action icon set in `src/lib/ui/actionIcons.ts`.
Use a recognizable action icon, such as `skip-forward` or `pause`, for each command. Older hosts can ignore this field.
Sidebar views belong in the left navigation. Views with a direct navigation button do not repeat in the plugin launch menu.
Plugin configuration appears in Settings under the plugin name.
Register a view with `settings: true` to add its configuration page.
@@ -384,6 +392,13 @@ The host mounts that view inside Settings and removes it from the launch menu.
Settings loads enabled plugins so their configuration pages remain available in the separate settings window.
The host calls `mount(container, context)` with `context.surface` set to `"settings"` or `"view"`.
Older hosts can omit the context argument.
The optional language API shares the language selected in General settings across plugin views and windows.
Plugins supply their own catalogs for plugin-specific text. A missing message falls back to the shared host catalog, then its English source.
For example, `api.i18n?.t('Hide column', {}, { fr: { 'Hide column': 'Masquer la colonne' } }) ?? 'Hide column'`.
Use a subscription to refresh interface labels after a language change. Dispose a view's subscription when that view closes.
Translate explicit interface text only. Keep document text, filenames, board names, IDs, and keyboard identifiers unchanged.
Existing packages retain their current language until their source adopts this API and supplies catalogs.
Local Autocomplete keeps temporary reference text in its editor view because that text belongs to one window.
Open Commands → Configure Local Autocomplete in that window to use reference text.
@@ -448,8 +463,8 @@ The plugin must stop its mounted controls and native sessions in `onDispose` bef
| `src/lib/plugins/registry.ts` / `contracts.ts` | Shared feature contributions and their types |
| `src/lib/plugins/TerminalSlot.svelte` | The host element for terminal controls |
| `../RuneStone_Terminal/src/` | Terminal plugin source in its own repository |
| `../RuneStone_TableFormulas/` | Table formulas source, unit tests, and package build |
| `scripts/buildPlugins.mjs` | Table formulas compilation and ZIP release in `../RuneStone_TableFormulas/releases/` |
| `../RuneStone_Table_Formulas/` | Table Formulas source, unit tests, and package build |
| `scripts/buildPlugins.mjs` | Table Formulas compilation and ZIP release in `../RuneStone_Table_Formulas/releases/` |
| `scripts/packagePlugin.mjs` | Shared checks and ZIP creation for plugin authors |
Run `pnpm build:plugins`, `pnpm check`, `pnpm test`, `pnpm build`, and `cargo test --manifest-path src-tauri/Cargo.toml --lib --offline`.