Define governed View projection contract
This commit is contained in:
@@ -84,11 +84,13 @@ export function isViewSurfaceVisible(
|
||||
surfaceId: string | null | undefined,
|
||||
catalogue: PlatformViewSurface[]
|
||||
): boolean {
|
||||
if (!surfaceId || !projection?.activeViewId) return true;
|
||||
const projectionActive =
|
||||
projection?.projectionActive ?? Boolean(projection?.activeViewId);
|
||||
if (!surfaceId || !projectionActive) return true;
|
||||
const byId = new Map(catalogue.map((surface) => [surface.id, surface]));
|
||||
const surface = byId.get(surfaceId);
|
||||
if (!surface) return true;
|
||||
const visible = new Set(projection.visibleSurfaceIds);
|
||||
const visible = new Set(projection?.visibleSurfaceIds ?? []);
|
||||
let current: PlatformViewSurface | undefined = surface;
|
||||
const visited = new Set<string>();
|
||||
while (current) {
|
||||
|
||||
@@ -410,6 +410,7 @@ export type EffectiveViewProjection = {
|
||||
activeRevisionId: string | null;
|
||||
activeViewName: string | null;
|
||||
visibleSurfaceIds: string[];
|
||||
projectionActive?: boolean;
|
||||
locked: boolean;
|
||||
availableViews: EffectiveViewOption[];
|
||||
provenance: Array<{
|
||||
|
||||
Reference in New Issue
Block a user