Skip to content

Migrate SERP chrome from react-rails to React on Rails#2010

Open
justin808 wants to merge 1 commit into
GSA:mainfrom
justin808:codex/search-results-shell-slice
Open

Migrate SERP chrome from react-rails to React on Rails#2010
justin808 wants to merge 1 commit into
GSA:mainfrom
justin808:codex/search-results-shell-slice

Conversation

@justin808
Copy link
Copy Markdown

@justin808 justin808 commented Apr 12, 2026

Summary

  • migrate the search results shell from react-rails mounts to React on Rails mounts
  • split the SERP shell into dedicated React on Rails header, body, and footer mounts
  • keep result rendering in SearchResultsLayout while moving header/footer provider setup into dedicated wrapper components
  • add focused Jest and helper coverage for the extracted mounts and refresh the layout snapshot

Why this change

I maintain both react-rails and react_on_rails, and my recommendation for Rails apps that already use React is to move toward React on Rails as the better-supported path going forward.

React on Rails is maintained alongside Shakapacker, has current documentation, and gives a clearer long-term Rails + React integration story than the older react-rails / react_ujs mounting model.

Relevant docs:

For this repository specifically, the main benefit is maintainability through better component boundaries.

Today the search results page is largely organized around one large react_component mount with a large Rails-built prop payload. This PR keeps the search-results body contract intact, but moves the header and footer chrome into smaller React on Rails mounts. That makes the page easier to reason about, easier to migrate incrementally, and easier to test without taking on a page-wide rewrite.

This also provides a more maintainable path for future work if the project wants to continue moving away from react-rails one boundary at a time.

Scope

This PR intentionally does not rewrite the results layout or change the central prop-building flow.

It keeps the existing search-results rendering contract in place and limits the migration to low-coupling shell chrome so the change stays reviewable and low risk.

Testing

  • yarn test --runInBand -u app/javascript/test/SearchResultsLayout.test.tsx app/javascript/test/SearchResultsHeader.test.tsx app/javascript/test/SearchResultsFooter.test.tsx
  • yarn test --runInBand app/javascript/test/SearchResultsLayout.test.tsx app/javascript/test/SearchResultsHeader.test.tsx app/javascript/test/SearchResultsFooter.test.tsx
  • bundle exec rspec spec/helpers/react_helper_spec.rb was blocked locally because MySQL was not available at 127.0.0.1:3306 in this environment
  • GitHub reports this PR as mergeable after rebasing onto upstream main; CircleCI checks are running in the PR checks UI

@justin808 justin808 changed the title Extract SERP chrome into separate React mounts Migrate SERP chrome from react-rails to React on Rails Apr 13, 2026
@justin808 justin808 marked this pull request as ready for review April 19, 2026 10:17
@justin808 justin808 force-pushed the codex/search-results-shell-slice branch from 02cb743 to 7ceda85 Compare April 30, 2026 09:04
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