chore(studio): remove all console.* calls from studio package (#1691)

* chore(studio): remove all console.* calls from studio package

* chore(studio): address review — remove dead stubs, restore consent notice

- Delete empty if-blocks left after console removal (snapTargetCollection,
  Player asset-poll, useTimelineSyncCallbacks 5s probe, useGestureRecording
  dev guard + now-unused isDevBuild) and the stale "surface in dev" comment.
- Drop the dangling no-console pragma + dead duplicate-id branch in sourcePatcher.
- Restore the one-time telemetry consent disclosure in showNoticeOnce (kept
  behind a pragma — it is a user-facing notice, not debug noise).
- Remove the missed timelineIcons console.warn while preserving the
  `tag || "div"` null-safety fallback.
- Route caption auto-save failures (a data-loss path) through telemetry
  instead of swallowing silently.
- Restore the accidentally-clobbered css-var-fonts output.mp4 fixture.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Miguel Ángel
2026-06-24 17:49:36 -04:00
committed by GitHub
co-authored by Claude Opus 4.8
parent ae8b94c518
commit adb40321d6
19 changed files with 36 additions and 115 deletions
@@ -199,8 +199,7 @@ export function useTimelinePlayer() {
}
return bestAdapter;
} catch (err) {
console.warn("[useTimelinePlayer] Could not get playback adapter (cross-origin)", err);
} catch {
return null;
}
}, []);
@@ -264,9 +263,7 @@ export function useTimelinePlayer() {
}
}
}
} catch (err) {
console.warn("[useTimelinePlayer] Could not set playback rate (cross-origin)", err);
}
} catch {}
}, []);
const applyPreviewAudioState = useCallback((playbackRateOverride?: number) => {
const { audioMuted, playbackRate } = usePlayerStore.getState();
@@ -506,9 +503,7 @@ export function useTimelinePlayer() {
if (msSinceTimeline > 500) {
enrichMissingCompositionsRef.current();
}
} catch (err) {
console.warn("[useTimelinePlayer] Could not read clip manifest from iframe", err);
}
} catch {}
}
if (data?.source === "hf-preview" && data?.type === "timeline" && Array.isArray(data.clips)) {
lastTimelineMessageRef.current = Date.now();
@@ -524,12 +519,7 @@ export function useTimelinePlayer() {
syncTimelineElements(els);
}
}
} catch (err) {
console.warn(
"[useTimelinePlayer] Could not read timeline elements on navigate (cross-origin)",
err,
);
}
} catch {}
}
}
};
@@ -164,9 +164,7 @@ export function useTimelineSyncCallbacks({
const dedupedMissing = missing.filter((m) => !finalIds.has(m.id));
syncTimelineElements([...updatedEls, ...dedupedMissing]);
}
} catch (err) {
console.warn("[useTimelinePlayer] enrichMissingCompositions failed", err);
}
} catch {}
}, [iframeRef, syncTimelineElements]);
const initializeAdapter = useCallback(() => {
@@ -241,9 +239,7 @@ export function useTimelineSyncCallbacks({
if (fallbackElement) syncTimelineElements([fallbackElement]);
}
}
} catch (err) {
console.warn("[useTimelinePlayer] Could not read timeline elements from iframe", err);
}
} catch {}
return true;
}, [
getAdapter,
@@ -295,9 +291,6 @@ export function useTimelineSyncCallbacks({
probeIntervalRef.current = setTimeout(() => {
if (!settled) {
trySettle();
if (!settled) {
console.warn("[useTimelinePlayer] Runtime did not signal readiness within 5s");
}
}
window.removeEventListener("message", onMessage);
}, 5000) as unknown as ReturnType<typeof setInterval>;