Skip to content

🤖 tests: stabilize Storybook left sidebar state#2937

Merged
ammario merged 1 commit intomainfrom
tests/storybook-left-sidebar-state
Mar 14, 2026
Merged

🤖 tests: stabilize Storybook left sidebar state#2937
ammario merged 1 commit intomainfrom
tests/storybook-left-sidebar-state

Conversation

@ammar-agent
Copy link
Collaborator

@ammar-agent ammar-agent commented Mar 13, 2026

Summary

Stabilize Storybook app stories that were flaking because the left sidebar could inherit the previous story's persisted open/closed state.

Background

Stories such as "All Reviews Checked" could render with the wrong left-sidebar visibility when Storybook reused localStorage and an existing AppLoader instance across captures. That made visual snapshots depend on whichever story ran before them.

Implementation

  • reset LEFT_SIDEBAR_COLLAPSED_KEY before each Storybook render using the same mobile/desktop default that the app uses
  • key AppWithMocks by story id plus a viewport bucket so crossing the mobile breakpoint forces a fresh AppLoader mount
  • keep per-story overrides intact so stories that intentionally open or collapse the left sidebar still control their own state

Validation

  • make static-check
  • make storybook-build

Risks

Low risk. The change is isolated to Storybook wiring and only affects how persisted sidebar state is seeded for stories.


Generated with mux • Model: openai:gpt-5.4 • Thinking: xhigh • Cost: $2.50

Reset Storybook's persisted left-sidebar state before each render and key AppWithMocks by story plus viewport bucket so mobile/desktop captures do not reuse stale AppLoader state.

---

_Generated with `mux` • Model: `openai:gpt-5.4` • Thinking: `xhigh` • Cost: `$2.50`_

<!-- mux-attribution: model=openai:gpt-5.4 thinking=xhigh costs=2.50 -->
@ammar-agent
Copy link
Collaborator Author

@codex review

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. Chef's kiss.

ℹ️ 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".

@ammario ammario merged commit 99d17b7 into main Mar 14, 2026
40 of 42 checks passed
@ammario ammario deleted the tests/storybook-left-sidebar-state branch March 14, 2026 14:07
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.

2 participants