Startup cover never outlasts a page that does not say it painted; menu clicks ask nothing native; mode cards show their picture

Release blocker (macOS 1.0.0: both panes stayed on the shell's loading shape). After `shell_ready` the startup cover waited, with no limit, for every visible site tab to report that it painted. A page whose report never comes (its paint check is frame-driven and gives up after 10 s, and an engine may hold a hidden window's frames back) kept the shell raised over the panes, showing the skeleton, for good. The wait is now bounded (8 s after the window is shown); the page then shows as it is.

The app menu asked for the keyboard natively (`shell_focus`) on every open. It now does so only when the shell does not have it (keys pressed in a tab); a click on the shell already gave it the keyboard.

The mode cards' default picture was shrunk to 16px by the shell's base glyph rule ("a few dots"); it keeps its size.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
CRTkafa 2026-10-01 03:40:02 +07:00
parent 2e3babd2f5
commit 06e830b132
3 changed files with 12 additions and 2 deletions

View file

@ -48,6 +48,9 @@ import './shell.css';
type Placement = { referencePanel: string; direction: 'within' | 'right' | 'below' };
/** How long the startup cover waits, once the window is shown, for the visible site tabs to say they painted. */
export const STARTUP_CONTENT_WAIT = 8000;
/** A development build (createShell's `dev`): the shell keeps the devtools shortcut. */
let devBuild = false;
export function setDevBuild(value: boolean) {
@ -925,11 +928,15 @@ export default function Shell() {
const check = () => { if (done()) finish(); };
const finish = () => {
clearInterval(poll);
clearTimeout(limit);
window.removeEventListener('bt-tab-startup-state', check);
resolve();
};
// Dockview closes and deck layout changes do not always emit tab-state.
const poll = setInterval(check, 200);
// Never longer than this: a page that never says it painted (its script failed, the
// engine held its frames back) shows as it is rather than behind a cover for good.
const limit = setTimeout(finish, STARTUP_CONTENT_WAIT);
window.addEventListener('bt-tab-startup-state', check);
});
// The X DOM signal can precede its separate native WebView surface by a frame.