wayBetter for X 1.0.2

This commit is contained in:
CRTkafa 2026-10-02 02:54:04 +07:00
parent 785c8cc72c
commit 435f05bd3e
212 changed files with 10208 additions and 2345 deletions

View file

@ -81,8 +81,11 @@ const handlers: Record<string, Handler> = {
mode_get: () => state.modes,
mode_set: ({ mode, onboarded, preset }) => (state.modes = { mode: (mode as string | null) ?? null, onboarded: !!onboarded, existing: true, preset: (preset as Record<string, boolean> | undefined) ?? (mode === state.modes.mode ? state.modes.preset : null) }),
// The global theme (the app menu's Theme submenu picks one; the chrome follows).
x_theme_get: () => state.theme,
x_set_theme: ({ theme }) => { state.theme = theme; return null; },
theme_get: () => state.theme,
theme_set: ({ theme }) => { state.theme = theme; return null; },
// Account and pane themes: none saved; `panetheme` sets one after the tabs exist.
theme_scopes_get: () => ({ chrome: 'theme', profiles: {}, panes: {} }),
theme_scopes_set: () => null,
tabs_sync: ({ items }) => { state.sync = items as unknown[]; state.tabProfiles = (items as Array<{ profile: string }>).map(item => item.profile); return null; },
column_configure: ({ id, config }) => { if (config) state.columns[String(id)] = config; else delete state.columns[String(id)]; return null; },
tab_action: () => null,
@ -241,6 +244,8 @@ export async function mountShellHarness(root: HTMLElement) {
api.addPanel({ id: 'right0', component: 'web', title: 'Messages / X', params: { kind: 'web', url: 'https://x.com/messages', title: 'Messages / X', favicon: X_ICON, profile: 'default' }, position: { referencePanel: 'tab0', direction: 'right' } });
api.addPanel({ id: 'right1', component: 'web', title: 'Lists / X', params: { kind: 'web', url: 'https://x.com/i/lists', title: 'Lists / X', favicon: X_ICON, profile: profiles[1]?.id ?? 'default' }, position: { referencePanel: 'right0', direction: 'within' }, inactive: true });
}
// `panetheme=<id>` (with `split`): the right pane gets its own theme once it exists (scopes name open tabs only).
if (params.has('split') && params.get('panetheme')) { const { setScopes } = await import('../themes'); await setScopes({ chrome: 'theme', profiles: {}, panes: { right0: params.get('panetheme')! } }); }
store.shell.closed.push(
{ url: 'https://x.com/TauriApps', profile: 'default', title: 'Tauri (@TauriApps) / X' },
{ url: 'https://github.com/features/copilot', profile: 'default', title: 'GitHub Copilot' },