| 1 | // dockEntries lists the right-dock entry points shown in the floating launcher |
| 2 | // and used to map an entry id to its default tab: an id, a translated label |
| 3 | // key, and the default tab type each entry opens. Kept icon-free so the |
| 4 | // composition layer can import it synchronously without pulling lucide into |
| 5 | // the initial bundle — DockLauncher (lazy) attaches the icons. |
| 6 | // |
| 7 | // Remote (远程) is intentionally NOT listed: it stays reachable via the |
| 8 | // sidebar/status-bar switcher, the command palette and settings. DockLauncher |
| 9 | // further hides the changed (改动) entry for non-git projects, and the branch |
| 10 | // row only renders when the active workspace reports a git branch. |
| 11 | |
| 12 | import type { TabType } from "../store/activityBar"; |
| 13 | |
| 14 | export interface DockEntryConfig { |
| 15 | id: string; |
| 16 | labelKey: string; |
| 17 | defaultTab: TabType; |
| 18 | /** Only offered when the shell exposes an embedded browser surface. */ |
| 19 | requiresBrowser?: boolean; |
| 20 | } |
| 21 | |
| 22 | export const DOCK_ENTRIES: DockEntryConfig[] = [ |
| 23 | { id: "context", labelKey: "rightDock.overview", defaultTab: "context" }, |
| 24 | { id: "files", labelKey: "workspace.filesTab", defaultTab: "file" }, |
| 25 | { id: "changed", labelKey: "workspace.changedTab", defaultTab: "changed" }, |
| 26 | { id: "browser", labelKey: "rightDock.browser", defaultTab: "browser", requiresBrowser: true }, |
| 27 | ]; |
| 28 | |
| 29 | export function availableDockEntries(browserAvailable: boolean): DockEntryConfig[] { |
| 30 | return DOCK_ENTRIES.filter((entry) => !entry.requiresBrowser || browserAvailable); |
| 31 | } |
| 32 |