Skip to content

🤖 tests: migrate right-sidebar stories to isolated co-located components#2997

Open
jaaydenh wants to merge 9 commits intomainfrom
sidebar-stories-dtqe
Open

🤖 tests: migrate right-sidebar stories to isolated co-located components#2997
jaaydenh wants to merge 9 commits intomainfrom
sidebar-stories-dtqe

Conversation

@jaaydenh
Copy link
Contributor

@jaaydenh jaaydenh commented Mar 17, 2026

Summary

Migrates all three right-sidebar Storybook story modules from app-level AppWithMocks wrappers to isolated, co-located component stories that render components directly with minimal provider scaffolding.

Background

The existing right-sidebar stories (App.rightSidebar.stories.tsx, App.rightSidebar.planPreview.stories.tsx, App.rightSidebar.immersiveReview.stories.tsx) render through the full AppWithMocksAppLoader shell, coupling them to the entire application context. This makes stories slow, fragile, and hard to maintain. Moving to isolated component-level stories:

  • Co-locates stories with their components for discoverability
  • Renders only the component under test with minimal providers
  • Removes dependency on app-level infrastructure (AppWithMocks, AppLoader)
  • Follows the feature hierarchy naming convention for Storybook navigation

Implementation

Provider shell pattern: Each story file introduces a lightweight provider shell that wraps children in the full app provider stack (ThemeProviderAPIProviderRouterProviderProjectProviderWorkspaceProviderExperimentsProvider → ... → ThinkingProviderBackgroundBashProvider), with WorkspaceStore synced to the mock client.

Three migration targets (27 stories total):

Old File New File Stories
src/browser/stories/App.rightSidebar.stories.tsx src/browser/features/RightSidebar/RightSidebar.stories.tsx 21
src/browser/stories/App.rightSidebar.planPreview.stories.tsx src/browser/features/RightSidebar/PlanFileDialog.stories.tsx 1
src/browser/stories/App.rightSidebar.immersiveReview.stories.tsx src/browser/features/RightSidebar/CodeReview/ImmersiveReviewView.stories.tsx 5

New story added: ImmersiveReviewComplete — tests the review completion state when all hunks are marked as read (ported from upstream main).

Play function adaptation:

  • Removed expandRightSidebar() calls (components render directly)
  • Removed "Expand sidebar" button clicks (not relevant in isolation)
  • Tab clicks and content assertions preserved since components render tabs directly
  • PlanFileDialog renders with open={true} directly instead of requiring click-through
  • ImmersiveReviewView receives parsed diff data as props instead of flowing through the app

Risks

Low: Stories now bypass app-level routing and workspace selection, which means any future bugs in how the app wires these components wouldn't be caught by these stories. However, this is the expected trade-off for component-level testing, and app-level integration is covered by other test layers (E2E tests, remaining app-level stories).


Generated with mux • Model: anthropic:claude-opus-4-6 • Thinking: xhigh • Cost: $15.42

@jaaydenh
Copy link
Contributor Author

@codex review

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. 🎉

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

@jaaydenh
Copy link
Contributor Author

@codex review

Copy link

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

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: bfa36922f8

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

@jaaydenh
Copy link
Contributor Author

@codex review

1 similar comment
@jaaydenh
Copy link
Contributor Author

@codex review

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. Another round soon, please!

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

@jaaydenh jaaydenh force-pushed the sidebar-stories-dtqe branch from f40f7d1 to 4d33ed0 Compare March 19, 2026 08:50
@jaaydenh
Copy link
Contributor Author

@codex review

Copy link

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

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: 4d33ed0127

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

@jaaydenh
Copy link
Contributor Author

@codex review

Resolved both P2 threads — these are acknowledged design trade-offs of migrating to component-level isolation. The isolated stories now test component behavior directly without app-shell wiring, while app-level integration testing for Artifacts→Plan file and ReviewPanel→ImmersiveReview flows is covered by E2E tests and other app-level stories. The migration plan explicitly chose component-level isolation to improve story maintainability and speed.

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. Hooray!

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