Skip to content

Replay your coding agent sessions as a map and a timeline

minor fixes

OMEE-Yc7989ff7c21b
diff --git a/viewer/src/core/playback.ts b/viewer/src/core/playback.ts
index 0036aad..b9f71b5 100644
--- a/viewer/src/core/playback.ts
+++ b/viewer/src/core/playback.ts
@@ -122,21 +122,18 @@ const TAKES_ARROWS = `${TAKES_EVERY_KEY}, [role="tab"], [role="radio"]`;
const KEPT_BY: Record<ReplayKeyAction['type'], string> = {
jump: TAKES_EVERY_KEY,
step: TAKES_ARROWS,
+ // Home / End move within text fields, listboxes, menus, tab lists and radio
+ // groups, so those keep them. Buttons and links ignore Home / End.
+ seek: TAKES_ARROWS,
toggle: `${TAKES_ARROWS}, button, summary, a[href], [role="button"]`,
};
/**
-
* Space plays or pauses, the arrow keys step (Shift steps 10), Home and End
* jump to the start and end, and E / X / D / O / R jump to the next edit /
* error / delay / output / retry. Any modifier other than Shift means the key
- * belongs to the browser, so it maps to nothing.
- * Space plays or pauses, the arrow keys step (Shift steps 10), and E / X / D /
- * O / R jump to the next edit / error / delay / output / retry. Any modifier
- * other than Shift means the key belongs to the browser. A key the focused
- * control uses, or already handled, belongs to that control. Both map to
- * nothing.
-
+ * belongs to the browser. A key the focused control uses, or already handled,
+ * belongs to that control. Both map to nothing.
*/
export function replayKeyAction(e: {
key: string;
@@ -147,14 +144,6 @@ export function replayKeyAction(e: {
defaultPrevented: boolean;
target: EventTarget | null;
}): ReplayKeyAction | null {
-
- if (e.metaKey || e.ctrlKey || e.altKey) return null;
- if (e.key === ' ') return { type: 'toggle' };
- if (e.key === 'Home') return { type: 'seek', index: 0 };
- if (e.key === 'End') return { type: 'seek', index: Infinity };
- if (e.key === 'ArrowRight' || e.key === 'ArrowLeft') {
- const d = (e.shiftKey ? 10 : 1) * (e.key === 'ArrowRight' ? 1 : -1);
-
if (e.metaKey || e.ctrlKey || e.altKey || e.defaultPrevented) return null;
const action = actionForKey(e.key, e.shiftKey);
if (!action) return null;
@@ -165,9 +154,11 @@ export function replayKeyAction(e: {
function actionForKey(key: string, shift: boolean): ReplayKeyAction | null {
if (key === ' ') return { type: 'toggle' };
+ // The reducer clamps, so Infinity lands on the last event.
+ if (key === 'Home') return { type: 'seek', index: 0 };
+ if (key === 'End') return { type: 'seek', index: Infinity };
if (key === 'ArrowRight' || key === 'ArrowLeft') {
const d = (shift ? 10 : 1) * (key === 'ArrowRight' ? 1 : -1);
-
return { type: 'step', delta: d };
}
const k = key.toLowerCase();