README: a hero that shows the app
This commit is contained in:
parent
435f05bd3e
commit
96f909c110
32 changed files with 933 additions and 71 deletions
|
|
@ -66,7 +66,8 @@ const updateStatus = update === 'ready' ? { state: 'ready', version: '1.4.0', no
|
|||
|
||||
const tile = (hue: number) => svg(`<circle cx="22" cy="10" r="4" fill="hsl(${hue} 80% 75%)"/><path d="M0 28l10-10 7 7 5-4 10 9z" fill="hsl(${hue} 60% 55%)"/>`, `hsl(${hue} 40% 20%)`);
|
||||
const handlers: Record<string, Handler> = {
|
||||
settings_get: () => ({ homeUrl: 'https://x.com/home', restoreTabs: true, externalLinks: 'pane', siteLinks: 'same' }),
|
||||
// `slowipc=ms`: the first native answer arrives late, as it can on a real start.
|
||||
settings_get: () => new Promise(resolve => setTimeout(() => resolve({ homeUrl: 'https://x.com/home', restoreTabs: true, externalLinks: 'pane', siteLinks: 'same' }), Number(params.get('slowipc') ?? 0))),
|
||||
profiles_get: () => state.profiles,
|
||||
// Like native code (profiles.rs `removal`): a profile that still has a synced tab cannot be removed.
|
||||
profiles_set: ({ settings }) => {
|
||||
|
|
@ -189,7 +190,8 @@ const DECK_SOURCES = [
|
|||
];
|
||||
|
||||
export async function mountShellHarness(root: HTMLElement) {
|
||||
try { localStorage.removeItem('bt.shell.layout.v1'); } catch { /* Preview only. */ }
|
||||
// `keeplayout`: a reload test; the saved layout stays and no fake tabs are added.
|
||||
if (!params.has('keeplayout')) try { localStorage.removeItem('bt.shell.layout.v1'); } catch { /* Preview only. */ }
|
||||
try {
|
||||
localStorage.removeItem('bt.shell.decks.v1');
|
||||
localStorage.removeItem('bt.shell.deck-settings.v1');
|
||||
|
|
@ -222,7 +224,7 @@ export async function mountShellHarness(root: HTMLElement) {
|
|||
const first = api.panels[0]!;
|
||||
if (open === 'empty') { api.clear(); return; }
|
||||
// The workspace opened on start is the layout: no fake tabs on top.
|
||||
if (params.has('wsdefault')) return;
|
||||
if (params.has('wsdefault') || params.has('keeplayout')) return;
|
||||
const count = Math.max(1, Number(params.get('tabs') ?? 6));
|
||||
const pinned = Number(params.get('pinned') ?? 2);
|
||||
const profiles = state.profiles.profiles;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue