mirror of
https://github.com/semantica-agi/semantica.git
synced 2026-08-30 04:40:16 +00:00
- pluginRegistryPredicates.ts: consolidate 8-line JSDoc to 5 lines, removing redundant detail that restated implementation mechanics already obvious from the code. - GraphWorkspace.tsx: shorten the lastScrubberMsRef comment from 5 lines to 2; trim the handleDiagnosticsChange block comment by removing the 'rather than bailing out' implementation-alternative sentence; tighten the distanceVisual inline comment. - pluginRegistry.temporal.test.mjs: replace 17-line file-level JSDoc with 9 lines focused on the invariant rather than the root-cause narrative (already covered in pluginRegistryPredicates.ts); remove two tsx loader implementation-detail comments; tighten two test-level inline comments. No logic, types, or test assertions changed. All 42 tests pass.
25 lines
914 B
TypeScript
25 lines
914 B
TypeScript
/**
|
|
* shouldLoad predicates for the GraphWorkspace lazy plugin registry.
|
|
*
|
|
* Extracted into a pure module so the predicates can be unit-tested without
|
|
* importing the full GraphWorkspace React component. Each predicate gates
|
|
* whether a plugin's module is lazily imported; none reference temporalState
|
|
* so temporal scrubber updates never retrigger plugin loading (issue #830).
|
|
*/
|
|
|
|
export type PluginShouldLoadContext = {
|
|
panelState: Record<string, boolean>;
|
|
};
|
|
|
|
export function explorationEffectsShouldLoad({ panelState }: PluginShouldLoadContext): boolean {
|
|
return Boolean(panelState["effects-panel"]);
|
|
}
|
|
|
|
export function neighborhoodPanelShouldLoad({ panelState }: PluginShouldLoadContext): boolean {
|
|
return Boolean(panelState["neighborhood-panel"]);
|
|
}
|
|
|
|
export function temporalOverlayShouldLoad({ panelState }: PluginShouldLoadContext): boolean {
|
|
return Boolean(panelState["temporal-panel"]);
|
|
}
|