fix(web/session): log the cast to console when player mounts

Diagnostic for the persistent "player mounts with chrome but plays
black" symptom after the blob-URL fix. The player now gets
{data: cast} correctly and parses at least enough to render the
control bar, but duration shows --:-- and the terminal stays blank.

Log the first 400 chars of the built cast + event/cols/rows so the
operator can confirm in DevTools whether the malformed input is the
cast itself or something downstream in the asciinema parser.
This commit is contained in:
2026-04-24 10:17:57 -04:00
parent e684feb1fe
commit f032ece678

View File

@@ -136,6 +136,14 @@ const SessionDrawer: React.FC<SessionDrawerProps> = ({ decky, sid, fields, onClo
playerInstance.current = null; playerInstance.current = null;
} }
const cast = buildCastBlob(header, playable); const cast = buildCastBlob(header, playable);
// One-time diagnostic: when the player silently refuses to play, the
// cast text itself is usually the culprit. Log the first chunk so
// "yes, the header renders correctly" is a one-F12 check.
console.debug(
'asciinema cast (first 400 chars):',
cast.slice(0, 400),
`| events=${playable.length} | cols=${header.width} rows=${header.height}`,
);
try { try {
playerInstance.current = AsciinemaPlayer.create( playerInstance.current = AsciinemaPlayer.create(
{ data: cast }, { data: cast },
@@ -143,8 +151,6 @@ const SessionDrawer: React.FC<SessionDrawerProps> = ({ decky, sid, fields, onClo
{ fit: 'width', terminalFontSize: '12px' }, { fit: 'width', terminalFontSize: '12px' },
); );
} catch (err) { } catch (err) {
// Surface to console so we have a fingerprint next time a cast
// parses as "valid" but refuses to play.
console.error('asciinema-player failed to mount', err); console.error('asciinema-player failed to mount', err);
} }
return () => { return () => {