Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ node_modules
# Build outputs
dist/
out/
packages/*/build/
dist-e2e-mac/
dist-e2e-win/
release/
Expand Down
26 changes: 14 additions & 12 deletions docs/design.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,18 +247,20 @@ Workspace tokens share the same visual intent as several shadcn tokens. Workspac

Workspace-only tokens without a shadcn counterpart, plus shadow tokens. For shared surface colors, see **Workspace ↔ shadcn Equivalence** above.

| Token | Tailwind class | Light value | Usage |
| ----------------------------------- | ---------------------------------- | ----------------------------------------------------------------- | ------------------------------------------- |
| `--bg-400` | `bg-bg-400` | `hsl(45 10% 88%)` | Sidebar row action hover |
| `--text-300` | `text-text-300` | `hsl(43 3% 57%)` | Action icon default color and loading dots |
| `--rail-card-bg` | `bg-rail-card-bg` | `hsl(0 0% 100%)` | Sidebar rail card |
| `--danger-000` / `--danger-900` | `text-danger-000`, `bg-danger-900` | `hsl(0 45% 38%)`, `hsl(0 55% 95%)` | Destructive session menu and dialog actions |
| `--action-panel-toggle` | `text-action-panel-toggle` | `hsl(0 0% 42%)` | Collapsed preview toggle |
| `--surface-control-hover` | `hover:bg-surface-control-hover` | `hsl(38 20% 90%)` | Header icon control hover |
| `--message-user-text` | `text-message-user-text` | `hsl(0 0% 12%)` | User message bubble text |
| `--shadow-card` | `shadow-card` | `0 0 0 1px rgb(10 10 10 / 0.06), 0 4px 24px rgb(10 10 10 / 0.04)` | Sidebar rail card and composer dock |
| `--shadow-card-opaque` | `shadow-card-opaque` | `0 0 0 1px rgb(10 10 10 / 0.08), 0 8px 28px rgb(10 10 10 / 0.1)` | Composer form |
| `--shadow-menu` / `--shadow-dialog` | `shadow-menu`, `shadow-dialog` | `0 2px 8px rgb(0 0 0 / 0.08)`, `0 8px 32px rgb(10 10 10 / 12%)` | Menus and modal dialogs |
| Token | Tailwind class | Light value | Usage |
| ----------------------------------- | -------------------------------------------------------------------------------------- | ----------------------------------------------------------------- | ---------------------------------------------------- |
| `--bg-400` | `bg-bg-400` | `hsl(45 10% 88%)` | Sidebar row action hover |
| `--text-300` | `text-text-300` | `hsl(43 3% 57%)` | Action icon default color and loading dots |
| `--rail-card-bg` | `bg-rail-card-bg` | `hsl(0 0% 100%)` | Sidebar rail card |
| `--danger-000` / `--danger-900` | `text-danger-000`, `bg-danger-900` | `hsl(0 45% 38%)`, `hsl(0 55% 95%)` | Destructive session menu and dialog actions |
| `--action-panel-toggle` | `text-action-panel-toggle` | `hsl(0 0% 42%)` | Collapsed preview toggle |
| `--surface-control-hover` | `hover:bg-surface-control-hover` | `hsl(38 20% 90%)` | Header icon control hover |
| `--message-user-text` | `text-message-user-text` | `hsl(0 0% 12%)` | User message bubble text |
| `--diff-added-*` | `bg-diff-added-surface`, `bg-diff-added-highlight`, `text-diff-added-foreground` | Light green surfaces with `hsl(145 60% 24%)` foreground | Added Version-diff rows, inline spans, and markers |
| `--diff-removed-*` | `bg-diff-removed-surface`, `bg-diff-removed-highlight`, `text-diff-removed-foreground` | Light red surfaces with `hsl(0 55% 32%)` foreground | Removed Version-diff rows, inline spans, and markers |
| `--shadow-card` | `shadow-card` | `0 0 0 1px rgb(10 10 10 / 0.06), 0 4px 24px rgb(10 10 10 / 0.04)` | Sidebar rail card and composer dock |
| `--shadow-card-opaque` | `shadow-card-opaque` | `0 0 0 1px rgb(10 10 10 / 0.08), 0 8px 28px rgb(10 10 10 / 0.1)` | Composer form |
| `--shadow-menu` / `--shadow-dialog` | `shadow-menu`, `shadow-dialog` | `0 2px 8px rgb(0 0 0 / 0.08)`, `0 8px 32px rgb(10 10 10 / 12%)` | Menus and modal dialogs |

### Settings Status and Category Tokens

Expand Down
5 changes: 5 additions & 0 deletions e2e/fixtures/electron-app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ const APP_ROOT = resolve(process.cwd())
const FAKE_AGENT_PATH = resolve(APP_ROOT, 'e2e', 'fixtures', 'fake-opencode.mjs')
const FAKE_REMOTEIT_PATH = resolve(APP_ROOT, 'e2e', 'fixtures', 'fake-remoteit.cjs')
const FAKE_PROVIDER_NAME = 'Electron E2E provider'
const E2E_LOCALE_ARGUMENT = '--lang=en-US'
const E2E_SETTINGS = `${JSON.stringify({ localePreference: 'en' }, null, 2)}\n`
type E2eWindowMode = 'hidden' | 'normal'

const electronLaunchTarget = (
Expand All @@ -27,6 +29,7 @@ const electronLaunchTarget = (
return {
args: [
`--user-data-dir=${userDataRoot}`,
E2E_LOCALE_ARGUMENT,
...(platform === 'linux' ? ['--password-store=basic'] : []),
...(executablePath ? [] : [APP_ROOT])
],
Expand Down Expand Up @@ -290,6 +293,7 @@ class ElectronAppHarness implements ElectronApp {
)
try {
await mkdir(harness.roots.storageRoot, { recursive: true })
await writeFile(join(harness.roots.storageRoot, 'settings.json'), E2E_SETTINGS, 'utf8')
await writeFile(harness.roots.fakeRemoteItState, JSON.stringify({ services: [] }), 'utf8')
await writeFakeAgentLauncher(harness.roots.fakeAgentBinRoot)
await writeFakeRemoteItCommands(harness.roots.fakeRemoteItRoot)
Expand Down Expand Up @@ -438,6 +442,7 @@ class ElectronAppHarness implements ElectronApp {
executable,
[
`--user-data-dir=${this.roots.userDataRoot}`,
E2E_LOCALE_ARGUMENT,
...(process.env.OPEN_SCIENCE_E2E_EXECUTABLE ? [] : [appPath])
],
{
Expand Down
24 changes: 19 additions & 5 deletions e2e/launch-environment.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ test('allows native window-system tests to opt into normal presentation', () =>
expect(environment.OPEN_SCIENCE_E2E_WINDOW_MODE).toBe('normal')
})

test('pins the Electron UI to English for stable accessibility selectors', () => {
expect(electronLaunchTarget('profile-root', {}, 'darwin').args).toContain('--lang=en-US')
})

test('enables Session CPU tracing only for an active local performance profile', () => {
const ordinary = launchEnvironment('storage-root', undefined, {})
const profiled = launchEnvironment('storage-root', undefined, {}, undefined, 'hidden', true)
Expand All @@ -41,13 +45,18 @@ test('enables Session CPU tracing only for an active local performance profile',

test('enables the basic password store only for Linux E2E profiles', () => {
expect(electronLaunchTarget('profile-root', {}, 'linux')).toEqual({
args: ['--user-data-dir=profile-root', '--password-store=basic', expect.any(String)]
args: [
'--user-data-dir=profile-root',
'--lang=en-US',
'--password-store=basic',
expect.any(String)
]
})
expect(electronLaunchTarget('profile-root', {}, 'darwin')).toEqual({
args: ['--user-data-dir=profile-root', expect.any(String)]
args: ['--user-data-dir=profile-root', '--lang=en-US', expect.any(String)]
})
expect(electronLaunchTarget('profile-root', {}, 'win32')).toEqual({
args: ['--user-data-dir=profile-root', expect.any(String)]
args: ['--user-data-dir=profile-root', '--lang=en-US', expect.any(String)]
})
})

Expand All @@ -61,10 +70,15 @@ test('launches packaged and source applications with the expected Linux argument
'linux'
)
).toEqual({
args: ['--user-data-dir=profile-root', '--password-store=basic'],
args: ['--user-data-dir=profile-root', '--lang=en-US', '--password-store=basic'],
executablePath: '/artifacts/Open Science.app/Contents/MacOS/Open Science'
})
expect(electronLaunchTarget('profile-root', {}, 'linux')).toEqual({
args: ['--user-data-dir=profile-root', '--password-store=basic', expect.any(String)]
args: [
'--user-data-dir=profile-root',
'--lang=en-US',
'--password-store=basic',
expect.any(String)
]
})
})
Loading
Loading