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

Function resolveEffectiveSectionId

src/browser/utils/ui/workspaceFiltering.ts:870–885  ·  view source on GitHub ↗
(
  workspace: FrontendWorkspaceMetadata,
  byId: ReadonlyMap<string, FrontendWorkspaceMetadata>,
  sectionIds: ReadonlySet<string>
)

Source from the content-addressed store, hash-verified

868 * without re-implementing the parent walk.
869 */
870export function resolveEffectiveSectionId(
871 workspace: FrontendWorkspaceMetadata,
872 byId: ReadonlyMap<string, FrontendWorkspaceMetadata>,
873 sectionIds: ReadonlySet<string>
874): string | undefined {
875 if (workspace.subProjectPath && sectionIds.has(workspace.subProjectPath)) {
876 return workspace.subProjectPath;
877 }
878 if (workspace.parentWorkspaceId) {
879 const parent = byId.get(workspace.parentWorkspaceId);
880 if (parent) {
881 return resolveEffectiveSectionId(parent, byId, sectionIds);
882 }
883 }
884 return undefined;
885}
886
887/**
888 * Build the storage key for a section's expanded state.

Callers 2

handleKeyDownFunction · 0.90

Calls 2

getMethod · 0.65
hasMethod · 0.45

Tested by

no test coverage detected