Skip to content

Fix replay timing, navigation, and sidebar behavior - #1364

Open
JackWilb wants to merge 3 commits into
devfrom
codex/fix-replay-experience
Open

Fix replay timing, navigation, and sidebar behavior#1364
JackWilb wants to merge 3 commits into
devfrom
codex/fix-replay-experience

Conversation

@JackWilb

@JackWilb JackWilb commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Summary

  • make the persisted task interval the authoritative replay clock, including when audio or screen media ends early, and preserve coherent Restart behavior at the task endpoint
  • reset replay media, timer, dimensions, provenance, loading, and footer state when navigating between task identifiers
  • preserve the original task interval when a participant revisits and edits a completed response, and clear the one-shot Previous state
  • treat analysis routes as replay mode even before a participant ID is populated, keeping both Next Participant controls disabled
  • make long sidebars independently scrollable above the replay footer without changing short-sidebar layout
  • add focused unit and Playwright regressions for timer completion and restart, navigation reset, revisit timing, disabled controls, and sidebar overflow

Closes #1360
Closes #1361
Closes #1362
Closes #1363

Validation

  • yarn unittest --run — 2,038 passed, 1 skipped
  • yarn typecheck
  • yarn lint
  • yarn build
  • targeted ESLint for the changed Playwright specs
  • git diff --check

Playwright was not run locally, per the repository instruction; the targeted scenarios are included for CI or maintainer execution.

@github-actions

github-actions Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

A preview of 8e98d4d is uploaded and can be seen here:

https://revisit.dev/study/PR1364

Changes may take a few minutes to propagate.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves analysis replay correctness and UX across task timing, navigation resets, header controls, and sidebar layout, with added unit/E2E regressions to prevent replay-time drift and navigation carryover.

Changes:

  • Make the persisted task interval authoritative for replay timing (including when media ends early) and add replay reset support when navigating between task identifiers.
  • Preserve original response timing when revisiting/editing completed answers and clear the one-shot “Previous” state.
  • Improve replay/analysis UI behavior (disable “Next Participant” in replay; make long sidebars independently scrollable above the replay footer) and add targeted Playwright coverage.

Reviewed changes

Copilot reviewed 16 out of 16 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/utils.ts Adds IndexedDB helper for reading stored component timing in Playwright.
tests/demo-trrack.spec.ts Adds replay navigation reset assertion (timer returns to ~0 after task change).
tests/demo-html.spec.ts Adds regression to ensure revisiting a completed task preserves timing.
tests/demo-form-elements.spec.ts Adds sidebar overflow/layout replay regressions and timing persistence checks.
src/store/hooks/useReplay.ts Reworks replay clocking to use a synthetic task clock, handles shorter media, and adds resetReplay().
src/store/hooks/useNextStep.ts Preserves original timing/windowEvents when revisiting completed answers; clears clickedPrevious.
src/store/hooks/tests/useReplay.spec.tsx Adds unit coverage for authoritative task clock behavior and resetReplay().
src/store/hooks/tests/useNextStep.spec.tsx Adds unit test for preserving original timing on revisited completed answers.
src/store/hooks/tests/useNextStep.spec.ts Updates mocks for setClickedPrevious.
src/components/tests/StepRenderer.spec.tsx Updates replay hook mock to include resetReplay; adds identifier mock.
src/components/StepRenderer.tsx Resets replay state on identifier navigation; constrains sidebar via footer height; remounts footer by identifier.
src/components/interface/tests/AppNavBar.spec.tsx Updates AppNavBar signature and asserts constrained/sticky sidebar behavior.
src/components/interface/tests/AppHeader.spec.tsx Adds unit coverage ensuring “Next Participant” is disabled in analysis replay mode.
src/components/interface/AppNavBar.tsx Adds bottom prop and makes sidebar sticky + independently scrollable with max-height constraint.
src/components/interface/AppHeader.tsx Disables “Next Participant” menu item in analysis replay mode.
src/analysis/individualStudy/thinkAloud/ThinkAloudFooter.tsx Adds missing aria-labels to replay control icons for accessibility.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/components/interface/AppHeader.tsx
@jaykim1213

Copy link
Copy Markdown
Contributor

I can still reproduce #1362 (jumping between components still leaves blank space in the timeline)

Here are some findings:

  1. Edits get lost when going back more than one step
    setClickedPrevious(false) runs after the first Next.
    So if I go back 2+ completed steps and edit them, only the first edit gets saved.

  2. Revisiting a completed response keeps the old times but overwrites the provenance.
    startTime/endTime are preserved, but saveProvenance still replaces the original graph with events from the revisit. Those events are outside the preserved interval, so replay can't reach them → blank timeline, and the original provenance is lost

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants