Bento, the office suite that fits in a file
TypeScript mit-licenseofficeoffice-365office-suiteoffice-toolsoffice365open-sourcepowerpointself-hostedsingle-page-appslidesslideshareslideshowslideshow-galleryslideshow-makerslideshows
spaces: every field wears the suite's one field look (slides #729), with a browser rig (#735)
nyblnet9401dbf5e13a
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.ymlindex 44bc25db..9ccf7c22 100644--- a/.github/workflows/ci.yml+++ b/.github/workflows/ci.yml@@ -2550,3 +2550,10 @@ jobs:# Real UI and serialization, offline; delayed mock writes expose save races.run: |node scripts/test-spaces-save-browser.mjs+ - name: One field look in Chromium (spaces)+ # Port of slides' fields rig: every chrome text field, select and+ # textarea (inspector incl. "Also known as", dialogs, view popovers,+ # pickers, Share, comments, a designed space, the password gate) has+ # the shared field look and amber focus ring in light, dark and+ # OS-dark, never the UA's dress. "Also known as" shipped in it.+ run: node scripts/test-spaces-fields-browser.mjsdiff --git a/scripts/test-spaces-fields-browser.mjs b/scripts/test-spaces-fields-browser.mjsnew file mode 100644index 00000000..369f788f--- /dev/null+++ b/scripts/test-spaces-fields-browser.mjs@@ -0,0 +1,355 @@+// SPDX-License-Identifier: MIT+// Copyright (c) 2026 The Bento authors+// Every text field, select and textarea in spaces' chrome wears the ONE field look.+//+// npm run build:single --prefix spaces && node scripts/test-spaces-fields-browser.mjs+//+// A port of scripts/test-slides-fields-browser.mjs: the same measurement, the+// same assertions and the same planted check, on spaces' shell and surfaces.+// The rule under test is the `THE FIELD` block, copied as it stands from+// slides/src/styles.css into spaces/src/styles.css.+//+// WHY. The page inspector's "Also known as" field shipped in the browser's own+// dress — a 2px INSET grey border, square corners, the UA fill. Its class+// (sp-insp-text) missed the panel's sp-insp-txt by a letter and had no rule;+// the template-name field had no class at all; and in dark theme the Replace+// from JSON box was a hard-coded white well under light ink.+//+// WHAT THIS PROVES, measured in the packaged document, in light, dark and+// OS-dark (no stored choice — the @media path):+// 1. every visible field — the page inspector (incl. "Also known as") and a+// link block's, About, Customise (the design panel), Replace from JSON,+// Encrypt with password, Import Markdown, the two page exports, Save as+// template, Add property, search, find & replace, a view's filter →+// Add condition, the link card, the page picker, the callout icon, the+// format bar's link field, a comment reply, Share, a DESIGNED space (#559+// designs re-point the chrome tokens inside the page surface), and the+// password gate of an encrypted copy — has a 1px SOLID border in the+// --line colour, a --field fill, a 6px radius, and (single-line fields) a+// 26px height. Tokens are resolved BESIDE each field, so a field inside a+// design's surface is held to that design's values;+// 2. a focused field shows the amber ring: a 2px solid --accent-ink outline,+// on every kind of field the walk meets (text, number, select, textarea);+// 3. each surface really opened — a floor on how many fields it shows inside+// its own container — so a surface that silently failed to open cannot+// pass by having no fields;+// 4. the check itself works: a field with its author styles reverted (the+// browser's dress) is planted in the page and must be flagged.+// Native widgets (checkbox, radio, range, file) keep the platform look and are+// skipped. The one deliberate exception is the ghost space name in the bar.+import { mkdtempSync, writeFileSync, rmSync } from 'node:fs'+import { tmpdir } from 'node:os'+import { join } from 'node:path'+import { pathToFileURL } from 'node:url'+const { chromium } = await import(process.env.PLAYWRIGHT_MODULE || 'playwright')++let checks = 0+let failures = 0+function ok(cond, msg) {+ checks+++ if (!cond) { failures++; console.log(` FAIL ${msg}`) } else console.log(` ok ${msg}`)+}++const SHELL = new URL('../spaces/dist-single/Bento_Spaces.bento.html', import.meta.url).href++// Every visible field on the page, with what the rule governs.+function measure(scope) {+ const probeAt = (parent) => {+ const probe = document.createElement('span')+ probe.style.cssText = 'position:absolute;visibility:hidden'+ parent.appendChild(probe)+ const resolve = (v) => { probe.style.color = `var(${v})`; return getComputedStyle(probe).color }+ const tok = { line: resolve('--line'), field: resolve('--field'), ring: resolve('--accent-ink') }+ probe.remove()+ return tok+ }+ const words = (n) => {+ const c = n.cloneNode(true)+ for (const x of c.querySelectorAll('input, select, textarea, output')) x.remove()+ return c.textContent.trim().replace(/\s+/g, ' ')+ }+ const nameOf = (f) => {+ const aria = f.getAttribute('aria-label')+ if (aria) return aria+ if (f.labels?.length && words(f.labels[0])) return words(f.labels[0])+ const row = f.closest('.sp-insp-row')?.querySelector('.sp-insp-lbl')+ if (row) return row.textContent.trim()+ const lbl = f.closest('.sp-field')?.querySelector('.sp-field-lbl')+ if (lbl) return lbl.textContent.trim()+ if (f.placeholder) return `"${f.placeholder}"`+ const near = f.closest('.sp-ab-field, .sp-dsg-row, .sp-row, label')+ if (near && words(near)) return words(near).slice(0, 40)+ return ''+ }+ const rootTok = probeAt(document.body)+ const out = []+ for (const el of document.querySelectorAll('input, textarea, select')) {+ const r = el.getBoundingClientRect()+ const s = getComputedStyle(el)+ if (!r.width || !r.height || s.visibility === 'hidden') continue+ const type = el.tagName === 'INPUT' ? el.type : el.tagName.toLowerCase()+ if (['checkbox', 'radio', 'range', 'file', 'hidden'].includes(type)) continue+ // the deliberate exception: the ghost space name (boxless at rest)+ if (el.matches('.sp-doctitle')) continue+ const sides = ['Top', 'Right', 'Bottom', 'Left']+ const cls = el.className && `.${String(el.className).trim().split(/\s+/).join('.')}`+ out.push({+ id: `${type}${cls || ''} ${nameOf(el)}`.trim(),+ type,+ styles: sides.map((x) => s[`border${x}Style`]),+ widths: sides.map((x) => s[`border${x}Width`]),+ colors: sides.map((x) => s[`border${x}Color`]),+ bg: s.backgroundColor,+ radius: s.borderTopLeftRadius,+ h: +r.height.toFixed(1),+ tok: el.parentElement ? probeAt(el.parentElement) : rootTok,+ planted: el.hasAttribute('data-planted'),+ inScope: !scope || !!el.closest(scope),+ })+ }+ return { tok: rootTok, fields: out }+}++function problems(f) {+ const tok = f.tok+ const p = []+ if (f.styles.some((x) => x === 'inset' || x === 'outset')) p.push(`${f.styles[0]} border (browser default)`)+ else if (f.styles.some((x) => x !== 'solid')) p.push(`border ${f.styles.join('/')}`)+ if (f.widths.some((w) => w !== '1px')) p.push(`border ${f.widths.join('/')}`)+ if (f.colors.some((c) => c !== tok.line)) p.push(`border ${f.colors[0]} ≠ --line ${tok.line}`)+ if (f.bg !== tok.field) p.push(`fill ${f.bg} ≠ --field ${tok.field}`)+ if (f.radius !== '6px') p.push(`radius ${f.radius}`)+ if (f.type !== 'textarea' && Math.abs(f.h - 26) > 0.5) p.push(`height ${f.h}`)+ return p+}++// ————— driving the shell —————+const visible = (p, sel) => p.locator(sel).filter({ visible: true }).first()+async function menu(p, trigger, label) {+ await visible(p, trigger).click()+ await p.getByRole('menuitem', { name: label }).filter({ visible: true }).first().click()+}+const saveAs = (p, label) => menu(p, 'button[aria-label^="Save as"]', label)+async function openPage(p, title) {+ await p.locator('.sp-treelink', { hasText: title }).first().click()+ await p.waitForTimeout(250)+}+async function showInspector(p) {+ const show = p.locator('button[aria-label^="Show properties"]').filter({ visible: true })+ if (await show.count()) await show.first().click()+ await visible(p, '.sp-insp').waitFor()+}+async function addCondition(p) {+ await openPage(p, 'Tracker')+ await visible(p, '[data-view-filter]').click()+ await p.getByRole('menuitem', { name: /Add condition/ }).first().click()+ await visible(p, '.sp-pop select').waitFor()+}++// each surface gets a fresh page; `open` brings it up, and `min` is the floor+// on how many fields it shows INSIDE `scope` — proof the surface opened at all+const SURFACES = [+ { name: 'page inspector', scope: '.sp-insp', min: 2, must: 'Also known as', open: showInspector },+ { name: 'inspector: link block', scope: '.sp-insp', min: 5, open: async (p) => {+ await openPage(p, 'Tables, pictures and clips')+ await showInspector(p)+ await p.locator('.sp-page [data-block-type="link"], .sp-page .sp-linkcard').first().click()+ await visible(p, '.sp-insp .sp-insp-txt').waitFor()+ } },+ { name: 'inspector: image block', scope: '.sp-insp', min: 2, open: async (p) => {+ await openPage(p, 'Tables, pictures and clips')+ await showInspector(p)+ await p.locator('.sp-page [data-block-id] img').first().click()+ await visible(p, '.sp-insp .sp-insp-num').waitFor()+ } },+ { name: 'About', scope: '[role=dialog]', min: 2, open: async (p) => { await p.locator('.sp-mark').click(); await visible(p, '[role=dialog] select').waitFor() } },+ { name: 'Customise (design panel)', scope: '.sp-dsg-panel', min: 20, open: async (p) => {+ await p.locator('.sp-mark').click()+ await p.getByRole('button', { name: 'Customise…' }).click()+ await visible(p, '.sp-dsg-panel select').waitFor()+ } },+ { name: 'Replace from JSON', scope: '[role=dialog]', min: 1, open: async (p) => { await saveAs(p, /^Replace from JSON/); await visible(p, '[role=dialog] textarea').waitFor() } },+ { name: 'Encrypt with password', scope: '[role=dialog]', min: 2, open: async (p) => { await saveAs(p, /^Encrypt with password/); await visible(p, '[role=dialog] input[type=password]').waitFor() } },+ { name: 'Import Markdown', scope: '[role=dialog]', min: 1, open: async (p) => { await saveAs(p, /^Import Markdown/); await visible(p, '[role=dialog] select').waitFor() } },+ { name: 'Export page as a space', scope: '[role=dialog]', min: 1, open: async (p) => { await saveAs(p, /^Export page as a space/); await visible(p, '[role=dialog] select').waitFor() } },+ { name: 'Export page as slides', scope: '[role=dialog]', min: 1, open: async (p) => { await saveAs(p, /^Export page as slides/); await visible(p, '[role=dialog] select').waitFor() } },+ { name: 'Save as template', scope: '[role=dialog]', min: 1, open: async (p) => { await menu(p, '.sp-rowmore', /^Save as template/); await visible(p, '#sp-tpl-name').waitFor() } },+ { name: 'Add property', scope: '.sp-newprop', min: 2, open: async (p) => {+ await showInspector(p)+ await p.locator('.sp-insp button', { hasText: 'Add property' }).first().click()+ await visible(p, '.sp-newprop input').waitFor()+ } },+ { name: 'search', scope: '[role=dialog]', min: 1, open: async (p) => { await p.locator('button[aria-label^="Search all pages"]').click(); await visible(p, '.sp-find').waitFor() } },+ { name: 'find & replace', scope: '.sp-findbar', min: 2, open: async (p) => {+ await p.locator('.sp-page [contenteditable="true"]').first().click()+ await p.keyboard.press('ControlOrMeta+f')+ await visible(p, '.sp-findbar .sp-find').waitFor()+ } },+ { name: 'view: filter → Add condition', scope: '.sp-pop', min: 3, open: addCondition },+ { name: 'link card', scope: '[role=dialog]', min: 5, open: async (p) => { await menu(p, 'button[aria-label^="Add an image"]', /^Link card/); await visible(p, '[role=dialog] input').waitFor() } },+ { name: 'page picker', scope: '[role=dialog]', min: 1, open: async (p) => { await menu(p, 'button[aria-label^="Add an image"]', /^Link to page/); await visible(p, '.sp-find').waitFor() } },+ { name: 'callout icon', scope: '.sp-tonerow', min: 1, open: async (p) => {+ await openPage(p, 'Writing')+ await visible(p, '.sp-callout-chip').click()+ await visible(p, '.sp-toneicon').waitFor()+ } },+ { name: 'format bar link', scope: '.sp-fmt', min: 1, open: async (p) => {+ // select a paragraph's words, then ⌘K: with a selection it is "link", not "search"+ const para = p.locator('.sp-page [data-block-id] [contenteditable="true"]').first()+ await para.click()+ await para.evaluate((n) => { const r = document.createRange(); r.selectNodeContents(n); getSelection().removeAllRanges(); getSelection().addRange(r) })+ await p.waitForTimeout(150)+ await p.keyboard.press('ControlOrMeta+k')+ await visible(p, '.sp-fmt-url').waitFor()+ } },+ { name: 'comment reply', scope: '.sp-cm-pop', min: 1, open: async (p) => {+ await menu(p, '.sp-rowmore', /^Comment on this page/)+ await visible(p, '.sp-cm-mark').click()+ await visible(p, '.sp-cm-reply').waitFor()+ } },+ { name: 'Share', scope: '.sp-share-name', min: 1, open: async (p) => { await p.locator('.sp-live').first().click(); await visible(p, '.sp-share-name input').waitFor() } },+ // a designed space re-points --field/--line/--accent-ink inside the page+ // surface (designs.css); the chrome around it keeps the app's+ { name: 'designed space (Ledger): filter → Add condition', scope: '.sp-pop', min: 3, open: async (p) => {+ await p.locator('.sp-mark').click()+ await p.locator('[role=dialog] [data-design="ledger"]').click()+ await p.keyboard.press('Escape')+ await p.waitForFunction(() => document.querySelector('[data-sp-design]'))+ await addCondition(p)+ } },+]++const browser = await chromium.launch({ executablePath: process.env.CHROME_PATH, headless: true })+const work = mkdtempSync(join(tmpdir(), 'sp-fields-'))+try {+ // 'os-dark' stores no choice and lets the OS scheme decide: the @media path+ for (const theme of ['light', 'dark', 'os-dark']) {+ console.log(`\n${theme} theme\n`)+ const ctx = await browser.newContext({ viewport: { width: 1440, height: 900 }, colorScheme: theme === 'light' ? 'light' : 'dark' })+ if (theme !== 'os-dark') {+ await ctx.addInitScript((th) => { try { localStorage.setItem('bento-theme', th) } catch {} }, theme)+ }+ await ctx.route(/^https?:/, (r) => r.abort())+ const fresh = async (url = SHELL) => {+ const p = await ctx.newPage()+ // a prompt (the comment author and text) gets an answer; anything else is declined+ p.on('dialog', (d) => (d.type() === 'prompt' ? d.accept('Field probe') : d.dismiss()))+ p.on('pageerror', (e) => ok(false, `no page error (${e.message})`))+ await p.goto(url)+ await p.waitForFunction(() => window.bento?.doc && document.querySelector('.sp-mark'))+ await p.waitForTimeout(200)+ return p+ }++ const p0 = await fresh()+ const dark = await p0.evaluate(() => {+ const probe = document.createElement('span'); probe.style.color = 'var(--field)'; document.body.append(probe)+ const c = getComputedStyle(probe).color; probe.remove(); return c !== 'rgb(255, 255, 255)'+ })+ ok(dark === (theme !== 'light'), `the page is in ${theme} theme (--field ${dark ? 'dark' : 'white'})`)+ await p0.close()++ let total = 0+ const ringDone = new Set()+ const ring = async (p, scope) => {+ for (const sel of ['input[type="text"]', 'input[type="number"]', 'input[type="url"]', 'input[type="password"]', 'select', 'textarea']) {+ if (ringDone.has(sel)) continue+ const r = await p.evaluate(([sel, scope]) => {+ const el = [...document.querySelectorAll(`${scope} ${sel}`)].find((e) => e.getBoundingClientRect().width && !e.matches('.sp-doctitle'))+ if (!el) return null+ el.focus({ focusVisible: true })+ const s = getComputedStyle(el)+ const probe = document.createElement('span')+ probe.style.color = 'var(--accent-ink)'+ el.parentElement.appendChild(probe)+ const want = getComputedStyle(probe).color+ probe.remove()+ return { style: s.outlineStyle, width: s.outlineWidth, color: s.outlineColor, want, focusVisible: el.matches(':focus-visible') }+ }, [sel, scope])+ if (!r) continue+ ringDone.add(sel)+ ok(r.focusVisible && r.style === 'solid' && r.width === '2px' && r.color === r.want,+ `focused ${sel} shows the amber ring (${r.width} ${r.style} ${r.color}, want ${r.want})`)+ }+ }+ for (const s of SURFACES) {+ const p = await fresh()+ let res+ try {+ await s.open(p)+ await p.waitForTimeout(250)+ // measure the resting look, not a field the surface focused itself+ await p.evaluate(() => { const a = document.activeElement; if (a && /^(INPUT|SELECT|TEXTAREA)$/.test(a.tagName)) a.blur() })+ res = await p.evaluate(measure, s.scope)+ } catch (e) {+ ok(false, `${s.name}: opens (${e.message.split('\n')[0]})`)+ await p.close()+ continue+ }+ const bad = res.fields.map((f) => [f, problems(f)]).filter(([, pr]) => pr.length)+ total += res.fields.length+ const own = res.fields.filter((f) => f.inScope)+ ok(own.length >= s.min && bad.length === 0,+ `${s.name}: ${own.length} field(s) of its own (floor ${s.min}), all ${res.fields.length} on the page in the field look` ++ own.map((f) => `\n · ${f.id}`).join('') ++ bad.map(([f, pr]) => `\n ${f.id}: ${pr.join('; ')}`).join(''))+ if (s.must) ok(own.some((f) => f.id.endsWith(` ${s.must}`)), `${s.name}: the "${s.must}" field is among them`)+ await ring(p, s.scope)+ await p.close()+ }++ // THE PASSWORD GATE: an encrypted copy boots into a password card, and+ // its field is chrome too. Encrypt through the dialog, then open the bytes.+ {+ const p = await fresh()+ try {+ await saveAs(p, /^Encrypt with password/)+ const pw = p.locator('[role=dialog] input[type=password]')+ for (let i = 0; i < await pw.count(); i++) await pw.nth(i).fill('correct horse battery')+ await pw.last().press('Enter')+ await pw.first().waitFor({ state: 'detached' })+ const html = await p.evaluate(async () => await window.bento.serializeAuto())+ const file = join(work, `enc-${theme}.bento.html`)+ writeFileSync(file, html)+ const gate = await ctx.newPage()+ gate.on('pageerror', (e) => ok(false, `no page error on the gate (${e.message})`))+ await gate.goto(pathToFileURL(file).href)+ await gate.locator('.sp-gate-card input[type=password]').filter({ visible: true }).first().waitFor({ timeout: 15000 })+ const res = await gate.evaluate(measure, '.sp-gate-card')+ const own = res.fields.filter((f) => f.inScope)+ const bad = res.fields.map((f) => [f, problems(f)]).filter(([, pr]) => pr.length)+ total += res.fields.length+ ok(own.length >= 1 && bad.length === 0, `password gate: ${own.length} field(s) of its own (floor 1), all in the field look` ++ bad.map(([f, pr]) => `\n ${f.id}: ${pr.join('; ')}`).join(''))+ await gate.close()+ } catch (e) { ok(false, `password gate: opens (${e.message.split('\n')[0]})`) }+ await p.close()+ }+ ok(total >= 90, `${total} fields measured across ${SURFACES.length + 1} surfaces`)+ for (const sel of ['input[type="text"]', 'input[type="number"]', 'select', 'textarea']) {+ ok(ringDone.has(sel), `the focus ring was checked on a ${sel}`)+ }++ // 4. the check catches the browser's dress: plant a field whose author+ // styles are reverted, and it must come back with problems+ const p = await fresh()+ await showInspector(p)+ const planted = await p.evaluate(() => {+ const el = document.createElement('input')+ el.setAttribute('data-planted', '')+ el.style.all = 'revert'+ document.querySelector('.sp-insp, body').appendChild(el)+ return true+ }) && (await p.evaluate(measure))+ const pf = planted.fields.find((f) => f.planted)+ const pr = pf ? problems(pf) : []+ ok(pf && pr.some((x) => /browser default|fill|radius/.test(x)), `a browser-dressed field is flagged (${pr.join('; ') || 'not flagged'})`)+ await p.close()+ await ctx.close()+ }+} finally {+ await browser.close()+ rmSync(work, { recursive: true, force: true })+}+console.log(`\n${checks - failures}/${checks} checks passed`)+if (failures) process.exit(1)diff --git a/scripts/test-spaces.mjs b/scripts/test-spaces.mjsindex 86bab225..5fd7d2a5 100755--- a/scripts/test-spaces.mjs+++ b/scripts/test-spaces.mjs@@ -81,6 +81,8 @@ const RIGS = [// built spaces shell and Playwright/Chrome (the CI browser job provides both).{ name: 'save-revisions', file: 'scripts/test-spaces-save-revisions.ts' },{ name: 'save-browser', file: 'scripts/test-spaces-save-browser.mjs' },+ // every chrome field styled, light and dark — the built shell in Chromium+ { name: 'fields-browser', file: 'scripts/test-spaces-fields-browser.mjs' },// drives the BUILT shell in Chrome; self-skips outside CI without one{ name: 'chrome', file: 'scripts/test-spaces-chrome.ts' },]diff --git a/spaces/CHANGELOG.md b/spaces/CHANGELOG.mdindex e5463ffa..b58aaa04 100644--- a/spaces/CHANGELOG.md+++ b/spaces/CHANGELOG.md@@ -1341,6 +1341,14 @@ Versions follow `0.MINOR.PATCH` while pre-1.0.sync engine which document fields are content, so a collaborator's copy onlyever sends those. A field written by a newer version of Bento is kept in yourfile when it arrives, but never passed on to the rest of the room.+- **Every field looks like slides' fields.** Text fields, selects and text+ boxes in the panels, dialogs and popovers now share the look slides uses: a+ thin border, rounded corners, the theme's field colour, 26px tall, and an+ amber ring when focused. Before this, the page inspector's **Also known as**+ field and the **Save as template** name field showed the browser's grey,+ square, sunken box. In dark theme, the **Replace from JSON** box was white,+ and the link card, view filter and Add property fields sat on a different+ shade from the rest.## [0.1.0] — 2026-08-03diff --git a/spaces/src/props.ts b/spaces/src/props.tsindex e6a83b6a..0e4ac6ff 100644--- a/spaces/src/props.ts+++ b/spaces/src/props.ts@@ -381,7 +381,7 @@ export class PropsPanel {// had one, or every space that ever opened this panel grows an `aliases:// []` nobody asked for.if (!this.app.locked()) {- const aliases = mk('input', 'sp-insp-text') as HTMLInputElement+ const aliases = mk('input', 'sp-insp-txt') as HTMLInputElementaliases.type = 'text'aliases.value = aliasesOf(page).join(', ')aliases.placeholder = t('NYC, the Big Apple')diff --git a/spaces/src/styles.css b/spaces/src/styles.cssindex f17ea829..10766098 100644--- a/spaces/src/styles.css+++ b/spaces/src/styles.css@@ -285,15 +285,52 @@ html, body {overscroll-behavior: none;}#app { height: 100%; }-:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 4px; }+/* fields take THE FIELD's own ring below; this one would also round them to 4px */+:where(:not(input, select, textarea)):focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 4px; }select, input, textarea, [contenteditable='true'] { -webkit-user-select: auto; user-select: auto; }-/* Native controls follow the theme through `color-scheme` on :root, so a- <select> is dark when the chrome is. Its ink and ground are still stated- here: a force-dark engine that ignores color-scheme would otherwise paint a- dark popup and leave our dark ink on it. */-select, input, textarea { background: var(--field); color: var(--ink); }option { background: var(--field); color: var(--ink); }+/* Copied from slides/src/styles.css as it stands (the suite's one field look,+ docs/DECISIONS.md 2026-10-17). spaces' --field, --line, --ink and+ --accent-ink are the same roles; a design (#559) re-points them inside its+ page surface. Context rules below only SIZE a field. In spaces the block is+ guarded by scripts/test-spaces-fields-browser.mjs. */+/* ————— THE FIELD — one look for every text field, select and textarea ———————+ The suite's reference: dash, spaces and type copy this block as it stands.+ Every chrome field gets it with no class to remember, so a new field cannot+ come out in the browser's own dress — the grey inset 2px border, square+ corners, and in dark theme a #3b3b3b fill nobody chose (five of slides'+ fields had exactly that, each with its own rule that forgot one property).++ :where() keeps the specificity at ZERO, so a context rule that only sizes a+ field (width, flex, font-weight) layers on top without restating the look,+ and a field that is deliberately not a box (the ghost title, the password+ gate's own card) overrides it with an ordinary class. The ring sits ON the+ border (offset -1px), so no scroll container can clip it. Checkboxes,+ radios, ranges and file pickers keep their native controls. Guarded by+ scripts/test-slides-fields-browser.mjs. */+:where(input:not([type='checkbox'], [type='radio'], [type='range'], [type='file'], [type='color'], [type='button'], [type='submit'], [type='reset'], [type='image'], [type='hidden']), select, textarea) {+ box-sizing: border-box;+ height: 26px;+ padding: 0 6px;+ font: inherit;+ font-size: 12.5px;+ color: var(--ink);+ background: var(--field);+ border: 1px solid var(--line);+ border-radius: 6px;+}+:where(textarea) { height: auto; padding: 6px 8px; line-height: 1.5; resize: vertical; }+:where(input[type='color']) {+ box-sizing: border-box;+ height: 26px;+ padding: 1px 2px;+ background: var(--field);+ border: 1px solid var(--line);+ border-radius: 6px;+}+:where(input, select, textarea):focus-visible { outline: 2px solid var(--accent-ink); outline-offset: -1px; }+/* ————— shell ————— */.sp-app { height: 100%; display: flex; flex-direction: column; overflow: hidden; }@@ -327,13 +364,14 @@ option { background: var(--field); color: var(--ink); }/* Sized, not greedy: a title input that eats the slack pushed undo/redo awayfrom the document they belong to and left them floating mid-bar. Thespacer is the right group's margin-inline-start:auto. */+ /* a GHOST field, as slides' deck title: no box at rest, the shared field's+ border on hover, its fill and amber ring once focused */flex: 0 1 220px; width: 220px; min-width: 48px;- font: inherit; font-size: 14px; font-weight: 400; color: var(--ink);- background: transparent; border: 1px solid transparent;- border-radius: 6px; padding: 5px 8px;+ height: auto; font-size: 14px; font-weight: 400;+ background: transparent; border-color: transparent; padding: 5px 8px;}.sp-doctitle:hover { border-color: var(--line); }-.sp-doctitle:focus { background: var(--field); border-color: var(--blue); outline: none; }+.sp-doctitle:focus { background: var(--field); border-color: var(--line); }.sp-status {font-size: 12px; color: var(--muted); white-space: nowrap;opacity: 0; transition: opacity .18s;@@ -594,10 +632,7 @@ option { background: var(--field); color: var(--ink); }.sp-fmt-btn:hover { background: var(--chrome-2); color: var(--ink); }.sp-fmt-btn.sp-fmt-on { background: var(--chrome-2); color: var(--blue); }.sp-fmt-gap { margin-inline-start: 4px; border-inline-start: 1px solid var(--line); border-radius: 0 6px 6px 0; }-.sp-fmt-url {- font: inherit; font-size: 13px; width: 240px; max-width: 46vw;- padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink);-}+.sp-fmt-url { width: 240px; max-width: 46vw; }.sp-fmt-url.sp-fmt-bad { border-color: var(--c-red); }.sp-fmt-go { color: var(--blue); font-weight: 600; }/* the palette takes the bar over while it is open — two rows, so the bar@@ -999,11 +1034,7 @@ a.sp-embed-src:hover { color: var(--ink); text-decoration: underline; }font-size: 11px; font-weight: 700; text-transform: uppercase;letter-spacing: 0.06em; color: var(--muted); margin: 2px 4px 8px;}-.sp-find {- width: 100%; font: inherit; font-size: 13px; padding: 5px 8px; color: var(--ink);- background: var(--field); border: 1px solid var(--line); border-radius: 6px;-}-.sp-find:focus { border-color: var(--blue); outline: none; }+.sp-find { width: 100%; }.sp-results { list-style: none; margin: 8px 0 0; padding: 0; }.sp-result {display: flex; align-items: center; gap: 10px;@@ -1113,7 +1144,7 @@ a.sp-embed-src:hover { color: var(--ink); text-decoration: underline; }/* a labelled field, the shape slides' document properties use */.sp-ab-field { display: flex; align-items: center; gap: 10px; padding: 2px 4px 8px; }.sp-ab-field label { flex: 0 0 auto; font-size: 12px; color: var(--muted); }-.sp-ab-field .sp-input { flex: 1 1 auto; min-width: 0; font-size: 13px; padding: 5px 8px; border-radius: 6px; background: var(--field); }+.sp-ab-field .sp-input { flex: 1 1 auto; min-width: 0; }/* `.sp-btn` is transparent by design — the topbar is icon-only and a row ofoutlined boxes there would be noise. In THIS card the same class has to read@@ -1172,12 +1203,7 @@ a.sp-embed-src:hover { color: var(--ink); text-decoration: underline; }.sp-ab-confirm .sp-actions { padding: 0; }.sp-about .sp-ab-go { background: #a3231a; color: #fff; border-color: #a3231a; }.sp-about .sp-ab-go:hover { background: #8a1d15; }-.sp-ab-json {- width: 100%; margin-bottom: 8px;- font: 11.5px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace;- color: var(--ink); background: #fff;- border: 1px solid var(--line); border-radius: 8px; padding: 8px; resize: vertical;-}+.sp-ab-json { width: 100%; margin-bottom: 8px; font: 11.5px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; }.sp-ab-json.sp-ab-bad { border-color: #a3231a; }.sp-ab-fine {@@ -1188,7 +1214,6 @@ a.sp-embed-src:hover { color: var(--ink); text-decoration: underline; }sticky footer inside a scroll container is one more thing to clip. */.sp-ab-foot { display: flex; justify-content: flex-end; padding: 10px 4px 2px; }.sp-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px; font-size: 14px; }-.sp-select { font: inherit; font-size: 13px; padding: 6px 8px; color: var(--ink); background: var(--field); border: 1px solid var(--line); border-radius: 8px; }.sp-actions { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 4px; }.sp-mono { font: 12.5px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); }@@ -1580,7 +1605,7 @@ a.sp-embed-src:hover { color: var(--ink); text-decoration: underline; }background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);box-shadow: 0 12px 34px rgb(var(--shade) / .2);}-.sp-findbar .sp-find { width: 190px; padding: 6px 9px; font-size: 13.5px; }+.sp-findbar .sp-find { width: 190px; }.sp-findcount { font-size: 12px; color: var(--muted); min-width: 68px; text-align: center; }.sp-b.sp-hit { background: color-mix(in srgb, var(--accent) 22%, transparent); border-radius: 4px; transition: background .5s; }@@ -2077,13 +2102,8 @@ body.sp-col-resizing { cursor: col-resize; user-select: none; }}.sp-insp-lbl { color: var(--ink-2); flex: 0 1 auto; min-width: 0; }.sp-insp-row > :not(.sp-insp-lbl) { flex: 0 0 auto; max-width: 60%; }-.sp-insp-txt, .sp-insp-num {- font: inherit; font-size: 12.5px; color: var(--ink);- background: var(--field); border: 1px solid var(--line); border-radius: 7px;- padding: 4px 7px; width: 148px; min-width: 0;-}+.sp-insp-txt, .sp-insp-num { width: 148px; min-width: 0; }.sp-insp-num { width: 64px; }-.sp-insp-txt:focus, .sp-insp-num:focus { outline: none; border-color: var(--blue); }.sp-insp-tog { width: 15px; height: 15px; accent-color: var(--blue); }.sp-insp-step { display: inline-flex; align-items: center; gap: 2px; }.sp-insp-step .sp-btn { padding: 2px 8px; line-height: 1.2; }@@ -2441,7 +2461,7 @@ button.sp-issue-set:hover { background: var(--chrome-2); border-color: var(--edga fixed popover would instead grow to the cap as soon as a note wraps */.sp-pop.sp-people:not(.sp-sheet) { width: 250px; }.sp-share-name { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }-.sp-share-name .sp-input { flex: 1; min-width: 0; padding: 5px 8px; border-radius: 6px; font-size: 12.5px; background: var(--field); }+.sp-share-name .sp-input { flex: 1; min-width: 0; }/* a stacked field (the link card's) */.sp-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }.sp-field-lbl { font-size: 12px; color: var(--muted); }@@ -2449,10 +2469,7 @@ button.sp-issue-set:hover { background: var(--chrome-2); border-color: var(--edgfont-size: 10.5px; font-weight: 700; text-transform: uppercase;letter-spacing: 0.07em; color: var(--muted); margin-top: 3px;}-.sp-input {- font: inherit; padding: 6px 8px; border: 1px solid var(--line);- border-radius: 7px; background: var(--bg); color: var(--ink); width: 100%;-}+.sp-input { width: 100%; }.sp-plist { display: flex; flex-direction: column; gap: 2px; max-height: 240px; overflow-y: auto; }.sp-pitem {display: flex; align-items: center; gap: 8px; width: 100%;@@ -2560,10 +2577,7 @@ button.sp-issue-set:hover { background: var(--chrome-2); border-color: var(--edg.sp-cm-entry b { font-size: 12.5px; }.sp-cm-time { color: var(--muted); font-size: 11px; margin-inline-start: 6px; }.sp-cm-entry p { margin: 2px 0 0; font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }-.sp-cm-reply {- width: 100%; resize: vertical; font: inherit; font-size: 13px;- padding: 6px 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--field);-}+.sp-cm-reply { width: 100%; }.sp-cm-foot { display: flex; gap: 6px; padding: 8px 6px 4px; }@media (max-width: 820px) {/* no end margin is reserved at this width — the marker tucks into the@@ -3144,6 +3158,6 @@ body.sp-canvas-dragging { user-select: none; cursor: grabbing; }.sp-dsg-item .bkm-ico { align-items: center; }.sp-dsg-item .sp-dsg-sw b { height: 16px; }.sp-insp-dsg { max-width: 62%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }-.sp-dsg-cols input[type='color'] { width: 44px; height: 26px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: var(--field); }+.sp-dsg-cols input[type='color'] { width: 44px; }@media (max-width: 720px) { .sp-dsg-panel { top: auto; height: 62vh; inset-inline: 8px; width: auto; } }@media print { .sp-dsg-panel { display: none !important; } }