/** * apes:* information-layer tabs — the fork's own contribution on top of the * upstream dsh-better-sidebar. Five tabs ship (tasks / agents / messages / * apps / profile). * * History (C7): `apesTasks` was removed under the old C6 decision (it looked * redundant next to the official DSH session tree). The `v2-revive` line * restores it — the native tree is a *navigator* (one focused lineage), this * panel is a *list* (every session, with an idle filter and a running badge), * so the two answer different questions. `messages` is still an honest * placeholder: no DSH message-stream feed exists yet. * * Isolated under `src/client/apes/` so the upstream `builtins/` tree stays * untouched: cherry-picking upstream releases only has to keep the single * `registerApesTabs(...)` call site in `index.tsx` (see D1 = module B). * * Every descriptor is registered through the same `BetterSidebarService` * the builtins use (dogfood), so the apes tabs get the full sidebar * lifecycle for free: + menu, enable/disable switches, badge pills, * dedupe/focus, and HMR-safe disposal via the returned disposer. */ import type { Context } from '../../context-types.ts' import type { BetterSidebarService } from '../service.ts' import { apesTabs } from './tabs.tsx' // Re-exported so index.tsx can register the apes dictionaries + attach the // locale service in one import (keeps the apes module self-contained). export { APES_LOCALE_NS, apesZh, apesEn, apesJa, attachApesLocale } from './locales.ts' /** * Register the apes:* tabs with the sidebar service. Returns a disposer that * unregisters all of them (cordis auto-invokes it on fiber disposal, so HMR * re-activation re-registers cleanly — same contract as registerBuiltins). */ export function registerApesTabs( _ctx: Context, service: BetterSidebarService, ): () => void { const disposers: (() => void)[] = [] for (const tab of apesTabs) { disposers.push(service.registerTab(tab)) } return () => { for (const d of disposers) { try { d() } catch { /* already disposed */ } } } }