perf(data): bound lidar readers and lab session loading

This commit is contained in:
DCCONSTRUCTIONS
2026-07-30 21:52:10 +03:00
parent 7d1a70d8e0
commit e9bbfb9a41
10 changed files with 580 additions and 134 deletions
@@ -385,6 +385,7 @@ export function clearObservationReplayPreparation(
export function useObservationSessions({
limit = 100,
scope = "all",
pollingEnabled = true,
replayEnabled = true,
onReplayBegin,
onReplayAccepted,
@@ -393,6 +394,7 @@ export function useObservationSessions({
}: {
limit?: number;
scope?: ObservationSessionScope;
pollingEnabled?: boolean;
replayEnabled?: boolean;
/** Called only after the archive is ready, immediately before replacing the old viewer. */
onReplayBegin?: (
@@ -475,7 +477,7 @@ export function useObservationSessions({
}, [refresh]);
useEffect(() => {
if (state !== "ready") return;
if (!pollingEnabled || state !== "ready") return;
let disposed = false;
let timer = 0;
const poll = async () => {
@@ -488,7 +490,7 @@ export function useObservationSessions({
disposed = true;
window.clearTimeout(timer);
};
}, [loadCatalog, state]);
}, [loadCatalog, pollingEnabled, state]);
const executeReplay = useCallback(async (
session: ObservationSessionSummary,
@@ -206,6 +206,9 @@ test("data recordings keep the compact session dropdown and laboratory results s
assert.match(laboratorySource, /e29-camera-geometry/);
assert.match(laboratorySource, /laboratoryWorkOrdinal\(right\.label\)/);
assert.match(laboratorySource, /initialWorkSelectedRef/);
assert.match(laboratorySource, /pollingEnabled:\s*false/);
assert.match(laboratorySource, /useAdvancedLaboratoryCatalog/);
assert.doesNotMatch(laboratorySource, /fetchAdvancedLaboratoryResults/);
});
test("recording preparation statuses share the viewer's left alignment", async () => {