Skip to content

Agentic Review [2]: Remove baseline / side-by-side compare subsystem - #35219

Merged
yannbf merged 2 commits into
yann/agentic-review-mcp-integrationfrom
review-core/02-delete-compare
Jun 19, 2026
Merged

yannbf merged 2 commits into
yann/agentic-review-mcp-integrationfrom
review-core/02-delete-compare

Conversation

@yannbf

@yannbf yannbf commented Jun 18, 2026 •

Copy link
Copy Markdown
Member

What I did

Removes the entire latest-vs-baseline side-by-side compare subsystem from the review addon (decision Q5). This is PR2 of a 5-PR stack integrating the review feature into core. It telescopes on PR1 (#35218) — review bottom-up.

Compare is an unreleased sub-feature (it lives on next via #34837), so this is maintenance, not a breaking change.

  • Deleted files: ReviewCompareTool.tsx, ReviewPreviewWrapper.tsx, screens/useBaselineComparison.ts.
  • De-baselined: removed the compare menu (Latest/Baseline/Split), hasBaseline, CompareMode/DEFAULT_COMPARE_MODE, PREVIEW_MODE_SESSION_KEY, the baselineStoryIds fetch + diff, and the compareMode/showCompare/setCompareMode store surface.
  • Server: removed the dev-server baseline proxy (experimental_devServer, STORYBOOK_REVIEW_BASELINE, BASELINE_PROXY_PATH) and dropped the http-proxy-middleware dependency; sirv is no longer used by the review addon. experimental_serverChannel (the review cache + module-graph staleness) is kept — it moves to core-server in PR4.
  • "Newly added" now derives solely from change detection's new status (previously it was change-new OR absent-from-baseline).

Incidentally resolves the Pane/LatestPane styled-component duplication, the dead latestPaneRef, and useBaselineComparison's unused return surface.

Stack position

Base: review-core/01-standalone-fixes (PR1, #35218) → yann/agentic-review-mcp-integration (#34837).

Checklist for Contributors

Testing

The changes in this PR are covered in the following automated tests:

  • stories
  • unit tests
  • integration tests
  • end-to-end tests

Manual testing

For a maintainer to verify compare is gone and review still works:

  1. Run a sandbox (yarn task sandbox --template react-vite/default-ts --start-from auto) or cd code && yarn storybook:ui.
  2. Push a review (via the display-review MCP tool / scripts/display-review.ts) and open one of the curated stories.
  3. Expected: the canvas shows a single normal preview — no split/compare panes, and the review toolbar header has no "Compare mode" (Latest/Baseline/Split) menu.
  4. Confirm the rest of the review flow is intact: summary ↔ story navigation, prev/next, the "New" badge on stories that change detection reports as new, and dismiss.
  5. Confirm there are no console errors and that setting STORYBOOK_REVIEW_BASELINE now has no effect.

Documentation

  • Add or update documentation reflecting your changes (removed the "Baseline comparison" section from the addon README)
  • If you are deprecating/removing a feature, make sure to update MIGRATION.MD — N/A, feature is unreleased

Checklist for Maintainers

  • ci:normal
  • qa:needed
  • One changelog label: maintenance

🤖 AI note (Claude Code), not written by Yann — needs sign-off:

This removes a user-facing capability (latest-vs-baseline compare) and needs product sign-off before merge (handoff Cost #1). The stacked plan treats this as already decided (Q5 = "delete compare entirely"), but I'm flagging it explicitly since I executed it autonomously while you were away. If latest/baseline/split is a committed requirement, this PR should be held.

Decision I made: the newlyAddedStoryIds set previously unioned change-detection new with "absent from the baseline index". With baseline gone, the second source no longer exists, so newness is now purely change-detection new. The NewStory test was updated to seed a change-detection new status (it previously relied on baseline-absence). This is the only behavior nuance in the deletion.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Features Removed
    • Removed baseline comparison and compare-mode UI from the review addon, including the related compare/preview tools and wrappers.
    • Disabled baseline serving/proxying and removed baseline routing support.
  • Documentation
    • Removed the “Baseline comparison” setup section for baseline configuration.
  • Bug Fixes
    • Improved review state handling by deferring updates when only the review timestamp changes.
    • Enhanced universal store readiness behavior for isolated instances.
  • Chores
    • Updated Storybook review test harnesses/mocks to drop baseline-fetch behavior.
    • Refreshed React/React-DOM dev dependency versions.

@yannbf yannbf added maintenance User-facing maintenance tasks ci:normal Run our default set of CI jobs (choose this for most PRs). qa:needed Pull Requests that will need manual QA prior to release. labels Jun 18, 2026
@storybook-app-bot

storybook-app-bot Bot commented Jun 18, 2026 •

Copy link
Copy Markdown
Contributor

Package Benchmarks

Commit: 867db42, ran on 19 June 2026 at 15:40:28 UTC

The following packages have significant changes to their size or dependencies:

@storybook/addon-review

Before After Difference
Dependency count 1 1 0
Self size 252 KB 73 KB 🎉 -179 KB 🎉
Dependency size 669 KB 669 KB 0 B
Bundle Size Analyzer Link Link

@yannbf yannbf changed the title Agentic Review: remove baseline / side-by-side compare subsystem Core: Remove baseline / side-by-side compare subsystem Jun 18, 2026
@@ -88,7 +88,6 @@ const managerApi: API = {
const reviewState: ReviewState = {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Seems like the stories for ReviewPage stopped having a "new" badge, can you fix that?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

🤖 AI note (Claude Code), not written by Yann: Fixed. The "New" badge previously came from the (now-removed) baseline-absence check, so I restored it by seeding a change-detection new status for manager-settings-checklist--default in the ReviewPage stories beforeEach (matching how ReviewChangesButton.stories seeds statuses). Newness is now sourced purely from change detection.

Comment thread code/addons/review/src/ReviewPage.stories.tsx
@yannbf
yannbf force-pushed the review-core/01-standalone-fixes branch from b9ebd60 to 396b6cf Compare June 19, 2026 09:13
@yannbf
yannbf force-pushed the review-core/02-delete-compare branch from fa89f91 to 0ef089d Compare June 19, 2026 09:13
@yannbf
yannbf force-pushed the review-core/01-standalone-fixes branch from 396b6cf to 73dd7c5 Compare June 19, 2026 09:23
@yannbf
yannbf force-pushed the review-core/02-delete-compare branch from 0ef089d to 9beb182 Compare June 19, 2026 09:23
@yannbf yannbf changed the title Core: Remove baseline / side-by-side compare subsystem PR2: Remove baseline / side-by-side compare subsystem Jun 19, 2026
Base automatically changed from review-core/01-standalone-fixes to yann/agentic-review-mcp-integration June 19, 2026 13:23
@yannbf
yannbf marked this pull request as ready for review June 19, 2026 13:26
@coderabbitai

coderabbitai Bot commented Jun 19, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 6d34eb1a-06c3-476f-bba0-9b64074d3ad7

📥 Commits

Reviewing files that changed from the base of the PR and between f26f113 and 867db42.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (14)
  • code/addons/review/README.md
  • code/addons/review/package.json
  • code/addons/review/src/ReviewCompareTool.tsx
  • code/addons/review/src/ReviewPage.stories.tsx
  • code/addons/review/src/ReviewPreviewWrapper.tsx
  • code/addons/review/src/ReviewProvider.tsx
  • code/addons/review/src/ReviewToolbarHeader.stories.tsx
  • code/addons/review/src/constants.ts
  • code/addons/review/src/manager.tsx
  • code/addons/review/src/preset.ts
  • code/addons/review/src/review-state.ts
  • code/addons/review/src/review-store.ts
  • code/addons/review/src/screens/useBaselineComparison.ts
  • code/core/src/shared/universal-store/index.ts
💤 Files with no reviewable changes (9)
  • code/addons/review/src/ReviewCompareTool.tsx
  • code/addons/review/src/manager.tsx
  • code/addons/review/README.md
  • code/addons/review/src/review-state.ts
  • code/addons/review/src/constants.ts
  • code/addons/review/src/ReviewPreviewWrapper.tsx
  • code/addons/review/src/review-store.ts
  • code/addons/review/package.json
  • code/addons/review/src/screens/useBaselineComparison.ts
✅ Files skipped from review due to trivial changes (1)
  • code/addons/review/src/ReviewPage.stories.tsx
🚧 Files skipped from review as they are similar to previous changes (4)
  • code/addons/review/src/ReviewToolbarHeader.stories.tsx
  • code/addons/review/src/preset.ts
  • code/core/src/shared/universal-store/index.ts
  • code/addons/review/src/ReviewProvider.tsx

📝 Walkthrough

Walkthrough

Removes the baseline comparison feature from the review addon end-to-end: deletes the experimental_devServer preset hook, ReviewCompareTool, ReviewPreviewWrapper, compare-mode constants/types, and related ReviewProvider state. ReviewProvider gains a deferred-update helper and simplifies new-story detection to use isChangeDetectedNew. UniversalStore is fixed so isolated instances with environmentOverrides do not resolve or wait on the shared preparation promise.

Changes

Remove baseline/compare-mode from review addon

Layer / File(s) Summary
Remove compare-mode types and constants
code/addons/review/src/constants.ts, code/addons/review/src/review-state.ts, code/addons/review/src/review-store.ts
Removes BASELINE_PROXY_PATH, BASELINE_INDEX_URL, PREVIEW_MODE_SESSION_KEY, CompareMode, DEFAULT_COMPARE_MODE, hasBaseline from ReviewState, and compareMode/showCompare/setCompareMode from ReviewStoreState and emptyStore.
Remove baseline dev server hook from preset
code/addons/review/src/preset.ts
Strips filesystem, proxy, sirv, and logger imports and deletes the exported experimental_devServer hook that served/proxied STORYBOOK_REVIEW_BASELINE; module-graph review channel logic is unchanged.
Remove compare and preview addon registrations
code/addons/review/src/manager.tsx
Removes reviewCompareTool and reviewPreviewWrapper imports and their addons.add registrations, leaving only ReviewProvider.
Simplify ReviewProvider: remove baseline/compare state, add deferred update
code/addons/review/src/ReviewProvider.tsx
Deletes baselineStoryIds, compareMode, setCompareMode, baseline-fetch effect, and showCompare derivation; adds isDeferredReviewUpdate for deferred DISPLAY_REVIEW handling; reworks newlyAddedStoryIds via isChangeDetectedNew; strips removed fields from reviewStore value and useMemo deps.
Update story test harnesses, docs, and package.json
code/addons/review/src/ReviewPage.stories.tsx, code/addons/review/src/ReviewToolbarHeader.stories.tsx, code/addons/review/README.md, code/addons/review/package.json
Removes hasBaseline from fixtures, strips all fetch-mock scaffolding, updates beforeEach/cleanup to seed internal_fullStatusStore with change-detection status, removes Baseline comparison section from README.

Fix UniversalStore isolated instance readiness

Layer / File(s) Summary
UniversalStore: isolated instance readiness isolation
code/core/src/shared/universal-store/index.ts
untilReady() short-circuits the shared preparation wait when channel and environment are already present; constructor gates UniversalStore.preparation.resolve() to non-environmentOverrides instances only.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • storybookjs/storybook#35110: Directly related — adds the ReviewCompareTool.tsx and ReviewPreviewWrapper.tsx components plus baseline routing constants that this PR removes.
  • storybookjs/storybook#35059: Related — introduces the session-mapped compare mode and compare-mode UI logic in DetailsScreen that overlaps with the compareMode/showCompare infrastructure being removed here.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Comment @coderabbitai help to get the list of available commands and usage tips.

@ghengeveld ghengeveld self-assigned this Jun 19, 2026
@yannbf yannbf changed the title PR2: Remove baseline / side-by-side compare subsystem Agentic Review [2]: Remove baseline / side-by-side compare subsystem Jun 19, 2026
@yannbf
yannbf force-pushed the review-core/02-delete-compare branch from 9da9ee9 to f26f113 Compare June 19, 2026 14:50
yannbf and others added 2 commits June 19, 2026 17:12
Deletes the entire latest-vs-baseline compare feature (Q5), an unreleased
sub-feature of the review addon:

- Deletes ReviewCompareTool, ReviewPreviewWrapper, and useBaselineComparison.
- Removes the compare menu, hasBaseline, CompareMode/DEFAULT_COMPARE_MODE,
  PREVIEW_MODE_SESSION_KEY, and the baselineStoryIds fetch/diff from the
  provider and store.
- Removes the dev-server baseline proxy (experimental_devServer,
  STORYBOOK_REVIEW_BASELINE) and drops the http-proxy-middleware dependency;
  sirv is no longer used by the review addon. experimental_serverChannel (the
  review cache + module-graph staleness) is kept.
- "Newly added" now derives solely from change-detection's `new` status.

Self-resolves the Pane/LatestPane styled-component duplication, the dead
latestPaneRef, and useBaselineComparison's unused return surface.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…al stores

An isolated MockUniversalStore resolved the global preparation with its own
private channel, which other stores created in an unprepared context then
adopted. In the built Storybook (where the externalized Channel is shared) this
produced two `storybook/status` leaders on one channel, flipping the store into
an error state and throwing "Cannot set state before store is ready" when stories
seeded statuses.

A store created with environment overrides no longer resolves the global
preparation, and `untilReady()` now treats an already-prepared store as ready
(consistent with the `status` getter) so untilReady-based APIs still work in
mock-only environments.
@yannbf
yannbf force-pushed the review-core/02-delete-compare branch from f26f113 to 867db42 Compare June 19, 2026 15:14
@yannbf
yannbf merged commit 2c71d76 into yann/agentic-review-mcp-integration Jun 19, 2026
140 of 160 checks passed
@yannbf
yannbf deleted the review-core/02-delete-compare branch June 19, 2026 16:02
@Sidnioulz Sidnioulz added qa:success Pull Requests that were successfully QA'ed by the release team. and removed qa:needed Pull Requests that will need manual QA prior to release. labels Jul 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:normal Run our default set of CI jobs (choose this for most PRs). maintenance User-facing maintenance tasks qa:success Pull Requests that were successfully QA'ed by the release team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants