MCPcopy
hub / github.com/coder/mux / getDefaultRightSidebarLayoutState

Function getDefaultRightSidebarLayoutState

src/browser/utils/rightSidebarLayout.ts:60–78  ·  view source on GitHub ↗
(activeTab: TabType)

Source from the content-addressed store, hash-verified

58}
59
60export function getDefaultRightSidebarLayoutState(activeTab: TabType): RightSidebarLayoutState {
61 // Default tabs come from the registry's `inDefaultLayout` flag — no
62 // hardcoded list to keep in sync. Adding a tab to the default layout is a
63 // one-line metadata change in `Tabs/tabConfig.ts`.
64 const defaultTabs: TabType[] = [...getDefaultLayoutTabIds()];
65 const tabs = defaultTabs.includes(activeTab) ? defaultTabs : [...defaultTabs, activeTab];
66
67 return {
68 version: 1,
69 nextId: 2,
70 focusedTabsetId: "tabset-1",
71 root: {
72 type: "tabset",
73 id: "tabset-1",
74 tabs,
75 activeTab,
76 },
77 };
78}
79
80export function parseRightSidebarLayoutState(
81 raw: unknown,

Callers 8

readRightSidebarLayoutFunction · 0.90
updateRightSidebarLayoutFunction · 0.90
RightSidebarComponentFunction · 0.90
removeTabEverywhereFunction · 0.85

Calls 1

getDefaultLayoutTabIdsFunction · 0.90

Tested by

no test coverage detected