@tutti-os/workbench-surface 0.0.76 → 0.0.78

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1835,6 +1835,9 @@ function useWorkbenchMissionControlPresence(state) {
1835
1835
  const enterFrameRef = useRef2(null);
1836
1836
  const setPresencePhase = useCallback(
1837
1837
  (nextPhase) => {
1838
+ if (phaseRef.current === nextPhase) {
1839
+ return;
1840
+ }
1838
1841
  phaseRef.current = nextPhase;
1839
1842
  setPhase(nextPhase);
1840
1843
  },
@@ -2228,17 +2231,24 @@ function useWorkbenchMissionControlState({
2228
2231
  window.removeEventListener("keydown", onKeyDown, true);
2229
2232
  };
2230
2233
  }, [mode, onRequestClose]);
2231
- if (mode === null || presentation === null) {
2232
- return null;
2233
- }
2234
- return {
2235
- applyPreset,
2236
- canApplyPreset,
2237
- canUsePreset,
2238
- mode,
2239
- presentation,
2240
- selectedCount: orderedSelectedNodeIds.length
2241
- };
2234
+ return useMemo(
2235
+ () => mode === null || presentation === null ? null : {
2236
+ applyPreset,
2237
+ canApplyPreset,
2238
+ canUsePreset,
2239
+ mode,
2240
+ presentation,
2241
+ selectedCount: orderedSelectedNodeIds.length
2242
+ },
2243
+ [
2244
+ applyPreset,
2245
+ canApplyPreset,
2246
+ canUsePreset,
2247
+ mode,
2248
+ orderedSelectedNodeIds.length,
2249
+ presentation
2250
+ ]
2251
+ );
2242
2252
  }
2243
2253
 
2244
2254
  // src/react/WorkbenchSurface.tsx