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:
@@ -1,7 +1,7 @@
|
||||
// Tab tooltips, translucent text selection, zero-transparency backgrounds, a stable transparency slider, and the themed install checkbox.
|
||||
import assert from "node:assert/strict";
|
||||
import path from "node:path";
|
||||
import { mockTauri, outputDir, runSmoke, smokeUrl } from "../_harness/index.mjs";
|
||||
import { mockTauri, outputDir, runSmoke, showSavedImage, smokeUrl } from "../_harness/index.mjs";
|
||||
|
||||
await runSmoke("appearance/tooltipsAndSelection", async ({ page }) => {
|
||||
const output = await outputDir("appearance/tooltipsAndSelection");
|
||||
@@ -35,6 +35,7 @@ await runSmoke("appearance/tooltipsAndSelection", async ({ page }) => {
|
||||
const { saveAppearance } = await import("/src/lib/theme/appearance.ts");
|
||||
saveAppearance({ theme: "default", mode, transparency: { enabled: true, amount: 0 }, newTabBackground: { image: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mP8/x8AAwMCAO+jM1sAAAAASUVORK5CYII=" } });
|
||||
}, mode);
|
||||
await showSavedImage(page);
|
||||
const tab = page.getByRole("tab", { name: /welcome\.md/ });
|
||||
assert.equal(await tab.getAttribute("title"), null);
|
||||
await page.mouse.move(600, 600);
|
||||
@@ -50,9 +51,10 @@ await runSmoke("appearance/tooltipsAndSelection", async ({ page }) => {
|
||||
const writer = page.getByRole("textbox", { name: "Writing editor", exact: true });
|
||||
await writer.click(); await page.keyboard.press("Control+a");
|
||||
const colors = await writer.evaluate(node => {
|
||||
const root = getComputedStyle(document.documentElement);
|
||||
const root = getComputedStyle(document.documentElement), body = getComputedStyle(document.body);
|
||||
// Background sets the image and the surfaces on the body (src/lib/plugins/backgrounds.ts).
|
||||
return { selection: root.getPropertyValue("--rs-selection"), bg: getComputedStyle(node, "::selection").backgroundColor,
|
||||
text: getComputedStyle(node).color, image: root.getPropertyValue("--rs-new-tab-image"), pluginBg: root.getPropertyValue("--rs-workarea-plugin-bg") };
|
||||
text: getComputedStyle(node).color, image: body.getPropertyValue("--rs-background-image"), pluginBg: body.getPropertyValue("--rs-workarea-plugin-bg") };
|
||||
});
|
||||
assert.match(colors.selection.trim(), /^#[0-9a-f]{6}a6$/i);
|
||||
assert.match(colors.bg, /0\.65/);
|
||||
|
||||
Reference in New Issue
Block a user