Repository navigation
Expand file tree
/
Copy pathindex.html
More file actions
380 lines (340 loc) · 14.9 KB
/
Copy pathindex.html
File metadata and controls
380 lines (340 loc) · 14.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, viewport-fit=cover, interactive-widget=resizes-content"
/>
<meta name="description" content="Parallel agentic development with Electron + React" />
<meta name="theme-color" content="#09090b" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<!-- No apple-mobile-web-app-status-bar-style: black-translucent puts the page under the iOS status bar, where iOS 26+ can blur the app header. Only the iPhone Duo gets it (installIphoneDuoStatusBarStyle). -->
<link rel="manifest" href="manifest.json" crossorigin="use-credentials" vite-ignore />
<link rel="icon" href="favicon.ico" data-theme-icon vite-ignore />
<link rel="apple-touch-icon" sizes="180x180" href="apple-touch-icon.png" vite-ignore />
<title>xum - coding agent multiplexer</title>
<style>
body {
margin: 0;
padding: 0;
overflow: hidden;
background: var(--color-surface-primary, #0a0a0b);
color: var(--color-foreground, #d4d4d4);
font-family: var(
--font-primary,
-apple-system,
BlinkMacSystemFont,
"Geist",
system-ui,
"Segoe UI",
"Roboto",
"Helvetica Neue",
Arial,
sans-serif,
"Apple Color Emoji",
"Segoe UI Emoji",
"Segoe UI Symbol"
);
font-size: 14px;
}
:root[data-theme="light"] body {
background: #ffffff;
}
:root[data-theme="flexoki-light"] body {
background: #fffcf0;
}
#root {
height: 100vh; /* fallback for older browsers */
height: var(--app-viewport-height, 100dvh);
overflow: hidden;
background: var(--color-surface-primary, #0a0a0b);
}
:root[data-theme="light"] #root {
background: #ffffff;
}
:root[data-theme="flexoki-light"] #root {
background: #fffcf0;
}
:root[data-theme="flexoki-dark"] body {
background: #100f0f;
}
:root[data-theme="flexoki-dark"] #root {
background: #100f0f;
}
/* Pre-JS placeholder to avoid a blank screen on cold start. */
.boot-loader {
height: 100vh; /* fallback for older browsers */
height: 100dvh;
width: 100vw;
display: flex;
align-items: center;
justify-content: center;
}
.boot-loader__inner {
display: flex;
flex-direction: column;
align-items: center;
gap: 16px;
}
.boot-loader__logo {
width: 200px;
height: auto;
color: #ffffff;
}
:root[data-theme="light"] .boot-loader__logo,
:root[data-theme$="-light"] .boot-loader__logo {
color: #000000;
}
.boot-loader__text {
margin: 0;
font-size: 14px;
color: var(--color-text-secondary, #6b6b6b);
}
:root[data-theme="light"] .boot-loader__text,
:root[data-theme$="-light"] .boot-loader__text {
color: var(--color-text-secondary, #607081);
}
/* Boot failure state (see the boot-load-failure script below). The app's stylesheet loads
with the app, and the app is what failed, so this state paints from this block alone:
the theme variables name the app's tokens, and the hex or hsl values after them are the
dark and light values of those tokens for a page that has none. */
.boot-loader__failure {
display: flex;
flex-direction: column;
align-items: center;
gap: 16px;
box-sizing: border-box;
max-width: min(44ch, 100vw);
padding: 0 24px;
text-align: center;
}
/* The loading text is a quiet hint. This one is what the user has to read, and the dark
secondary text color is below 4.5:1 on the dark page. The light rules above are higher
up in specificity and keep their own color, which passes. */
.boot-loader__failure .boot-loader__text {
text-wrap: balance;
color: var(--color-foreground, #d4d4d4);
}
.boot-loader__title {
margin: 0;
font-size: 18px;
font-weight: 600;
color: var(--color-foreground, #d4d4d4);
}
:root[data-theme="light"] .boot-loader__title,
:root[data-theme$="-light"] .boot-loader__title {
color: var(--color-foreground, #212930);
}
.boot-loader__button {
height: 36px;
padding: 0 16px;
border: 0;
border-radius: 6px;
font: inherit;
font-weight: 500;
cursor: pointer;
color: var(--color-accent-foreground, #ffffff);
background: var(--color-accent, hsl(207 100% 40%));
}
:root[data-theme="light"] .boot-loader__button,
:root[data-theme$="-light"] .boot-loader__button {
background: var(--color-accent, hsl(207 90% 42%));
}
.boot-loader__button:hover {
background: var(--color-accent-button-hover, hsl(207 100% 37%));
}
:root[data-theme="light"] .boot-loader__button:hover,
:root[data-theme$="-light"] .boot-loader__button:hover {
background: var(--color-accent-button-hover, hsl(207 90% 38%));
}
.boot-loader__button:focus-visible {
outline: 2px solid var(--color-foreground, #d4d4d4);
outline-offset: 2px;
}
:root[data-theme="light"] .boot-loader__button:focus-visible,
:root[data-theme$="-light"] .boot-loader__button:focus-visible {
outline-color: var(--color-foreground, #212930);
}
/* Animated "..." after the loading text. Uses ::after so it works in
both the static HTML boot loader and the React LoadingScreen. */
@keyframes boot-ellipsis {
0%, 20% { content: ""; }
40% { content: "."; }
60% { content: ".."; }
80%, 100% { content: "..."; }
}
.boot-loader__dots {
display: inline-block;
width: 1.5ch;
text-align: left;
}
.boot-loader__dots::after {
content: "";
animation: boot-ellipsis 1.2s steps(1) infinite;
}
@media (prefers-reduced-motion: reduce) {
.boot-loader__dots::after {
content: "...";
animation: none;
}
}
</style>
<script>
(function () {
const THEME_KEY = "uiTheme";
const VALID_THEME_PREFERENCES = new Set([
"auto",
"light",
"dark",
"flexoki-light",
"flexoki-dark",
]);
// This boot script runs before the app bundle, so chromeColors.test.ts enforces parity
// with CHROME_COLORS.
const THEME_COLORS = {
dark: "#09090b",
light: "#f5f5f5",
"flexoki-light": "#f2f0e5",
"flexoki-dark": "#1c1b1a",
};
function resolveSystemTheme() {
if (!window.matchMedia) {
return "dark";
}
return window.matchMedia("(prefers-color-scheme: light)").matches ? "light" : "dark";
}
function getColorScheme(theme) {
return theme === "light" || theme.endsWith("-light") ? "light" : "dark";
}
try {
const stored = window.localStorage.getItem(THEME_KEY);
let parsed = null;
// Tolerate legacy values that were written as raw strings (not JSON).
if (stored) {
try {
parsed = JSON.parse(stored);
} catch {
parsed = stored;
}
}
let themePreference = "auto";
if (typeof parsed === "string") {
if (VALID_THEME_PREFERENCES.has(parsed)) {
themePreference = parsed;
} else if (parsed.endsWith("-light")) {
themePreference = "light";
} else if (parsed.endsWith("-dark")) {
themePreference = "dark";
}
}
const theme = themePreference === "auto" ? resolveSystemTheme() : themePreference;
const colorScheme = getColorScheme(theme);
document.documentElement.dataset.theme = theme;
document.documentElement.style.colorScheme = colorScheme;
const metaThemeColor = document.querySelector('meta[name="theme-color"]');
if (metaThemeColor) {
metaThemeColor.setAttribute(
"content",
THEME_COLORS[theme] ?? THEME_COLORS[colorScheme] ?? THEME_COLORS.dark
);
}
} catch (error) {
console.warn("Failed to apply preferred theme early", error);
document.documentElement.dataset.theme = "dark";
document.documentElement.style.colorScheme = "dark";
}
})();
</script>
<script id="boot-load-failure-script">
// Until the app's module graph loads, the boot screen below is all a user sees. When a module
// of that graph fails to load (a network error, or a 404 for a chunk that a new deploy
// replaced), the browser runs none of the graph: not React, not the app's components, not
// its keybinds. So this plain script, which imports nothing, is the only code that can tell
// the user. It swaps "Loading Xum" for a reload prompt when the browser reports a module that
// did not load:
// - a module script element's error event: the entry or one of its static imports
// failed to load. A syntax error or a throw while a module runs is an error event on
// the window, not on the element, so a runtime error in the static graph never passes
// as a load failure. (The dev server answers a module that Vite cannot transform with
// HTTP 500, which the browser reports as a failed load too.)
// - Vite's vite:preloadError (production builds): a dynamic import or its preload was
// rejected. Vite raises it for every rejection of the import, a module that throws as
// it runs included.
// It never cancels an event, so the browser and the app's handlers still see every error.
// It does nothing once the app replaced the boot screen: from then on the app's own
// boundaries show load failures. A slow load raises neither event, so a slow load shows
// the boot screen as before. The copy and the markup are in the template below.
(function () {
function show() {
const loader = document.getElementById("boot-loader");
const template = document.getElementById("boot-load-failure");
const loading = loader && loader.querySelector(".boot-loader__text");
if (!loader || !template || !loading || loader.hasAttribute("data-load-failed")) {
return;
}
const failure = template.content.cloneNode(true);
const reload = failure.querySelector("button");
reload.addEventListener("click", function () {
location.reload();
});
loading.replaceWith(failure);
loader.setAttribute("data-load-failed", "");
// The alert below announces the failure, so the loader is no longer a busy status.
loader.removeAttribute("role");
loader.removeAttribute("aria-live");
loader.removeAttribute("aria-busy");
// Focused, so Enter reloads: a keyboard user needs no other way in.
reload.focus();
}
function report() {
if (document.getElementById("boot-loader")) {
show();
} else {
// A failure that comes before the page body is parsed.
document.addEventListener("DOMContentLoaded", show, { once: true });
}
}
// Load errors of scripts and stylesheets do not bubble, so listen while capturing.
window.addEventListener(
"error",
function (event) {
const target = event.target;
if (target && target.tagName === "SCRIPT" && target.type === "module") {
report();
}
},
true
);
window.addEventListener("vite:preloadError", report);
})();
</script>
</head>
<body>
<!-- Invisible color source for the iOS standalone status bar; see .ios-status-bar-band. -->
<div class="ios-status-bar-band" aria-hidden="true"></div>
<div id="root">
<!-- #6017: the boot screen is the whole page, so it holds the one main landmark. -->
<main>
<div id="boot-loader" class="boot-loader" role="status" aria-live="polite" aria-busy="true">
<div class="boot-loader__inner">
<svg class="boot-loader__logo" aria-hidden="true" viewBox="0 0 134.7754 62" fill="none" xmlns="http://www.w3.org/2000/svg">
<!-- Reordered prior Mux outlines keep Xum on the established Geist Sans Bold geometry. -->
<path d="M2.208 48 11.376 34.944 2.448 22.272H10.08L15.6 30.528L20.928 22.272H28.752L19.872 34.992L28.992 48H21.36L15.696 39.264L9.984 48H2.208ZM41.856 48.576C39.2 48.576 37.12 47.728 35.616 46.032C34.144 44.304 33.408 41.904 33.408 38.832V22.272H40.608V37.152C40.608 39.136 40.912 40.592 41.52 41.52C42.128 42.416 43.088 42.864 44.4 42.864C45.872 42.864 47.008 42.368 47.808 41.376C48.64 40.352 49.056 38.832 49.056 36.816V22.272H56.256V48H49.68L49.488 40.608L50.4 40.8C50.016 43.36 49.104 45.296 47.664 46.608C46.224 47.92 44.288 48.576 41.856 48.576ZM62.544 48V22.272H69.024L69.264 28.464L68.592 28.176C68.944 26.8 69.472 25.632 70.176 24.672C70.912 23.712 71.792 22.976 72.816 22.464C73.84 21.952 74.96 21.696 76.176 21.696C78.32 21.696 80.048 22.32 81.36 23.568C82.704 24.816 83.568 26.496 83.952 28.608L83.04 28.656C83.328 27.152 83.824 25.888 84.528 24.864C85.264 23.808 86.16 23.024 87.216 22.512C88.272 21.968 89.456 21.696 90.768 21.696C92.56 21.696 94.096 22.064 95.376 22.8C96.656 23.536 97.648 24.64 98.352 26.112C99.056 27.552 99.408 29.328 99.408 31.44V48H92.208V33.456C92.208 31.44 91.904 29.936 91.296 28.944C90.688 27.92 89.696 27.408 88.32 27.408C87.456 27.408 86.72 27.648 86.112 28.128C85.504 28.608 85.024 29.312 84.672 30.24C84.352 31.136 84.192 32.24 84.192 33.552V48H77.712V33.552C77.712 31.568 77.424 30.048 76.848 28.992C76.272 27.936 75.28 27.408 73.872 27.408C73.008 27.408 72.256 27.648 71.616 28.128C71.008 28.608 70.544 29.312 70.224 30.24C69.904 31.168 69.744 32.272 69.744 33.552V48H62.544Z" fill="currentColor" />
<rect x="108.7754" y="13" width="26" height="35" fill="currentColor" />
</svg>
<p class="boot-loader__text">Loading Xum<span class="boot-loader__dots"></span></p>
</div>
</div>
</main>
</div>
<template id="boot-load-failure">
<div class="boot-loader__failure" role="alert">
<h1 class="boot-loader__title">Xum could not load</h1>
<p class="boot-loader__text">Part of the app did not download. Reload to try again.</p>
<button type="button" class="boot-loader__button">Reload</button>
</div>
</template>
<script type="module" src="/src/browser/main.tsx"></script>
</body>
</html>