Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

index.html

725 lines25.4 KB

1<!doctype html>
2<html lang="en">
3 <head>
4 <meta charset="UTF-8" />
5 <meta
6 name="viewport"
7 content="width=device-width, initial-scale=1.0, viewport-fit=cover, interactive-widget=resizes-content"
8 />
9 <meta name="theme-color" content="#000000" />
10 <link rel="icon" href="/favicon.ico" sizes="48x48" />
11 <link rel="apple-touch-icon" href="/apple-touch-icon.png" />
12 <link rel="manifest" href="/manifest.webmanifest" />
13 <script>
14 (() => {
15 const LIGHT_BACKGROUND = "#ffffff";
16 const DARK_BACKGROUND = "#000000";
17 const CUSTOM_THEMES_STORAGE_KEY = "t3code:themes:v1";
18 const ENVIRONMENT_THEMES_STORAGE_KEY = "t3code:environment-themes:v1";
19 const THEME_FOLLOW_SYSTEM_STORAGE_KEY = "t3code:theme-follow-system";
20 const THEME_APPEARANCE_MODE_STORAGE_KEY = "t3code:theme-appearance-mode";
21 const THEME_HALVES_STORAGE_KEY = "t3code:theme-halves:v1";
22 const SPLASH_COLORS = {
23 light: {
24 background: "#ffffff",
25 foreground: "#262626",
26 accent: "#4f46e5",
27 },
28 dark: {
29 background: "#000000",
30 foreground: "#f5f5f5",
31 accent: "#818cf8",
32 },
33 };
34 // These are the runtime defaults used to complete a custom palette
35 // when a stored theme omits a role. Keep them separate from the
36 // unselected splash so a partial custom theme does not flash generic
37 // app colors before React mounts.
38 const DEFAULT_THEME_PALETTES = {
39 light: {
40 background: "oklch(0.982446 0.010114 325.653)",
41 foreground: "oklch(0.325698 0.116116 325.037)",
42 accent: "oklch(0.591646 0.217985 0.584)",
43 chrome: "oklch(0.982446 0.010114 325.653)",
44 },
45 dark: {
46 background: "oklch(0.22813 0.020366 307.469)",
47 foreground: "oklch(0.980735 0.004092 301.426)",
48 accent: "oklch(0.460685 0.185347 4.099)",
49 chrome: "oklch(0.22813 0.020366 307.469)",
50 },
51 };
52 // Keep this small boot-time copy in sync with the built-in palettes so
53 // the selected theme is visible before the app has mounted.
54 const BUILT_IN_THEME_PALETTES = {
55 "t3-chat": {
56 light: {
57 background: "oklch(0.982446 0.010114 325.653)",
58 foreground: "oklch(0.325698 0.116116 325.037)",
59 accent: "oklch(0.591646 0.217985 0.584)",
60 chrome: "oklch(0.982446 0.010114 325.653)",
61 },
62 dark: {
63 background: "oklch(0.22813 0.020366 307.469)",
64 foreground: "oklch(0.980735 0.004092 301.426)",
65 accent: "oklch(0.460685 0.185347 4.099)",
66 chrome: "oklch(0.22813 0.020366 307.469)",
67 },
68 },
69 grove: {
70 light: {
71 background: "oklch(0.972369 0.005497 157.15)",
72 foreground: "oklch(0.222003 0.03479 328.979)",
73 accent: "oklch(0.523295 0.112292 158.089)",
74 chrome: "oklch(0.972369 0.005497 157.15)",
75 },
76 dark: {
77 background: "oklch(0.260865 0.02152 162.75)",
78 foreground: "oklch(0.990339 0.008411 325.64)",
79 accent: "oklch(0.796228 0.133058 157.319)",
80 chrome: "oklch(0.260865 0.02152 162.75)",
81 },
82 },
83 ocean: {
84 light: {
85 background: "oklch(0.974199 0.002856 241.597)",
86 foreground: "oklch(0.222003 0.03479 328.979)",
87 accent: "oklch(0.536684 0.120219 247.01)",
88 chrome: "oklch(0.974199 0.002856 241.597)",
89 },
90 dark: {
91 background: "oklch(0.242641 0.024125 250.573)",
92 foreground: "oklch(0.990339 0.008411 325.64)",
93 accent: "oklch(0.758933 0.105833 241.548)",
94 chrome: "oklch(0.242641 0.024125 250.573)",
95 },
96 },
97 ember: {
98 light: {
99 background: "oklch(0.976527 0.002685 60.725)",
100 foreground: "oklch(0.222003 0.03479 328.979)",
101 accent: "oklch(0.552831 0.129438 44.656)",
102 chrome: "oklch(0.976527 0.002685 60.725)",
103 },
104 dark: {
105 background: "oklch(0.245899 0.019144 42.044)",
106 foreground: "oklch(0.990339 0.008411 325.64)",
107 accent: "oklch(0.762174 0.124117 52.082)",
108 chrome: "oklch(0.245899 0.019144 42.044)",
109 },
110 },
111 iris: {
112 light: {
113 background: "oklch(0.976531 0.003855 303.226)",
114 foreground: "oklch(0.222003 0.03479 328.979)",
115 accent: "oklch(0.525348 0.15373 294.176)",
116 chrome: "oklch(0.976531 0.003855 303.226)",
117 },
118 dark: {
119 background: "oklch(0.225975 0.031062 293.741)",
120 foreground: "oklch(0.990339 0.008411 325.64)",
121 accent: "oklch(0.671712 0.169136 293.929)",
122 chrome: "oklch(0.225975 0.031062 293.741)",
123 },
124 },
125 };
126 const BUILT_IN_THEME_MODES = Object.fromEntries(
127 Object.entries(BUILT_IN_THEME_PALETTES).map(([id, palettes]) => [
128 id,
129 Object.keys(palettes),
130 ]),
131 );
132 const RESERVED_THEME_IDS = [
133 "system",
134 "light",
135 "dark",
136 "t3-chat",
137 "grove",
138 "ocean",
139 "ember",
140 "iris",
141 "t3-chat-dark",
142 "t3-grove",
143 "t3-ocean",
144 "t3-ember",
145 "t3-iris",
146 ];
147 const setThemeColor = (color) => {
148 for (const meta of document.querySelectorAll('meta[name="theme-color"]')) {
149 meta.setAttribute("content", color);
150 }
151 };
152​
153 // The runtime decodes the same literal CSS formats into OKLCH. Keep
154 // contextual colors out: they cannot be resolved from stored data.
155 const SYSTEM_COLOR_KEYWORD =
156 /^(?:accentcolor(?:text)?|active(?:border|caption|text)|appworkspace|background|button(?:border|face|highlight|shadow|text)|canvas(?:text)?|captiontext|field(?:text)?|graytext|highlight(?:text)?|inactive(?:border|caption(?:text)?)|info(?:background|text)|linktext|mark(?:text)?|menu(?:text)?|scrollbar|selecteditem(?:text)?|threed(?:darkshadow|face|highlight|lightshadow|shadow)|visitedtext|window(?:frame|text)?)$/i;
157 const isThemeColor = (value) => {
158 if (typeof value !== "string" || typeof CSS === "undefined") return false;
159 const color = value.trim();
160 if (
161 /^(?:currentcolor|inherit|initial|revert|revert-layer|unset)$/i.test(color) ||
162 SYSTEM_COLOR_KEYWORD.test(color) ||
163 /\bfrom\b|(?:var|env|attr|calc|min|max|clamp)\(/i.test(color)
164 ) {
165 return false;
166 }
167 const isLiteralColor =
168 /^#(?:[0-9a-f]{3}|[0-9a-f]{4}|[0-9a-f]{6}|[0-9a-f]{8})$/i.test(color) ||
169 /^[a-z]+$/i.test(color) ||
170 /^(?:rgba?|hsla?|hwb|lab|lch|oklab|oklch|color)\(/i.test(color);
171 return isLiteralColor && CSS.supports("color", color);
172 };
173 const isRecord = (value) =>
174 typeof value === "object" && value !== null && !Array.isArray(value);
175 const isThemeId = (value) =>
176 typeof value === "string" && /^[a-z0-9](?:[a-z0-9-]{0,47})$/.test(value);
177 const isThemeLabel = (value) =>
178 typeof value === "string" && value.trim().length > 0 && value.trim().length <= 48;
179 const isThemePreferenceMode = (value) =>
180 value === "light" || value === "dark" || value === "system";
181 const isThemeAppearance = (value) => value === "light" || value === "dark";
182 const isStoredCustomTheme = (value) => {
183 if (
184 !isRecord(value) ||
185 !isThemeId(value.id) ||
186 RESERVED_THEME_IDS.includes(value.id) ||
187 !isThemeLabel(value.label) ||
188 !isThemeAppearance(value.appearance) ||
189 !isRecord(value.colors)
190 ) {
191 return false;
192 }
193 if (value.variants === undefined) return true;
194 if (!isRecord(value.variants)) return false;
195 return Object.entries(value.variants).every(
196 ([appearance, colors]) =>
197 isThemeAppearance(appearance) &&
198 (appearance === value.appearance || isRecord(colors)),
199 );
200 };
201 const findStoredTheme = (storageKey, themeId) => {
202 try {
203 const parsed = JSON.parse(window.localStorage.getItem(storageKey) ?? "null");
204 if (!Array.isArray(parsed)) return null;
205 return (
206 parsed.find((value) => isStoredCustomTheme(value) && value.id === themeId) ?? null
207 );
208 } catch {
209 return null;
210 }
211 };
212 // Same precedence as getThemeDefinition: saved custom themes, then published ones.
213 const findCustomTheme = (themeId) => {
214 if (RESERVED_THEME_IDS.includes(themeId)) return null;
215 return (
216 findStoredTheme(CUSTOM_THEMES_STORAGE_KEY, themeId) ??
217 findStoredTheme(ENVIRONMENT_THEMES_STORAGE_KEY, themeId)
218 );
219 };
220​
221 try {
222 const storedTheme = window.localStorage.getItem("t3code:theme");
223 const prefersDark = window.matchMedia("(prefers-color-scheme: dark)").matches;
224 const LEGACY_THEME_IDS = {
225 "t3-chat-dark": "t3-chat",
226 "t3-grove": "grove",
227 "t3-ocean": "ocean",
228 "t3-ember": "ember",
229 "t3-iris": "iris",
230 };
231 const isLegacyT3ChatDark = storedTheme === "t3-chat-dark";
232 const themeId =
233 storedTheme === null ? "" : (LEGACY_THEME_IDS[storedTheme] ?? storedTheme);
234 const legacyMode = isLegacyT3ChatDark ? "dark" : null;
235 const builtInModes = BUILT_IN_THEME_MODES[themeId] ?? null;
236 const customTheme = builtInModes ? null : findCustomTheme(themeId);
237 const themeModes =
238 builtInModes ??
239 (customTheme
240 ? ["light", "dark"].filter(
241 (mode) => mode === customTheme.appearance || customTheme.variants?.[mode],
242 )
243 : null);
244 const isKnownTheme =
245 storedTheme === "light" ||
246 storedTheme === "dark" ||
247 storedTheme === "system" ||
248 themeModes !== null;
249 const theme = isKnownTheme && storedTheme ? storedTheme : "system";
250 const isThemed = isKnownTheme && themeModes !== null;
251 const baseAppearance = customTheme ? customTheme.appearance : "light";
252 const systemMode = prefersDark ? "dark" : "light";
253 const storedAppearanceMode = window.localStorage.getItem(
254 THEME_APPEARANCE_MODE_STORAGE_KEY,
255 );
256 const storedFollowSystem = window.localStorage.getItem(THEME_FOLLOW_SYSTEM_STORAGE_KEY);
257 const preferenceMode =
258 theme === "light" || theme === "dark" ? theme : (legacyMode ?? baseAppearance);
259 const appearanceMode = isThemePreferenceMode(storedAppearanceMode)
260 ? storedAppearanceMode
261 : storedFollowSystem === "true"
262 ? "system"
263 : storedFollowSystem === "false"
264 ? preferenceMode
265 : theme === "system"
266 ? "system"
267 : preferenceMode;
268 // A valid mix half for the wanted appearance takes over: it decides
269 // light vs dark even when the base theme cannot render that mode.
270 // Mirrors the runtime's halves-aware resolveThemeAppearance.
271 const wantedMode = appearanceMode === "system" ? systemMode : appearanceMode;
272 let halfThemeId = null;
273 let halfCustomTheme = null;
274 try {
275 const halvesRaw = JSON.parse(
276 window.localStorage.getItem(THEME_HALVES_STORAGE_KEY) ?? "null",
277 );
278 const candidate = isRecord(halvesRaw) ? halvesRaw[wantedMode] : null;
279 if (typeof candidate === "string") {
280 const halfId = LEGACY_THEME_IDS[candidate] ?? candidate;
281 const halfBuiltIn = BUILT_IN_THEME_MODES[halfId] ?? null;
282 const halfCustom = halfBuiltIn ? null : findCustomTheme(halfId);
283 const halfModes =
284 halfBuiltIn ??
285 (halfCustom
286 ? ["light", "dark"].filter(
287 (mode) => mode === halfCustom.appearance || halfCustom.variants?.[mode],
288 )
289 : null);
290 if (halfModes && halfModes.includes(wantedMode)) {
291 halfThemeId = halfId;
292 halfCustomTheme = halfCustom;
293 }
294 }
295 } catch {}
296 const themeMode = !isThemed
297 ? null
298 : appearanceMode === "system"
299 ? themeModes.includes(systemMode)
300 ? systemMode
301 : baseAppearance
302 : themeModes.includes(appearanceMode)
303 ? appearanceMode
304 : baseAppearance;
305 const isDark =
306 halfThemeId !== null
307 ? wantedMode === "dark"
308 : isThemed
309 ? themeMode === "dark"
310 : appearanceMode === "system"
311 ? prefersDark
312 : appearanceMode === "dark";
313 const effectiveIsThemed = halfThemeId !== null || isThemed;
314 const effectiveThemeId = halfThemeId ?? themeId;
315 const effectiveCustomTheme = halfThemeId !== null ? halfCustomTheme : customTheme;
316 const effectiveThemeMode = halfThemeId !== null ? wantedMode : themeMode;
317 const customColors =
318 effectiveIsThemed && effectiveCustomTheme
319 ? effectiveThemeMode === effectiveCustomTheme.appearance
320 ? effectiveCustomTheme.colors
321 : (effectiveCustomTheme.variants?.[effectiveThemeMode] ??
322 effectiveCustomTheme.colors)
323 : null;
324 const customDefaults =
325 effectiveCustomTheme && effectiveThemeMode
326 ? DEFAULT_THEME_PALETTES[effectiveThemeMode]
327 : null;
328 // The runtime tolerates individual malformed colors, so fall back
329 // per role rather than dropping the theme.
330 const builtInSplash =
331 effectiveIsThemed && !effectiveCustomTheme && effectiveThemeMode
332 ? (BUILT_IN_THEME_PALETTES[effectiveThemeId]?.[effectiveThemeMode] ?? null)
333 : null;
334 const fallbackSplash = isDark ? SPLASH_COLORS.dark : SPLASH_COLORS.light;
335 const customSplash = customColors
336 ? {
337 background: isThemeColor(customColors.canvas)
338 ? customColors.canvas
339 : (customDefaults?.background ?? fallbackSplash.background),
340 foreground: isThemeColor(customColors.text)
341 ? customColors.text
342 : (customDefaults?.foreground ?? fallbackSplash.foreground),
343 accent: isThemeColor(customColors.accent)
344 ? customColors.accent
345 : (customDefaults?.accent ?? fallbackSplash.accent),
346 }
347 : null;
348 if (effectiveIsThemed) {
349 document.documentElement.dataset.themeId = effectiveCustomTheme
350 ? effectiveCustomTheme.id
351 : effectiveThemeId;
352 } else {
353 delete document.documentElement.dataset.themeId;
354 }
355 // A resolved half is a selection even when the base theme is gone
356 // (deleting the base leaves the mix pointing at a real theme).
357 const hasSelection = halfThemeId !== null || (isKnownTheme && storedTheme !== null);
358 if (hasSelection) {
359 document.documentElement.dataset.themeSelected = "true";
360 } else {
361 delete document.documentElement.dataset.themeSelected;
362 }
363 document.documentElement.classList.toggle("dark", isDark);
364 const chromeColor = customColors
365 ? isThemeColor(customColors.chrome)
366 ? customColors.chrome
367 : (customDefaults?.chrome ?? fallbackSplash.background)
368 : builtInSplash
369 ? builtInSplash.chrome
370 : isDark
371 ? DARK_BACKGROUND
372 : LIGHT_BACKGROUND;
373 document.documentElement.style.backgroundColor = chromeColor;
374 if (hasSelection) {
375 const splashColors = customSplash ?? builtInSplash ?? fallbackSplash;
376 for (const [name, value] of Object.entries(splashColors)) {
377 document.documentElement.style.setProperty(`--boot-${name}`, value);
378 }
379 }
380 setThemeColor(chromeColor);
381 } catch {
382 let prefersDark = true;
383 try {
384 prefersDark = window.matchMedia("(prefers-color-scheme: dark)").matches;
385 } catch {}
386 delete document.documentElement.dataset.themeId;
387 delete document.documentElement.dataset.themeSelected;
388 document.documentElement.classList.toggle("dark", prefersDark);
389 const fallbackColor = prefersDark ? DARK_BACKGROUND : LIGHT_BACKGROUND;
390 document.documentElement.style.backgroundColor = fallbackColor;
391 setThemeColor(fallbackColor);
392 }
393 })();
394 </script>
395 <style>
396 html,
397 body,
398 #root {
399 width: 100%;
400 height: 100%;
401 margin: 0;
402 }
403​
404 body {
405 background: #ffffff;
406 color: #262626;
407 font-family:
408 -apple-system, BlinkMacSystemFont, "Inter Variable", "Segoe UI", system-ui, sans-serif;
409 }
410​
411 html.dark body {
412 background: #000000;
413 color: #f5f5f5;
414 }
415​
416 #boot-shell {
417 position: relative;
418 overflow: hidden;
419 display: flex;
420 min-height: 100%;
421 align-items: center;
422 justify-content: center;
423 background: inherit;
424 color: inherit;
425 }
426​
427 html[data-theme-selected="true"] #boot-shell {
428 background: var(--boot-background);
429 color: var(--boot-foreground);
430 }
431​
432 #boot-shell-card {
433 position: relative;
434 z-index: 1;
435 display: flex;
436 align-items: center;
437 justify-content: center;
438 width: 96px;
439 height: 96px;
440 }
441​
442 #boot-shell-logo {
443 width: 64px;
444 height: 64px;
445 object-fit: contain;
446 }
447​
448 #boot-shell-progress {
449 position: absolute;
450 top: 100%;
451 width: min(360px, 80vw);
452 text-align: center;
453 font: 13px system-ui;
454 opacity: 0.7;
455 }
456​
457 /* App CSS locks body and #root scrolling once main loads, so the error screen scrolls itself. */
458 #boot-shell:has(> #boot-error) {
459 height: 100%;
460 overflow-x: hidden;
461 overflow-y: auto;
462 }
463​
464 #boot-error {
465 --boot-error-fg: #262626;
466 --boot-error-bg: #ffffff;
467 --boot-error-line: color-mix(in srgb, currentColor 12%, transparent);
468 display: flex;
469 flex-direction: column;
470 align-items: flex-start;
471 align-self: flex-start;
472 width: min(400px, calc(100% - 48px));
473 padding: clamp(24px, 22vh, 220px) 0 24px;
474 font-size: 13px;
475 line-height: 20px;
476 }
477​
478 html.dark #boot-error {
479 --boot-error-fg: #f5f5f5;
480 --boot-error-bg: #000000;
481 }
482​
483 html[data-theme-selected="true"] #boot-error {
484 --boot-error-fg: var(--boot-foreground);
485 --boot-error-bg: var(--boot-background);
486 }
487​
488 #boot-error h1 {
489 margin: 0;
490 font-size: 15px;
491 font-weight: 600;
492 line-height: 22px;
493 }
494​
495 #boot-error p {
496 margin: 4px 0 0;
497 opacity: 0.7;
498 overflow-wrap: anywhere;
499 text-wrap: pretty;
500 }
501​
502 #boot-error code,
503 #boot-error pre {
504 font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
505 font-size: 12px;
506 overflow-wrap: anywhere;
507 }
508​
509 #boot-error a {
510 color: inherit;
511 text-decoration-line: underline;
512 text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
513 text-underline-offset: 3px;
514 }
515​
516 #boot-error a:hover {
517 text-decoration-color: currentColor;
518 }
519​
520 #boot-error button {
521 height: 32px;
522 padding: 0 14px;
523 border: 1px solid var(--boot-error-line);
524 border-radius: 6px;
525 background: transparent;
526 color: inherit;
527 font: inherit;
528 font-weight: 500;
529 cursor: pointer;
530 }
531​
532 #boot-error button[aria-disabled="true"] {
533 opacity: 0.6;
534 cursor: default;
535 }
536​
537 #boot-error :is(button, a, summary, pre):focus-visible {
538 outline: 2px solid var(--boot-error-fg);
539 outline-offset: 2px;
540 }
541​
542 #boot-error-actions {
543 display: flex;
544 flex-wrap: wrap;
545 gap: 8px;
546 margin-top: 16px;
547 }
548​
549 #boot-error #boot-error-reload {
550 border-color: var(--boot-error-fg);
551 background: var(--boot-error-fg);
552 color: var(--boot-error-bg);
553 }
554​
555 #boot-error-reload:hover {
556 opacity: 0.9;
557 }
558​
559 #boot-error #boot-error-update-note {
560 margin-top: 8px;
561 font-size: 12px;
562 line-height: 18px;
563 }
564​
565 #boot-error details {
566 width: 100%;
567 margin-top: 32px;
568 }
569​
570 #boot-error summary {
571 display: inline-flex;
572 align-items: center;
573 gap: 8px;
574 border-radius: 4px;
575 list-style: none;
576 opacity: 0.7;
577 cursor: pointer;
578 }
579​
580 #boot-error summary::-webkit-details-marker {
581 display: none;
582 }
583​
584 #boot-error summary::before {
585 content: "";
586 width: 5px;
587 height: 5px;
588 border-right: 1.5px solid currentColor;
589 border-bottom: 1.5px solid currentColor;
590 transform: rotate(-45deg);
591 }
592​
593 #boot-error details[open] summary::before {
594 transform: rotate(45deg);
595 }
596​
597 #boot-error summary:hover,
598 #boot-error details[open] summary {
599 opacity: 1;
600 }
601​
602 #boot-error details > :not(summary) {
603 display: grid;
604 gap: 8px;
605 margin-top: 20px;
606 }
607​
608 #boot-error details > a {
609 display: block;
610 width: fit-content;
611 }
612​
613 #boot-error details p {
614 margin: 0;
615 font-size: 12px;
616 line-height: 18px;
617 }
618​
619 #boot-error-command {
620 display: flex;
621 align-items: center;
622 gap: 8px;
623 padding: 4px 4px 4px 10px;
624 border: 1px solid var(--boot-error-line);
625 border-radius: 6px;
626 }
627​
628 #boot-error-command code {
629 flex: 1;
630 min-width: 0;
631 opacity: 0.8;
632 }
633​
634 #boot-error .boot-error-icon {
635 display: grid;
636 flex: none;
637 place-items: center;
638 min-width: 24px;
639 height: 24px;
640 padding: 0 4px;
641 border: 0;
642 border-radius: 4px;
643 font-size: 12px;
644 font-weight: 400;
645 opacity: 0.7;
646 }
647​
648 #boot-error .boot-error-icon:hover {
649 opacity: 1;
650 background: color-mix(in srgb, currentColor 8%, transparent);
651 }
652​
653 #boot-error-details {
654 max-height: 200px;
655 margin: 0;
656 padding: 10px 12px;
657 overflow: auto;
658 border: 1px solid var(--boot-error-line);
659 border-radius: 6px;
660 font-size: 11px;
661 line-height: 16px;
662 white-space: pre-wrap;
663 opacity: 0.8;
664 }
665​
666 #boot-error-report {
667 display: flex;
668 align-items: center;
669 gap: 16px;
670 }
671​
672 #boot-error-report button {
673 height: 28px;
674 padding: 0 10px;
675 }
676​
677 .boot-error-sr {
678 position: absolute;
679 width: 1px;
680 height: 1px;
681 overflow: hidden;
682 clip-path: inset(50%);
683 white-space: nowrap;
684 }
685 </style>
686 <script>
687 // Desktop's preload injects branding before page scripts. Titling before the <title> below
688 // parses keeps Electron from reporting the web build's channel to the window first.
689 const desktopDisplayName = window.desktopBridge?.getAppBranding?.()?.displayName;
690 if (desktopDisplayName) document.title = desktopDisplayName;
691 </script>
692 <!-- vite.config.ts stamps the web build's channel into this title. -->
693 <title>T3 Code</title>
694 </head>
695 <body>
696 <div id="root">
697 <div id="boot-shell">
698 <div id="boot-shell-card" aria-label="T3 Code splash screen">
699 <img id="boot-shell-logo" src="/apple-touch-icon.png" alt="T3 Code" />
700 <p id="boot-shell-progress" role="status" aria-live="polite"></p>
701 </div>
702 </div>
703 </div>
704 <script>
705 const migrationLabel = document.getElementById("boot-shell-progress");
706 const readMigrationProgress = window.desktopBridge?.getDatabaseMigrationProgress;
707 if (readMigrationProgress && migrationLabel) {
708 const updateMigrationProgress = async () => {
709 if (!migrationLabel.isConnected) return;
710 try {
711 const progress = await readMigrationProgress();
712 migrationLabel.textContent = progress
713 ? `Upgrading database (${progress.current} of ${progress.total})`
714 : "";
715 } catch {
716 migrationLabel.textContent = "";
717 }
718 if (migrationLabel.isConnected) setTimeout(updateMigrationProgress, 1000);
719 };
720 void updateMigrationProgress();
721 }
722 </script>
723 <script type="module" src="/src/bootstrap.ts"></script>
724 </body>
725</html>