Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 54 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,22 @@ jobs:
# SharedWorker startup, cross-tab BroadcastChannel fan-out, IndexedDB.
#
# The browser is cached, keyed on Playwright's version, so most runs do not
# download it at all. The download is what hung: three times on 2026-10-23,
# 7-10 minutes each against 20-27 seconds healthy, and a re-run on another
# runner always went straight through. So each attempt gets two minutes and
# three tries, and a stall costs two minutes rather than a cancelled run.
# The system packages (`install-deps`) still install every run -- they are
# not in the cache path -- under the same retries.
# download it at all. The download is what hung first: three times on
# 2026-10-23, 7-10 minutes each against 20-27 seconds healthy.
#
# Then the system packages hung, twice in two days (2026-11-18 and -19), on a
# cache hit: `install-deps` ran apt against Ubuntu's mirror every run, and the
# mirror took ~7.5 minutes for ~20 MB -- CJK and symbol fonts, and an update to
# a libgbm the image already had. None of it is needed: the runner image has
# every library Chromium links against ("already the newest version", line
# after line) and the suite renders Latin text. The per-attempt timeout did
# not save it either: apt ran under Playwright's own `sudo`, outside the
# process group `timeout` signals, so one attempt ate the step's 8 minutes.
#
# So: get the browser (cache, or a download that `timeout` can kill), then
# launch it. If it starts, apt is never touched. Only if it does not are the
# packages installed, with `timeout` running as root inside `sudo`, where it
# kills apt itself, and then it has to start.
- name: Find Playwright's version
id: playwright
run: echo "version=$(apps/fixture/node_modules/.bin/playwright --version | awk '{print $2}')" >> "$GITHUB_OUTPUT"
Expand All @@ -112,25 +122,48 @@ jobs:
env:
CACHED: ${{ steps.browsers.outputs.cache-hit }}
run: |
if [ "$CACHED" = true ]; then what='install-deps chromium'; else what='install --with-deps chromium'; fi

# Which Ubuntu, in the log and as a notice, so a failure here says
# whether it is the runner image rather than leaving that to be guessed.
echo "::notice title=runner::$(. /etc/os-release && echo "$PRETTY_NAME")"

for attempt in 1 2 3; do
# `timeout` signals the whole process group, so a hung apt-get under
# sudo goes with Playwright rather than holding the dpkg lock.
if timeout --kill-after=10 120 apps/fixture/node_modules/.bin/playwright $what 2>&1 | tee "$RUNNER_TEMP/chromium.log"; [ "${PIPESTATUS[0]}" -eq 0 ]; then exit 0; fi
# Playwright's own last error, as the annotation: the job log is not
# always readable from where a failure is diagnosed.
said=$(grep -iE 'error|not support|unable|failed' "$RUNNER_TEMP/chromium.log" | tail -1 | cut -c1-200)
echo "::warning::Chromium install attempt $attempt failed or stalled: ${said:-no error printed}"
sleep $((attempt * 10))
done

echo "::error::Chromium did not install in three attempts"
exit 1
cli="$PWD/apps/fixture/node_modules/playwright/cli.js"
node="$(command -v node)"

# Three tries, two minutes each. The last line Playwright said goes in
# the annotation: the job log is not always readable from where a
# failure is diagnosed.
attempts() {
what=$1
shift
for attempt in 1 2 3; do
if "$@" 2>&1 | tee "$RUNNER_TEMP/chromium.log"; [ "${PIPESTATUS[0]}" -eq 0 ]; then return 0; fi
said=$(grep -iE 'error|not support|unable|failed' "$RUNNER_TEMP/chromium.log" | tail -1 | cut -c1-200)
echo "::warning::Chromium $what, attempt $attempt, failed or stalled: ${said:-no error printed}"
sleep $((attempt * 10))
done
return 1
}

# Does the browser start? Launched exactly as the suite launches it --
# Playwright's own Chromium, or CHROMIUM_PATH where that is set. A
# missing library fails here, at launch.
starts() {
(cd apps/fixture && timeout 60 "$node" -e "require('playwright').chromium.launch({ executablePath: process.env.CHROMIUM_PATH || undefined }).then((browser) => browser.close())")
}

if [ "$CACHED" != true ]; then
attempts download timeout --kill-after=10 120 "$node" "$cli" install chromium || { echo "::error::Chromium did not download in three attempts"; exit 1; }
fi

if starts; then
echo "::notice title=chromium::starts on the runner image as it is; no system packages installed"
exit 0
fi

echo "::warning::Chromium does not start on the runner image; installing its system packages"
attempts packages sudo timeout --kill-after=10 120 "$node" "$cli" install-deps chromium || { echo "::error::Chromium's system packages did not install in three attempts"; exit 1; }

starts || { echo "::error::Chromium does not start even with its system packages installed"; exit 1; }

- name: Smoke test
working-directory: apps/fixture
Expand Down
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,31 @@ Every published package shares a version — `@single-studio/core`,
`@single-studio/provider-supabase` and the four plugins go out as one release. The
tag is checked against all six manifests, so they cannot drift apart.

## 0.18.0

The board in a font of its own, so it measures the same on every machine, and a top
bar that no longer flashes a scrollbar when hovered. A minor because every board
changes font without being asked, and `--ss-font` is new.

### Changed

- **The board ships its own font, Inter.** It used each machine's own -- Segoe UI on
the Windows PC running OBS, San Francisco on a Mac -- so the same dock wrapped and
truncated text at different widths on each, and a layout made on one machine moved
on another. Inter (OFL) comes with core as a dependency, is served by the studio's
own build, and a browser fetches only the alphabets on the page: 48 kB for Latin.
`--ss-font` on `.ss-control` sets another. **Graphics are unchanged**: the framework
never picks a font for anything on air. The getting-started guide has a new Fonts
section on loading one for graphics.

### Fixed

- **Hovering the board's top bar no longer flashes a scrollbar.** Revealing the cog
and save made the page wider than the window for its first two frames -- the save
button drew up to 20px past the edge while its box was still opening -- so a
horizontal scrollbar flickered. The top bar now clips sideways overflow; its menu
and tooltips still drop below it.

## 0.17.1

The release 0.17.0 was meant to be. `v0.17.0` was tagged on the commit before the
Expand Down
73 changes: 73 additions & 0 deletions apps/fixture/e2e/smoke.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3372,6 +3372,79 @@ check(
'a board with no BoardBar -- an empty one included -- has no second bar, and its header is the top bar alone',
)

// The board ships its own font, so it measures the same on every machine: with
// nothing set it took the system's -- Segoe UI on the PC running OBS, San Francisco
// on a Mac -- and wrapped and truncated at different widths on each. Graphics keep
// theirs, since a font change on air is the studio's call.
const boardFont = await control.evaluate(async () => {
await document.fonts.ready
const family = getComputedStyle(document.querySelector('.ss-panel h2')).fontFamily
const style = document.createElement('style')

style.textContent = '.ss-control { --ss-font: Georgia, serif; }'
document.head.append(style)
const set = getComputedStyle(document.querySelector('.ss-panel h2')).fontFamily
style.remove()

return { family, set, loaded: [...document.fonts].some((face) => face.family === 'Inter Variable' && face.status === 'loaded') }
})
const graphicFont = await (async () => {
const graphic = await context.newPage()

await graphic.goto(`${BASE}/#/source/scoreboard`)
await graphic.waitForSelector('.ss-source')
// The graphic's root, which only inherits: the scoreboard inside it names a font of
// its own, so a font leaking onto graphics would not show there.
const family = await graphic.evaluate(() => getComputedStyle(document.querySelector('.ss-source')).fontFamily)

await graphic.close()
return family
})()
console.log(` board font: ${JSON.stringify(boardFont)}; a graphic's: ${graphicFont}`)
check(
boardFont.loaded && /^"Inter Variable"/.test(boardFont.family),
'the board draws in the font it ships, Inter, loaded from the studio rather than the machine',
)
check(/^Georgia/.test(boardFont.set) && !/Inter/.test(graphicFont), 'a studio that sets --ss-font gets its own, and graphics keep theirs')

// Hovering the top bar reveals the cog and save, and the reveal widened the page for
// its first two frames -- the save button drew 20px past the window -- so a
// scrollbar flashed. Every frame of it is sampled here, and the menu has to open below
// the bar all the same.
const revealPage = await context.newPage()
await revealPage.setViewportSize({ width: 1280, height: 700 })
await revealPage.goto(`${BASE}/#/`)
await revealPage.waitForSelector('.ss-control-bar h1')
await revealPage.waitForTimeout(400)
await revealPage.mouse.move(640, 500)
await revealPage.evaluate(() => {
window.__widened = 0
window.__frames = 0
const start = performance.now()
const frame = () => {
window.__frames += 1
if (document.documentElement.scrollWidth > innerWidth) window.__widened += 1
if (performance.now() - start < 600) requestAnimationFrame(frame)
}
requestAnimationFrame(frame)
})
await revealPage.hover('.ss-control-bar h1')
await revealPage.waitForTimeout(700)
const reveal = await revealPage.evaluate(() => ({ widened: window.__widened, frames: window.__frames }))
await revealPage.click('.ss-menu-open')
const menuShown = await becomes(revealPage, () => {
const panel = document.querySelector('.ss-menu-panel')
const box = panel?.getBoundingClientRect()

return Boolean(box && box.height > 100 && panel.contains(document.elementFromPoint(box.left + box.width / 2, box.top + box.height / 2)))
})
console.log(` top bar reveal: ${reveal.widened} of ${reveal.frames} frames wider than the window`)
check(
reveal.frames > 10 && reveal.widened === 0 && menuShown,
'revealing the top bar never makes the page wider than the window, and its menu still opens below it',
)
await revealPage.close()

const barPage = await context.newPage()
await barPage.setViewportSize({ width: 1280, height: 500 })
await barPage.goto(`${BASE}/?boardbar#/`)
Expand Down
6 changes: 3 additions & 3 deletions demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
"preview": "vite preview"
},
"dependencies": {
"@single-studio/core": "^0.17.1",
"@single-studio/plugin-twitch": "^0.17.1",
"@single-studio/provider-supabase": "^0.17.1",
"@single-studio/core": "^0.18.0",
"@single-studio/plugin-twitch": "^0.18.0",
"@single-studio/provider-supabase": "^0.18.0",
"react": "^19.3.1",
"react-dom": "^19.3.1",
"react-router-dom": "^7.18.4",
Expand Down
31 changes: 31 additions & 0 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -1071,6 +1071,37 @@ adds at-rules the built-in CSS checker has not been taught. The template ships a
`.vscode/settings.json` that silences it, and recommends the Tailwind IntelliSense
extension, which understands them properly.

### Fonts

The board ships its own font, Inter, so it looks and measures the same on every
machine: the Windows PC running OBS, a Mac, a tablet. Without it the board borrowed
each machine's own — Segoe UI on Windows, San Francisco on a Mac — and the same dock
wrapped and cut off text at different widths on each. It comes with the framework and
is served by your own build, so a dock with no internet still has it; a browser
fetches only the alphabets on the page, 48 kB for Latin. To use another, set it on the
board:

```css
.ss-control {
--ss-font: 'Atkinson Hyperlegible', sans-serif;
}
```

**Graphics keep whatever font you give them**, and with none, the machine's own — the
framework does not choose a font for anything that goes to air. A graphic designed on a
Mac and shown on the Windows PC will draw in a different font unless it names one, so
load the one you design with and set it on the graphic. A font from npm is the
simplest, since your build then serves it like the board's:

```css
/* src/css/index.css, after the framework's import */
@import '@fontsource-variable/oswald';

.scoreboard {
font-family: 'Oswald Variable', sans-serif;
}
```

### Splitting it up

Two ways, and they are not equivalent — one of them keeps a graphic's CSS out of
Expand Down
3 changes: 2 additions & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@single-studio/core",
"version": "0.17.1",
"version": "0.18.0",
"description": "Local-first broadcast graphics framework for OBS: replicated state, source graphics, and control surfaces.",
"license": "MIT",
"author": {
Expand Down Expand Up @@ -71,6 +71,7 @@
"types": "tsc -p tsconfig.json"
},
"dependencies": {
"@fontsource-variable/inter": "^5.3.0",
"y-indexeddb": "^9.0.12",
"yjs": "^13.6.20"
},
Expand Down
31 changes: 31 additions & 0 deletions packages/core/src/styles/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,21 @@
* studio writes.
*/

/*
* The board's font, shipped rather than borrowed from the machine. With nothing set
* the board took the system's: Segoe UI on the Windows PC that runs OBS, San
* Francisco on a Mac, Roboto or Noto elsewhere -- different widths, so the same dock
* wrapped and truncated at different places on each, and what the owner laid out on
* Windows moved on a laptop. Segoe UI cannot be redistributed; Inter can (OFL) and
* is built for interfaces at the board's sizes. Variable, one file per script, and a
* browser fetches only the scripts on the page -- Latin, for an English board. Served
* with the studio's own build, so a dock with no internet still has it.
*
* The board's only: graphics are untouched, since a font change on air is the
* studio's call, not an update's.
*/
@import '@fontsource-variable/inter';

@layer components {
/* OBS composites browser sources over the scene, so the page must not paint. */
.ss-source,
Expand Down Expand Up @@ -341,6 +356,9 @@
*/
.ss-control {
color-scheme: dark;
/* --ss-font on .ss-control sets another. The system's own stack stays behind
it, for the moment before the file arrives and for a script Inter lacks. */
font-family: var(--ss-font, 'Inter Variable', ui-sans-serif, system-ui, sans-serif);
}

/*
Expand Down Expand Up @@ -506,6 +524,19 @@
opacity: 1;
}

/*
* The reveal widened the page for two frames. The tools' overflow turns visible the
* moment the bar is hovered while their max-width is still opening from 0, so for
* the first frames the save button draws past its own box -- measured, 20px past a
* 1280px window (24px past a 380px one) -- the page is wider than the window, and a
* scrollbar flashes. Clipped on the horizontal only, so nothing in the bar can widen
* the page, while the cog's menu and the tooltips, which drop below it, still show:
* `clip` keeps the other axis visible, where `hidden` would turn it into a scroller.
*/
.ss-control-bar {
overflow-x: clip;
}

/*
* A tablet has no pointer to rest anywhere, so hiding behind hover there hides for
* good. Touch gets them permanently, which costs a dock nobody is running on a
Expand Down
4 changes: 2 additions & 2 deletions packages/plugin-obs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@single-studio/plugin-obs",
"version": "0.17.1",
"version": "0.18.0",
"description": "OBS for Single Studio: the live scene, stream and record state, straight into a studio over obs-websocket.",
"license": "MIT",
"author": {
Expand Down Expand Up @@ -33,7 +33,7 @@
"test": "vitest run"
},
"peerDependencies": {
"@single-studio/core": "^0.17.1"
"@single-studio/core": "^0.18.0"
},
"devDependencies": {
"@single-studio/core": "workspace:*",
Expand Down
4 changes: 2 additions & 2 deletions packages/plugin-rocket-league/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@single-studio/plugin-rocket-league",
"version": "0.17.1",
"version": "0.18.0",
"description": "Rocket League for Single Studio: score, clock, goals and the stat feed, over Psyonix's own Stats API.",
"license": "MIT",
"author": {
Expand Down Expand Up @@ -34,7 +34,7 @@
"replay": "node dev/replay.mjs"
},
"peerDependencies": {
"@single-studio/core": "^0.17.1"
"@single-studio/core": "^0.18.0"
},
"devDependencies": {
"@single-studio/core": "workspace:*",
Expand Down
4 changes: 2 additions & 2 deletions packages/plugin-sheets/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@single-studio/plugin-sheets",
"version": "0.17.1",
"version": "0.18.0",
"description": "Google Sheets for Single Studio: a shared spreadsheet as a data source, with an API key and no backend.",
"license": "MIT",
"author": {
Expand Down Expand Up @@ -33,7 +33,7 @@
"test": "vitest run"
},
"peerDependencies": {
"@single-studio/core": "^0.17.1"
"@single-studio/core": "^0.18.0"
},
"devDependencies": {
"@single-studio/core": "workspace:*",
Expand Down
4 changes: 2 additions & 2 deletions packages/plugin-twitch/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@single-studio/plugin-twitch",
"version": "0.17.1",
"version": "0.18.0",
"description": "Twitch EventSub for Single Studio: chat, follows, subs, gifts, cheers and raids, straight into a studio with no backend.",
"license": "MIT",
"author": {
Expand Down Expand Up @@ -34,7 +34,7 @@
"mock": "node dev/mock.mjs"
},
"peerDependencies": {
"@single-studio/core": "^0.17.1"
"@single-studio/core": "^0.18.0"
},
"devDependencies": {
"@single-studio/core": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion packages/provider-supabase/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@single-studio/provider-supabase",
"version": "0.17.1",
"version": "0.18.0",
"description": "Collaboration for Single Studio over Supabase Realtime: bring your own key, no backend to deploy.",
"license": "MIT",
"author": {
Expand Down
Loading
Loading