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

Function updateRightSidebarLayout

src/browser/utils/rightSidebarTabFocus.ts:24–36  ·  view source on GitHub ↗
(
  workspaceId: string,
  updater: (state: RightSidebarLayoutState) => RightSidebarLayoutState
)

Source from the content-addressed store, hash-verified

22}
23
24export function updateRightSidebarLayout(
25 workspaceId: string,
26 updater: (state: RightSidebarLayoutState) => RightSidebarLayoutState
27): void {
28 const fallback = getRightSidebarTabFallback();
29 const defaultLayout = getDefaultRightSidebarLayoutState(fallback);
30
31 updatePersistedState<RightSidebarLayoutState>(
32 getRightSidebarLayoutKey(workspaceId),
33 (prev) => updater(parseRightSidebarLayoutState(prev, fallback)),
34 defaultLayout
35 );
36}
37
38export function getRightSidebarTabFallback(): TabType {
39 const raw = readPersistedState<string>(RIGHT_SIDEBAR_TAB_KEY, "costs");

Callers 3

buildToggleTabCommandFunction · 0.90
buildCoreSourcesFunction · 0.90
focusRightSidebarTabFunction · 0.85

Tested by

no test coverage detected