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
12 changes: 12 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,15 @@ tests/fixtures/seal_view/** -text
packages/seal-view/test/fixtures/** -text
# Exact upload bytes; Cloud pins this file's SHA-256.
packages/flow/tests/fixtures/public_seal/golden_vectors.json -text

# Preserve the exact upstream license bytes, including prose whitespace.
packages/desktop/src/styles/vendor/semantic-theme/fonts/OFL-*.txt whitespace=-blank-at-eol
packages/desktop/openadapt_desktop/portal/shell/fonts/OFL-*.txt whitespace=-blank-at-eol

# Hash-bound exports must not change when a checkout enables CRLF conversion.
packages/desktop/src/styles/vendor/** -text
packages/desktop/openadapt_desktop/portal/shell/fonts/** -text
# The plain-file theme generator checks these outputs with stable LF endings.
packages/desktop/openadapt_desktop/portal/shell/styles.css text eol=lf
packages/desktop/openadapt_desktop/portal/shell/index.html text eol=lf
packages/desktop/openadapt_desktop/portal/shell/manifest.webmanifest text eol=lf
12 changes: 12 additions & 0 deletions packages/desktop/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
# CHANGELOG


## v0.32.0 (2026-11-22)

### Features

- **design**: share Desktop overlay and phone theme roles

### Bug Fixes

- **desktop**: preserve pinned theme bytes on checkout



## v0.31.3 (2026-11-22)

### Bug Fixes
Expand Down
2 changes: 1 addition & 1 deletion packages/desktop/openadapt_desktop/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@
+-- backends/ Storage backend plugins
"""

__version__ = "0.31.3"
__version__ = "0.32.0"
2 changes: 2 additions & 0 deletions packages/desktop/openadapt_desktop/portal/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@
SHELL_ASSETS: dict[str, tuple[str, str]] = {
"/app.js": ("shell/app.js", "application/javascript; charset=utf-8"),
"/styles.css": ("shell/styles.css", "text/css; charset=utf-8"),
"/fonts/PublicSans-Variable.woff2": ("shell/fonts/PublicSans-Variable.woff2", "font/woff2"),
"/fonts/OFL-PublicSans.txt": ("shell/fonts/OFL-PublicSans.txt", "text/plain; charset=utf-8"),
"/manifest.webmanifest": (
"shell/manifest.webmanifest",
"application/manifest+json; charset=utf-8",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
Copyright 2015 The Public Sans Project Authors (https://github.com/uswds/public-sans)

This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
https://scripts.sil.org/OFL


-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------

PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.

The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.

DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.

"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).

"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).

"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.

"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.

PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:

1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.

2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.

3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.

4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.

5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.

TERMINATION
This license becomes null and void if any of the above conditions are
not met.

DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
Binary file not shown.
4 changes: 2 additions & 2 deletions packages/desktop/openadapt_desktop/portal/shell/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<meta name="referrer" content="no-referrer">
<meta name="robots" content="noindex, nofollow, noarchive">
<meta name="color-scheme" content="dark light">
<meta name="theme-color" media="(prefers-color-scheme: dark)" content="#0B1220">
<meta name="theme-color" media="(prefers-color-scheme: light)" content="#F5F7FA">
<meta name="theme-color" media="(prefers-color-scheme: dark)" content="#05080d">
<meta name="theme-color" media="(prefers-color-scheme: light)" content="#ffffff">
<title>OpenAdapt decisions</title>
<link rel="manifest" href="/manifest.webmanifest">
<link rel="stylesheet" href="/styles.css">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
"scope": "/",
"display": "standalone",
"orientation": "portrait",
"background_color": "#0B1220",
"theme_color": "#0B1220"
"background_color": "#05080d",
"theme_color": "#05080d"
}
89 changes: 42 additions & 47 deletions packages/desktop/openadapt_desktop/portal/shell/styles.css
Original file line number Diff line number Diff line change
@@ -1,59 +1,54 @@
/* The phone shell: one decision card in the reading zone, two answers in the
thumb zone. Dark first, with a light theme from the system setting.

The shell is served by the engine as plain files with no bundler, so it
cannot import the vendored token stylesheet. Every literal colour below is
copied from the canonical design tokens in
src/styles/vendor/openadapt-web/tokens.json: the dark theme from the inset
set, the light theme from the page set. A dark value the canonical set does
not have is mixed from canonical values, never picked.
tests/test_portal/test_shell_palette.py fails if a copy stops matching. */
/* Generated by scripts/build-phone-theme.mjs from the pinned semantic theme.
Public Sans is SIL OFL 1.1; its license is /fonts/OFL-PublicSans.txt. */
@font-face { font-family: "Public Sans"; src: url("/fonts/PublicSans-Variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
:root {
color-scheme: dark;
--bg: #0B1220; /* --inset-bg */
--panel: #131C2C; /* --inset-raised */
--line: #1E293B; /* --inset-border */
--text: #E2E8F0; /* --inset-text */
--accent: #34D399; /* --inset-ok */
--warn: #FBBF24; /* --inset-warn */
--success: #34D399; /* --inset-ok */
--panel-2: color-mix(in srgb, var(--panel) 90%, var(--text));
--muted: color-mix(in srgb, var(--text) 68%, var(--bg));
--faint: color-mix(in srgb, var(--text) 46%, var(--bg));
--accent-ink: var(--bg);
--danger: color-mix(in srgb, #B3261E 55%, #FFFFFF); /* --accent-danger, lifted */
--teach: color-mix(in srgb, #574FB0 50%, #FFFFFF); /* --link-visited, lifted */
--focus: color-mix(in srgb, #2563EB 70%, #FFFFFF); /* --focus-ring, lifted */
--bg: #05080d;
--panel: #0a0f17;
--panel-2: #0d141f;
--line: #1a2432;
--text: #edf1f7;
--muted: #9ba7b7;
--faint: #9ba7b7;
--accent: #79adff;
--accent-ink: #04101f;
--warn: #f5b640;
--success: #3ad69f;
--danger: #ff8f86;
--teach: #79adff;
--focus: #a2c6ff;
--action: #edf1f7;
--on-action: #05080d;
--font-body: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
--font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
--accent-glow: color-mix(in srgb, var(--accent) 26%, transparent);
--danger-glow: color-mix(in srgb, var(--danger) 24%, transparent);
--warn-soft: color-mix(in srgb, var(--warn) 13%, transparent);
--scrim: rgba(4, 7, 13, 0.72);
--shadow: 0 24px 60px -34px rgba(0, 0, 0, 0.7);
--font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
--font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
--scrim: color-mix(in srgb, var(--bg) 72%, transparent);
--shadow: 0 24px 60px -34px color-mix(in srgb, var(--text) 20%, transparent);
}

@media (prefers-color-scheme: light) {
:root {
color-scheme: light;
--bg: #F5F7FA; /* --surface */
--panel: #FFFFFF; /* --surface-raised */
--panel-2: #EDF1F6; /* --surface-sunken */
--line: #DEE4EC; /* --hairline */
--text: #0B1220; /* --ink */
--muted: #414E63; /* --text-secondary */
--faint: #5A697F; /* --text-tertiary */
--accent: #0B7A5A; /* --accent-verified */
--accent-ink: #FFFFFF;
--warn: #9A5B0A; /* --accent-halt */
--success: #0B7A5A; /* --accent-verified */
--danger: #B3261E; /* --accent-danger */
--teach: #574FB0; /* --link-visited */
--focus: #2563EB; /* --focus-ring */
--scrim: rgba(11, 18, 32, 0.4);
--shadow: 0 24px 60px -36px rgba(11, 18, 32, 0.35);
--bg: #ffffff;
--panel: #f5f7fa;
--panel-2: #edf2f5;
--line: #dde3e9;
--text: #0f1722;
--muted: #4f5a67;
--faint: #4f5a67;
--accent: #1f4fbf;
--accent-ink: #ffffff;
--warn: #9a5b0a;
--success: #0b7a5a;
--danger: #b3261e;
--teach: #1f4fbf;
--focus: #1f4fbf;
--action: #0f1722;
--on-action: #ffffff;
}
}
/* END GENERATED PHONE THEME */

* { box-sizing: border-box; }
[hidden] { display: none !important; }
Expand Down Expand Up @@ -93,7 +88,7 @@ button { font: inherit; color: inherit; }
.mark::after { content: ""; position: absolute; inset: 5px; border-radius: 2px; background: var(--bg); }
.status { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); min-width: 0; }
.device { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 22%, transparent); flex: none; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); flex: none; }
body.offline .dot { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-glow); }

.offline-bar { margin: 10px 0 0; padding: 9px 12px; border-radius: 12px; background: var(--danger-glow); color: var(--danger); font-size: 13px; flex: none; }
Expand Down Expand Up @@ -212,7 +207,7 @@ body.offline .dot { background: var(--danger); box-shadow: 0 0 0 3px var(--dange
.ans:active { transform: scale(0.97); }
.ans svg { width: 20px; height: 20px; flex: none; }
.ans.no { color: var(--danger); }
.ans.yes.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.ans.yes.primary { background: var(--action); color: var(--on-action); border-color: var(--action); }
.ans[disabled] { opacity: 0.38; cursor: not-allowed; }
.ans.slot { visibility: hidden; }
.more { width: 48px; height: 48px; border-radius: 16px; border: 1px solid var(--line); background: none; display: grid; place-items: center; cursor: pointer; color: var(--muted); }
Expand Down
2 changes: 2 additions & 0 deletions packages/desktop/openadapt_desktop/portal/shell/sw.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ const SHELL_ASSETS = Object.freeze([
"/",
"/app.js",
"/styles.css",
"/fonts/PublicSans-Variable.woff2",
"/fonts/OFL-PublicSans.txt",
"/manifest.webmanifest",
]);

Expand Down
4 changes: 2 additions & 2 deletions packages/desktop/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions packages/desktop/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "openadapt-desktop",
"version": "0.31.3",
"version": "0.32.0",
"description": "Installed companion for OpenAdapt authoring, teaching, and local pairing",
"private": true,
"type": "module",
Expand All @@ -11,7 +11,9 @@
"tokens:check": "node scripts/vendor-design-tokens.mjs --check",
"capture:cockpit": "node scripts/capture-cockpit-previews.mjs",
"preview": "vite preview",
"tauri": "tauri"
"tauri": "tauri",
"theme:check": "node scripts/check-semantic-theme.mjs src/styles/vendor/semantic-theme",
"prebuild": "npm run theme:check && node scripts/build-phone-theme.mjs --check"
},
"devDependencies": {
"@tauri-apps/cli": "^2",
Expand Down
2 changes: 1 addition & 1 deletion packages/desktop/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "openadapt-desktop"
version = "0.31.3"
version = "0.32.0"
description = "The OpenAdapt desktop app and local engine: record a data-entry task, run it on a list, and check each saved record"
readme = "README.md"
requires-python = ">=3.11"
Expand Down
34 changes: 34 additions & 0 deletions packages/desktop/scripts/build-phone-theme.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// Generate the plain-file phone shell from the same pinned theme as Desktop.
// The font uses the existing exact static-asset map; the CSP stays unchanged.
import fs from 'node:fs';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
const vendor = path.join(root, 'src/styles/vendor/semantic-theme');
const shell = path.join(root, 'openadapt_desktop/portal/shell');
const theme = JSON.parse(fs.readFileSync(path.join(vendor, 'semantic-theme.json'), 'utf8'));
const roles = { '--bg':'--oa-canvas', '--panel':'--oa-surface', '--panel-2':'--oa-surface-sunken', '--line':'--oa-border', '--text':'--oa-text', '--muted':'--oa-text-muted', '--faint':'--oa-text-muted', '--accent':'--oa-link', '--accent-ink':'--oa-on-link', '--warn':'--oa-stopped', '--success':'--oa-verified', '--danger':'--oa-reconcile', '--teach':'--oa-link', '--focus':'--oa-focus', '--action':'--oa-text', '--on-action':'--oa-canvas' };
const declaration = (colors) => Object.entries(roles).map(([name, source]) => ` ${name}: ${colors[source]};`).join('\n');
fs.mkdirSync(path.join(shell, 'fonts'), { recursive: true });
for (const name of ['PublicSans-Variable.woff2', 'OFL-PublicSans.txt']) {
const source = fs.readFileSync(path.join(vendor, 'fonts', name));
const destination = path.join(shell, 'fonts', name);
if (process.argv.includes('--check')) { if (!fs.existsSync(destination) || !fs.readFileSync(destination).equals(source)) throw new Error(`Phone font drift: ${name}`); }
else fs.writeFileSync(destination, source);
}
const marker = '/* END GENERATED PHONE THEME */';
const prefix = `/* Generated by scripts/build-phone-theme.mjs from the pinned semantic theme.\nPublic Sans is SIL OFL 1.1; its license is /fonts/OFL-PublicSans.txt. */\n@font-face { font-family: "Public Sans"; src: url("/fonts/PublicSans-Variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }\n:root {\n color-scheme: dark;\n${declaration(theme.themes.dark)}\n --font-body: ${theme.common['--oa-font-body']};\n --font-mono: ${theme.common['--oa-font-mono']};\n --accent-glow: color-mix(in srgb, var(--accent) 26%, transparent);\n --danger-glow: color-mix(in srgb, var(--danger) 24%, transparent);\n --warn-soft: color-mix(in srgb, var(--warn) 13%, transparent);\n --scrim: color-mix(in srgb, var(--bg) 72%, transparent);\n --shadow: 0 24px 60px -34px color-mix(in srgb, var(--text) 20%, transparent);\n}\n@media (prefers-color-scheme: light) {\n :root {\n color-scheme: light;\n${declaration(theme.themes.light)}\n }\n}\n${marker}`;
const stylesheet = path.join(shell, 'styles.css');
const existing = fs.readFileSync(stylesheet, 'utf8');
const tail = existing.includes(marker) ? existing.slice(existing.indexOf(marker) + marker.length) : '\n\n' + existing.slice(existing.indexOf('* { box-sizing'));
const css = prefix + tail;
const htmlPath = path.join(shell, 'index.html');
const html = fs.readFileSync(htmlPath, 'utf8').replace(/(name="theme-color" media="\(prefers-color-scheme: )(dark|light)(\)" content=")[^"]+("\s*>)/g, (_, a, mode, b, c) => a + mode + b + theme.themes[mode]['--oa-canvas'] + c);
const manifestPath = path.join(shell, 'manifest.webmanifest');
const manifest = JSON.parse(fs.readFileSync(manifestPath, 'utf8'));
manifest.background_color = theme.themes.dark['--oa-canvas'];
manifest.theme_color = theme.themes.dark['--oa-canvas'];
for (const [file, result] of [[stylesheet, css], [htmlPath, html], [manifestPath, JSON.stringify(manifest, null, 2) + '\n']]) {
if (process.argv.includes('--check')) { if (fs.readFileSync(file, 'utf8') !== result) throw new Error(`Phone theme drift: ${path.basename(file)}. Run node scripts/build-phone-theme.mjs.`); }
else fs.writeFileSync(file, result);
}
24 changes: 24 additions & 0 deletions packages/desktop/scripts/check-semantic-theme.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Check an immutable vendored snapshot. This does not claim it is the live theme.
import crypto from 'node:crypto';
import fs from 'node:fs';
import path from 'node:path';
const root = process.argv[2];
if (!root) throw new Error('Usage: node check-semantic-theme.mjs <vendor-directory>');
const provenance = JSON.parse(fs.readFileSync(path.join(root, 'provenance.json'), 'utf8'));
if (provenance.version !== 2 || provenance.source !== 'OpenAdaptAI/openadapt-web' || !/^[a-f0-9]{40}$/.test(provenance.commit)) throw new Error('Invalid semantic theme provenance.');
for (const [name, entry] of Object.entries(provenance.files)) {
if (path.isAbsolute(name) || name.split(/[\\/]/).includes('..')) throw new Error('Invalid theme path.');
const hash = crypto.createHash('sha256').update(fs.readFileSync(path.join(root, name))).digest('hex');
if (hash !== entry.sha256) throw new Error(`Semantic theme drift: ${name}`);
}
for (const required of ['semantic-theme.css', 'semantic-theme.json', 'fonts.css', 'fonts/OFL-PublicSans.txt', 'fonts/OFL-InterTight.txt']) {
if (!provenance.files[required]) throw new Error(`Missing semantic theme member: ${required}`);
}
const licenses = process.argv.indexOf('--licenses');
if (licenses !== -1) {
const destination = process.argv[licenses + 1];
if (!destination) throw new Error('--licenses requires a destination.');
fs.mkdirSync(destination, { recursive: true });
for (const name of ['OFL-PublicSans.txt', 'OFL-InterTight.txt']) fs.copyFileSync(path.join(root, 'fonts', name), path.join(destination, name));
}
console.log(`Semantic theme v2 matches pinned ${provenance.commit}: ${Object.keys(provenance.files).length} files.`);
Loading