Skip to content

🤖 tests: stabilize Storybook fixtures for Pixel flake reduction - #3810

Open
ammar-agent wants to merge 2 commits into
mainfrom
pixel-flake-review
Open

🤖 tests: stabilize Storybook fixtures for Pixel flake reduction#3810
ammar-agent wants to merge 2 commits into
mainfrom
pixel-flake-review

Conversation

@ammar-agent

Copy link
Copy Markdown
Collaborator

Summary

Harden Storybook fixtures that used live Date.now() / Math.random() so Pixel baselines are less flaky across PR builds. Opened separately from #3807 after investigating its pending Pixel review.

Background

#3807 showed Pixel / Review: 5 snapshots awaiting review even though its product UI change was limited to OpenAI store-toggle save behavior, and ProvidersSection stories are explicitly PIXEL_DISABLED.

Findings:

Likely flake contributors found in story fixtures: relative timestamps / random module tokens that can still affect provider tree keys or labels when capture paths bypass the global Date.now stub or when modules are re-evaluated.

Implementation

Replace nondeterministic time/random sources in Storybook stories with the shared NOW / STABLE_TIMESTAMP fixtures (src/browser/stories/storyTime.ts):

  • LeftSidebar module render token
  • BackgroundProcesses start times
  • ProjectSidebar createdAt fixtures
  • MemoryTab / MemorySection access times
  • GoalTab / RightSidebar timestamps
  • TranscriptDensity active tool start
  • BashToolCall executing timer start
  • MCP modal/settings testedAt fixtures

No production UI code changed.

Validation

  • make typecheck
  • make static-check
  • Diff is stories-only; Pixel on this PR should either be clean or present a much smaller, reviewable set of real diffs.

Risks

  • Low. Snapshot baselines may update once if previous “flaky” timestamps were accidentally baselined; that is intended.
  • Does not auto-approve existing pending Pixel reviews on other PRs; those still need human approve/reject or a rebase onto a clean main baseline.

Generated with mux • Model: xai:grok-4.5 • Thinking: high

Replace nondeterministic Date.now/Math.random story fixtures with the
shared NOW clock so baseline diffs are less likely across PR builds.
@ammar-agent

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9ba144b4ea

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/browser/features/Tools/Bash/BashToolCall.stories.tsx Outdated
Comment thread src/browser/features/Messages/TranscriptDensity.stories.tsx Outdated
Comment thread src/browser/components/LeftSidebar/LeftSidebar.stories.tsx Outdated
@ammar-agent

Copy link
Copy Markdown
Collaborator Author

@codex review

Addressed the three P2s:

  1. Bash executing timer uses NOW - 1_000 (keeps ~1s state).
  2. TranscriptDensity active bundle uses NOW - 39_000 (keeps 39s, not 1m39s).
  3. LeftSidebar module token stays stable in Pixel/CI, but still bumps via import.meta.hot.data during Vite HMR so provider trees remount after story edits.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: 1cf46354a8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant