Skip to content

Commit 6802318

Browse files
committed
Hardcode OBBBA iframe URL to fix deep links
After multiple attempts to fix deep links through configuration, it appears there may be build-time or deployment issues preventing the correct URL from being used. This commit: 1. Hardcodes the correct GitHub Pages URL directly in the component 2. Removes the environment configuration that wasn't working 3. Adds debug logging to help diagnose issues in production This is a more direct approach that bypasses any potential: - Environment variable issues - Build-time configuration problems - Deployment configuration overrides Once deployed, deep links should finally work at URLs like: https://policyengine.org/us/obbba-household-explorer?household=46067&baseline=tcja-expiration
1 parent b6ba514 commit 6802318

3 files changed

Lines changed: 34 additions & 26 deletions

File tree

src/applets/OBBBAHouseholdExplorer.jsx

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import style from "../style";
44
import { useWindowHeight } from "../hooks/useWindow";
55
import { useEffect, useRef, useMemo } from "react";
66
import { useNavigate, useLocation } from "react-router-dom";
7-
import config from "../config/environment";
87

98
export default function OBBBAHouseholdExplorer() {
109
const windowHeight = useWindowHeight();
@@ -13,7 +12,11 @@ export default function OBBBAHouseholdExplorer() {
1312
const iframeRef = useRef(null);
1413

1514
// Memoize baseUrl to prevent unnecessary re-renders
16-
const baseUrl = useMemo(() => config.OBBBA_IFRAME_URL, []);
15+
// Hardcoding URL to bypass any build/environment issues
16+
const baseUrl = useMemo(
17+
() => "https://policyengine.github.io/obbba-scatter",
18+
[],
19+
);
1720

1821
// Memoize iframe origin for efficient message verification
1922
const iframeOrigin = useMemo(() => new URL(baseUrl).origin, [baseUrl]);
@@ -26,6 +29,14 @@ export default function OBBBAHouseholdExplorer() {
2629
? `${baseUrl}?${urlParams.toString()}`
2730
: baseUrl;
2831

32+
// Debug logging
33+
console.log("OBBBA Explorer Debug:", {
34+
baseUrl,
35+
locationSearch: location.search,
36+
urlParams: urlParams.toString(),
37+
finalIframeUrl: iframeUrl,
38+
});
39+
2940
useEffect(() => {
3041
// Listen for messages from the iframe
3142
const handleMessage = (event) => {

src/config/environment.js

Lines changed: 0 additions & 24 deletions
This file was deleted.

test-iframe.html

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>Test OBBBA Iframe</title>
5+
</head>
6+
<body>
7+
<h1>Testing OBBBA Iframe URL Construction</h1>
8+
9+
<p>Direct iframe with query parameters:</p>
10+
<iframe
11+
src="https://policyengine.github.io/obbba-scatter?household=46067&baseline=tcja-expiration"
12+
width="100%"
13+
height="600"
14+
style="border: 2px solid red;">
15+
</iframe>
16+
17+
<script>
18+
console.log('Iframe URL:', 'https://policyengine.github.io/obbba-scatter?household=46067&baseline=tcja-expiration');
19+
</script>
20+
</body>
21+
</html>

0 commit comments

Comments
 (0)