Fix deep linking for OBBBA household-by-household iframe#2702
Merged
Conversation
- Pass URL parameters from parent app to embedded iframe on initial load - Listen for postMessage events from iframe to update parent app URL - Memoize iframe URL construction and origin verification for performance This enables proper deep linking functionality where: 1. Permalinks with query parameters (e.g., ?household=46067&baseline=tcja-expiration) correctly load in the iframe 2. Household selections in the OBBBA app update the parent app's URL for shareable links Fixes #2701 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Contributor
There was a problem hiding this comment.
Pull Request Overview
This pull request fixes deep linking functionality for the OBBBA household-by-household iframe by enabling bi-directional URL synchronization between the parent app and embedded iframe.
- Implements URL parameter forwarding from parent to iframe on initial load
- Adds postMessage listener to update parent URL when iframe navigation occurs
- Optimizes performance using React memoization for URL construction and origin validation
- Use localhost:3001 for OBBBA household-by-household app when running locally - Remove unused OBBBAHouseholdExplorer component - Update both iframe URL and origin verification to handle localhost This allows developers to test the OBBBA integration locally without needing to deploy changes. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Although currently unused, keeping this component for potential future use. Both OBBBA apps currently use the generic AppPage component. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
The localhost logic was causing confusion. The production URL works fine for local development. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Set iframe src only on initial load, not on every URL change - This prevents a feedback loop where iframe updates cause it to reload - Parent URL still updates when iframe sends postMessage events 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Reverted AppPage to original state, then added conditional logic - URL parameter passing and message handling only applies to obbba-household-by-household - Other iframe apps continue to work as before without deep linking - Prevents iframe reload when URL changes originate from the iframe This ensures the deep linking functionality is only applied where needed. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Problem
The OBBBA household-by-household iframe had two main issues:
?household=46067&baseline=tcja-expiration) were not being passed to the iframeSolution
Modified
AppPage.jsxto:Test plan
/us/obbba-household-by-household?household=46067&baseline=tcja-expirationFixes #2701
🤖 Generated with Claude Code