Make Background a native feature
- Background replaces the Background Slideshow plugin and the background image of Appearance. It shows a folder as a slideshow, or one image. - It is on by default. Its module loads at launch only when a folder or an image is chosen. - Rust keeps the one folder in background-folder.json. The interface never sends a path. Eight background_* commands replace the six deprecated backgrounds_* commands. - The first start moves the slideshow folder and settings, and keeps the saved image as the image source. - One blur worker with a cache, fewer folder reads, and a decode before each fade. The hub writes only the changed properties. - Remove the deprecated folder methods of api.backgrounds. set, get, and subscribe stay for the Project Management plugin. - Show the view buttons in the workbench test without text, after UI-056. - Update the tests, the measurement tool, the docs, and UI-057.
This commit is contained in:
@@ -352,6 +352,7 @@ Keyboard focus now scrolls only the menu panel. It cannot dismiss a menu by scro
|
||||
- Evidence: All 11 slideshow unit tests, TypeScript checks, and the settings browser check pass.
|
||||
- Limits: Native desktop appearance requires user review.
|
||||
- Replaces: The 800-millisecond fade rule in the interface guide.
|
||||
- Update 2026-10-29: The rule stays. The native Background feature implements it ([UI-057](#ui-057--background-replaces-background-image-and-background-slideshow)).
|
||||
|
||||
### UI-016 — Translucent code blocks
|
||||
|
||||
@@ -442,6 +443,7 @@ Evidence: RuneStone_Git/.audit/git-tooltip-evidence.json and git-tooltip-*.png.
|
||||
- Shared implementation: The image sidecar API, optional blurredUrl frames, and separate foreground and cover layers.
|
||||
- Evidence: Host frame and sidecar checks cover layout, cleanup, size limits, and external changes. Plugin checks accompany the card review.
|
||||
- Limits: Native desktop appearance requires user review.
|
||||
- Update 2026-10-29: The rule stays. The native Background feature implements it ([UI-057](#ui-057--background-replaces-background-image-and-background-slideshow)).
|
||||
|
||||
### UI-021 — Workspace links in document panes
|
||||
|
||||
@@ -1042,3 +1044,18 @@ Native shell, background image, and desktop acceptance remain open.
|
||||
- Evidence: `tests/smoke/layout/viewModes.smoke.mjs`.
|
||||
- Replaces / replaced by: The names of UI-049.
|
||||
- Limits: None.
|
||||
|
||||
### UI-057 — Background replaces Background image and Background Slideshow
|
||||
|
||||
- Type: Rule change
|
||||
- Date: 2026-10-29
|
||||
- Status: Implemented for user review
|
||||
- Decision source: The owner decisions of Phase 7, stage 7-2 (2026-10-29): Background is on for every user, also after an update, and decisions 4A, 5C, 6A, and 11A.
|
||||
- Previous rule: Appearance → **Background image** kept one image for new tabs, and `appearance.ts` drew it. The Background Slideshow plugin (`runestone.bg-slideshow` 0.0.11) showed a folder through `api.backgrounds` and its deprecated folder methods, with its settings in its own settings view.
|
||||
- New rule: Background is a native feature with a switch in Settings → Features. Appearance → **Background** has **Background source** (Folder, Image, or None), the folder and its timing and order, the one image, the layout, the per-image editor, and the targets. With Background off, the section shows one line that names Settings → Features, no image shows, and menus are opaque. With no folder and no image, the feature does not load. **Next background image** and **Pause background** are in the command palette. A blank browser tab, also in a browser window, shows the background.
|
||||
- Reason: The owner chose response time and memory over the plugin API. One section replaces two places for the same background.
|
||||
- Scope: Appearance → Background, the workarea background, browser windows, Project Management board frames, and the command palette.
|
||||
- Shared implementation: `src/lib/features/background/`, `src/lib/features/backgroundSettings.ts`, `src/lib/features/launch.ts`, `src/lib/plugins/backgrounds.ts`, `src/lib/theme/background.css`, and `src-tauri/src/backgrounds.rs`.
|
||||
- Evidence: `tests/smoke/features/background.smoke.mjs` and the updated `tests/smoke/appearance/background*.smoke.mjs`, with screenshots in both themes and at 360 pixels in `output/smoke/features/background/`.
|
||||
- Replaces / replaced by: The Background image section of Appearance and the Background Slideshow plugin. The rules of [UI-015](#ui-015--slower-slideshow-fades) and [UI-020](#ui-020--per-image-slideshow-layout) stay.
|
||||
- Limits: Each window has its own timer, so windows can show different images. The settings window runs no slideshow. The old package stays installed until the user removes it.
|
||||
|
||||
+15
-9
@@ -63,10 +63,10 @@ Windows is the primary platform. macOS and Linux builds are experimental.
|
||||
| `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 switch migration. It changes no plugin file. |
|
||||
| `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` | Pseudo-terminals for the Terminal plugin |
|
||||
| `browser.rs` | The process of the built-in browser engine |
|
||||
| `backgrounds.rs` | Background image folders for themes and plugins |
|
||||
| `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. |
|
||||
@@ -88,7 +88,7 @@ A new command needs an entry in `generate_handler!` in `lib.rs`, in the command
|
||||
| `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, and one folder for each feature (`git/`). See [Native features](#native-features). |
|
||||
| `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, the Background settings (`backgroundSettings.ts`), and one folder for each feature (`git/`, `background/`). 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`) |
|
||||
@@ -116,7 +116,8 @@ A new command needs an entry in `generate_handler!` in `lib.rs`, in the command
|
||||
| Documents | Ordinary files in the workspace folder |
|
||||
| Workspace state: tab order, pins, bookmarks, templates, Project Management boards | `.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 | `settings.json` in the app config folder |
|
||||
| Preferences: general settings, appearance, custom themes, display language, feature switches, Background | `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 and the open tabs of each workspace | The WebView storage (`localStorage`) of the app. RuneStone can lose these values without harm. |
|
||||
|
||||
@@ -135,13 +136,14 @@ On macOS, it is `~/Library/Application Support/<identifier>/`. On Linux, it is `
|
||||
"customThemes": [],
|
||||
"customThemesLegacy": [],
|
||||
"language": "en",
|
||||
"features": { "git": true }
|
||||
"features": { "git": true, "background": true },
|
||||
"background": { "source": "folder", "seconds": 60, "order": "name", "paused": false, "targets": ["app"], "overlay": 0, "position": "center", "size": "cover" }
|
||||
}
|
||||
```
|
||||
|
||||
| Rule | Detail |
|
||||
| --- | --- |
|
||||
| Sections | `general`, `appearance`, `customThemes`, `customThemesLegacy` (the original version 1 themes), `language`, and `features` (the switches of the native features). The host does not interpret their values. The frontend normalizes each section. |
|
||||
| Sections | `general`, `appearance`, `customThemes`, `customThemesLegacy` (the original version 1 themes), `language`, `features` (the switches of the native features), and `background` (the source, the timing, the targets, and the folder layout of Background). 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. |
|
||||
@@ -206,22 +208,26 @@ Errors of the plugin API stay in English, because they are for plugin developers
|
||||
|
||||
## Native features
|
||||
|
||||
Git is a native feature: host code with an off switch in **Settings → Features**. It does not use the plugin API.
|
||||
Git and Background 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, and commands | `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 | `src/lib/features/migration.ts` and `src-tauri/src/features.rs` |
|
||||
| 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 and commands 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.
|
||||
- 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`.
|
||||
- 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
|
||||
|
||||
|
||||
+61
-9
@@ -2,7 +2,7 @@
|
||||
|
||||
[RuneStone](../../README.md) · [User guide](../user-guide.md)
|
||||
|
||||
This guide explains how to choose colors, set a background image, and edit, create, or share a custom theme.
|
||||
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.
|
||||
|
||||
@@ -21,20 +21,72 @@ Each named theme has its own fonts and syntax colors. Fonts come from your compu
|
||||
|
||||
## Adjust transparency
|
||||
|
||||
**Transparent surfaces** tints work areas with a background image and compatible plugin surfaces.
|
||||
**Transparent surfaces** tints work areas with a [background](#show-a-background) and compatible plugin surfaces.
|
||||
Menus stay opaque. With a background image, menus are at least 92% opaque 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.
|
||||
|
||||
## Set a background image
|
||||
## Show a background
|
||||
|
||||
1. Choose **Choose image…** and select a PNG, JPEG, WebP, or GIF file up to 50 MiB.
|
||||
2. Set **Image size** to **Fill**, **Fit**, or **Actual size**.
|
||||
3. Set **Image position**.
|
||||
4. Set **Image overlay** from -100% to 100%. Negative values lighten the image, and positive values darken it.
|
||||
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**.
|
||||
|
||||
The image shows in new tabs. RuneStone keeps it on this computer.
|
||||
The Project Management plugin can keep a separate image for a board. The Background Slideshow plugin can replace the image for a time.
|
||||
### 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 comes from the Project Management plugin 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
|
||||
|
||||
|
||||
+17
-8
@@ -159,14 +159,6 @@
|
||||
"design": "API type declaration, no renderer",
|
||||
"check": "pnpm check"
|
||||
},
|
||||
"RuneStone/src/lib/theme/AppearanceSettings.svelte": {
|
||||
"counts": {
|
||||
"action": 1,
|
||||
"localPopup": 2
|
||||
},
|
||||
"design": "Shared action menu for image position and size. Theme choice uses preview cards (UI-047).",
|
||||
"check": "tests/smoke/appearance/backgroundImages.smoke.mjs"
|
||||
},
|
||||
"RuneStone/src/lib/ui/actionMenu.ts": {
|
||||
"counts": {
|
||||
"action": 1,
|
||||
@@ -327,6 +319,23 @@
|
||||
},
|
||||
"design": "Uses the host menu. Keeps a native selector for older hosts.",
|
||||
"check": "RuneStone_Project_Management/tests/october-cards.spec.ts with PM_HOST_URL; both themes, narrow layout, keyboard focus"
|
||||
},
|
||||
"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"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+13
-27
@@ -436,9 +436,6 @@ The host still accepts the native calls of released plugins. A later host can re
|
||||
| Terminal | `invoke("pty_new_window")` | Open a terminal window | `api.pty.openWindow()` |
|
||||
| Terminal | `invoke("pty_dictation")` | Start Windows voice typing | `api.pty.dictation()` |
|
||||
| Terminal | `invoke("workspace_read", { rel: ".runestone/tasks.json" })` | Read the task list of the workspace | `api.workspace.read(path)` |
|
||||
| Background Slideshow | `api.backgrounds.chooseFolder`, `list`, `read`, `defaultFolder`, `readImageSettings`, `writeImageSettings` | Read images and per-image settings from a folder outside the workspace | `api.files` with a folder grant |
|
||||
| Background Slideshow | `api.workspace.readOptional(".runestone/pm/workspace.json")` | Read the board names of Project Management | A service of Project Management through `api.services` |
|
||||
|
||||
The Project Management, Local Autocomplete, PDF Viewer, 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.
|
||||
|
||||
@@ -508,27 +505,17 @@ Make the data of a service a documented contract of the provider. Give its name,
|
||||
|
||||
## Background API
|
||||
|
||||
`api.backgrounds` (`version: 1`) lets a plugin show image frames behind the RuneStone interface.
|
||||
`api.backgrounds` (`version: 1`) lets a plugin show image frames behind the RuneStone interface, and read the frames of other owners.
|
||||
Frames stay in the current window and do not change the saved appearance settings.
|
||||
To read images from a folder outside the workspace, use [folder grants](#folder-grants).
|
||||
|
||||
The folder methods are deprecated. They accept a folder path from the plugin. Use [folder grants](#folder-grants) in new code.
|
||||
The host keeps them for released versions of Background Slideshow.
|
||||
| Method | Contract |
|
||||
| --- | --- |
|
||||
| `set(target, frame)` | Show a frame for a target. `null` removes the frame of this plugin. |
|
||||
| `get(target)` | Return the active frame for a target, or `null`. |
|
||||
| `subscribe(listener)` | Receive the target name when a frame changes. Returns a cleanup function. |
|
||||
|
||||
| Method | Optional | Contract |
|
||||
| --- | --- | --- |
|
||||
| `chooseFolder()` | | Deprecated. Use `files.chooseFolder()`. Open the folder picker. Returns an absolute path, or `null` on cancel. |
|
||||
| `defaultFolder()` | yes | Deprecated. Use `files.pictureFolder("Backgrounds")`. Create `RuneStone Backgrounds` in the Pictures folder of the user and return its path. |
|
||||
| `list(folder)` | | Deprecated. Use `files.list(grant)`. Return `{ name }` for PNG, JPEG, GIF, and WebP files directly in the folder. |
|
||||
| `read(folder, name)` | | Deprecated. Use `files.readBytes(grant, name)`. Read one image as bytes, at most 50 MiB. |
|
||||
| `readImageSettings(folder)` | yes | Deprecated. Use `files.readSidecar(grant, ".runestone-backgrounds.json")`. Read the per-image settings file text, or `null`. |
|
||||
| `writeImageSettings(folder, contents, expected)` | yes | Deprecated. Use `files.writeSidecar`. Save the per-image settings file. See [Per-image settings](#per-image-settings). |
|
||||
| `set(target, frame)` | | Show a frame for a target. `null` removes the frame of this plugin. |
|
||||
| `get(target)` | | Return the active frame for a target, or `null`. |
|
||||
| `subscribe(listener)` | | Receive the target name when a frame changes. Returns a cleanup function. |
|
||||
|
||||
Folders must be absolute paths without `..` segments.
|
||||
The host rejects links, files with other extensions, files that are not raster images, and files over the size limit.
|
||||
File access needs an enabled plugin in the current window. Pending reads fail after the plugin stops.
|
||||
The folder methods of earlier hosts (`chooseFolder`, `defaultFolder`, `list`, `read`, `readImageSettings`, and `writeImageSettings`) are gone. The native Background feature replaced the Background Slideshow plugin that used them.
|
||||
|
||||
### Targets and frames
|
||||
|
||||
@@ -554,13 +541,12 @@ When more than one plugin sets a frame for a target, the most recent frame is sh
|
||||
Disable removes the frames and subscriptions of the plugin before cleanup.
|
||||
To share saved configuration across windows, use the plugin settings API.
|
||||
|
||||
Example: [Background Slideshow](https://git.knottywyvern.com/kwyvern/RuneStone_BG_Slideshow/src/branch/main/docs/development.md#integration) sets frames from local image folders.
|
||||
Example: the native Background feature (`src/lib/features/background/index.ts`) sets frames from a local image folder through the host frames.
|
||||
Example: [Project Management](https://git.knottywyvern.com/kwyvern/RuneStone_PM/src/branch/main/development.md#pm-0229-slideshow-backgrounds) reads frames for board backgrounds.
|
||||
|
||||
### Per-image settings
|
||||
|
||||
The per-image settings file is `.runestone-backgrounds.json` in the image folder.
|
||||
It must be JSON with `"schema": 1` and an `images` object, at most 1 MiB.
|
||||
`writeImageSettings` 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.
|
||||
`files.writeSidecar` does the same comparison on the same file, but the host checks only that the text is JSON. The plugin checks the schema.
|
||||
Example: the [Background Slideshow image settings](https://git.knottywyvern.com/kwyvern/RuneStone_BG_Slideshow/src/branch/main/docs/development.md#per-image-settings) give the storage format and the rendering behavior.
|
||||
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.
|
||||
|
||||
+10
-10
@@ -33,7 +33,7 @@ The browser preview (`pnpm dev`) has no installed plugins unless a smoke test su
|
||||
|
||||
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, 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 share the tab model of plugin views. Browser windows start no native feature. See [Native features](development.md#native-features).
|
||||
Native features, such as Git and Background, 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 share the tab model of plugin views. 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
|
||||
@@ -108,7 +108,7 @@ The uninstall dialog puts focus on **Cancel**. Escape cancels.
|
||||
|
||||
`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 background file commands, need a lease for the calling window.
|
||||
Native services for plugins, such as the folder grant commands (`folders_*`), need a lease for the calling window.
|
||||
|
||||
## Gitea downloads
|
||||
|
||||
@@ -160,11 +160,11 @@ The policy stops a script that comes in through rendered content, for example a
|
||||
| --- | --- | --- |
|
||||
| `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'`: the PDF Viewer decodes JPEG 2000 and JBIG2 images and color profiles with WebAssembly in its worker. 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, the Vite dev server, and plugins (Terminal, CSV Viewer, PDF Viewer, Background Slideshow). |
|
||||
| `style-src` | `'self' 'unsafe-inline'` | Svelte `style` attributes, the `style` attribute in `src/app.html`, Mermaid SVG styles, and the `<style>` elements of CodeMirror, the Vite dev server, and plugins (Terminal, CSV Viewer, PDF 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:`: fonts that the PDF Viewer embeds. |
|
||||
| `connect-src` | `'self' ipc: http://ipc.localhost blob:` | `ipc:` and `http://ipc.localhost`: Tauri commands. `blob:`: the Background Slideshow worker reads its image from a Blob URL. |
|
||||
| `worker-src` | `'self' blob:` | `'self'`: workers that the app serves. The app starts no worker now. `blob:`: the PDF Viewer and Background Slideshow workers. |
|
||||
| `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. `blob:`: the PDF Viewer worker and 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. |
|
||||
@@ -186,10 +186,10 @@ Workers that the app loads from its own files get no policy. Workers from Blob U
|
||||
| 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, backgrounds, completion, browser |
|
||||
| `browser.json` | `browser-*` | Only the built-in browser (`builtInModules` in `src/lib/plugins/external.ts`) | Browser, `plugins_snapshot`, settings, spelling, and window controls |
|
||||
| `settings.json` | `settings-main`, `settings-workspace-*` | All enabled plugins | Settings, plugins, the Background folder, folder grants, completion, browser |
|
||||
| `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. `tests/unit/plugins/windowCapabilities.spec.ts` and `tests/smoke/browser/window.smoke.mjs` check this.
|
||||
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:
|
||||
|
||||
@@ -197,7 +197,7 @@ The other windows load every enabled plugin. A smaller command set for them woul
|
||||
- Settings windows use no `workspace_*`, `git_*`, or `pty_*` commands, but plugin settings views run there.
|
||||
- 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` do not check the window that opened the terminal.
|
||||
- `backgrounds_*` need a plugin lease of the calling window.
|
||||
- `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.
|
||||
|
||||
@@ -207,7 +207,7 @@ The other windows load every enabled plugin. A smaller command set for them woul
|
||||
| --- | --- |
|
||||
| `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` | Background folder and image commands. Deprecated for plugins: use folder grants |
|
||||
| `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` | Terminal sessions for `api.pty`. A session with an IPC channel gets raw output bytes; a session without one gets the older window events |
|
||||
| `src/lib/plugins/sdk.ts` | The public package API types |
|
||||
|
||||
+1
-1
@@ -77,7 +77,6 @@ RuneStone uses the token for this request only and does not save it.
|
||||
| --- | --- |
|
||||
| Terminal | [Terminal guide](guides/terminal.md) |
|
||||
| Project Management | [Project Management guide](https://git.knottywyvern.com/kwyvern/RuneStone_PM/src/branch/main/project-management.md) |
|
||||
| Background Slideshow | [Background Slideshow usage](https://git.knottywyvern.com/kwyvern/RuneStone_BG_Slideshow/src/branch/main/docs/usage.md) |
|
||||
| Local Autocomplete | [Local Autocomplete trial guide](https://git.knottywyvern.com/kwyvern/RuneStone_LocalModel/src/branch/main/docs/trial-guide.md) |
|
||||
| PDF Viewer | [PDF Viewer README](https://git.knottywyvern.com/kwyvern/RuneStone_PDFViewer/src/branch/master/README.md) |
|
||||
| CSV Viewer | [CSV Viewer README](https://git.knottywyvern.com/kwyvern/RuneStone_CSV_Viewer/src/branch/main/README.md) |
|
||||
@@ -95,6 +94,7 @@ RuneStone uses the token for this request only and does not save it.
|
||||
| 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 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.
|
||||
|
||||
+13
-8
@@ -173,13 +173,13 @@ Decisions: [UI-004](design-decisions.md#ui-004--detached-tab-work-area), [UI-039
|
||||
- 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 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.
|
||||
- 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).
|
||||
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).
|
||||
|
||||
## Typography and tables
|
||||
|
||||
@@ -194,6 +194,8 @@ 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).
|
||||
@@ -221,8 +223,9 @@ Decisions: [UI-009](design-decisions.md#ui-009--character-theme-appearances), [U
|
||||
- Code blocks in Write and Read use `--rs-code-block-bg`.
|
||||
- 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. An image can be up to 50 MiB. Image bytes stay in IndexedDB, and settings keep a small reference.
|
||||
- Each image has a size, nine alignment positions, and an overlay from -100% (darker) to 100% (lighter), set with a slider or a typed value.
|
||||
- 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).
|
||||
|
||||
@@ -238,13 +241,15 @@ Decisions: [UI-014](design-decisions.md#ui-014--readable-project-management-surf
|
||||
|
||||
### Slideshow
|
||||
|
||||
- A slideshow 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.
|
||||
- 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.
|
||||
- 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. Global settings apply to other images. The [plugin API](plugin-development.md#plugin-api) defines the storage.
|
||||
- A new browser tab on `about:blank` shows the host background. A loaded page keeps its own rendering, even when it is empty.
|
||||
- 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).
|
||||
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
|
||||
|
||||
|
||||
+7
-6
@@ -199,21 +199,22 @@ Settings apply at once to all workspaces on this computer and update all open wi
|
||||
| Category | Settings |
|
||||
| --- | --- |
|
||||
| General | Display language, **File name title**, **Keep line breaks**, **Table formulas**, **Show .runestone folder**, and auto-save |
|
||||
| Appearance | Color theme, transparency, background image, and custom themes. See [Appearance and custom themes](guides/themes.md). |
|
||||
| Features | Turn Git on or off. See [Turn features on or off](#turn-features-on-or-off). |
|
||||
| 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 and Background 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 |
|
||||
|
||||
### Turn features on or off
|
||||
|
||||
Git is a built-in feature with an off switch. Open **Settings → Features** and use the switch beside the feature.
|
||||
Git and Background 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, for example when you open Source control.
|
||||
- A feature that is on uses no extra memory until you first use it, for example when you open Source control. 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.
|
||||
- A change applies at once in all windows. The code that a window loaded stays in memory until you restart RuneStone.
|
||||
|
||||
After an update, each new built-in feature takes the state of its old plugin package: on when the package was enabled, off when it was disabled.
|
||||
Without an old package, the feature starts on. Settings → Plug-ins shows an old package as **Included with RuneStone**. You can uninstall it.
|
||||
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.
|
||||
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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user