- The packaged macOS app stayed on "Starting Waggle…": the shell looked for node, service.js, native/ and node_modules/ next to the executable, the Windows layout, while a macOS bundle keeps them in Contents/Resources/resources. bundled_resources_dir() checks both. - The startup screen used min-height 100vh on an unstyled body, which showed scroll bars, and a fixed light text colour that is invisible in the light theme. It is now styled from index.html, fixed to the window, with a dark text colour for the light theme.
32 lines
1.0 KiB
TypeScript
32 lines
1.0 KiB
TypeScript
import { armBootConnection } from './boot-connect';
|
|
|
|
const root = document.getElementById('root');
|
|
if (!root) throw new Error('Waggle root element is missing');
|
|
|
|
const startup = document.createElement('main');
|
|
startup.setAttribute('role', 'status');
|
|
startup.setAttribute('aria-live', 'polite');
|
|
// Styled by the [data-waggle-startup] rules in index.html.
|
|
startup.dataset.waggleStartup = 'loading';
|
|
|
|
const startupMessage = document.createElement('p');
|
|
startupMessage.textContent = 'Starting Waggle…';
|
|
startup.append(startupMessage);
|
|
root.replaceChildren(startup);
|
|
|
|
const showStartupFailure = (error: unknown) => {
|
|
console.error('[waggle] UI startup failed', error);
|
|
startup.setAttribute('role', 'alert');
|
|
startup.dataset.waggleStartup = 'failed';
|
|
startupMessage.textContent = 'Waggle could not start. Close and reopen the app.';
|
|
};
|
|
|
|
try {
|
|
void armBootConnection()
|
|
.then(() => import('./app-entry'))
|
|
.then(({ mountApp }) => mountApp())
|
|
.catch((error) => showStartupFailure(error));
|
|
} catch (error) {
|
|
showStartupFailure(error);
|
|
}
|