Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

reflect params in the debugger #148

Merged
merged 1 commit into from
May 7, 2024

Conversation

shakyShane
Copy link
Collaborator

@shakyShane shakyShane commented Apr 29, 2024

https://app.asana.com/0/0/1207195637811329/f

TL;DR

Update debugger to reflect url parameters and fix initial state loading. This will be needed in the next PR to preview/debug another new screen.

What changed?

  • Updated debugger to reflect url parameters
  • Fixed initial state loading

How to test?

  • Verify URL parameters are reflected correctly
    • npm run preview
    • then select one of the new options in the select menu
      • screen-breakageForm, or
      • screen-toggleReport
    • if the iframe previews load as they do in the video, then all is good :)
馃帴 Video uploaded on Graphite:

Why make this change?

This change ensures the debugger reflects correct URL parameters - to mimic what the native applications do. Without this change, you could not load the dashboard in this state, making debugging more difficult

@shakyShane
Copy link
Collaborator Author

shakyShane commented Apr 29, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @shakyShane and the rest of your teammates on Graphite Graphite

@@ -21,5 +21,5 @@
"jsxFactory": "h",
"jsxFragmentFactory": "Fragment"
},
"include": ["types.ts", "schema", "e2e", "scripts", "shared/js", "integration-tests", "guides"]
"include": ["types.ts", "schema", "e2e", "scripts", "shared/js", "integration-tests", "guides", "debugger"]
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

the debugger folder was previously missed (by mistake)

Comment on lines +39 to +46
let reflectList = ['screen']
let reflectParams = new URLSearchParams(Object.entries({ state: initialState }))
for (let [key, value] of searchParams) {
if (reflectList.includes(key)) {
reflectParams.set(key, value)
}
}

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This represents a set of keys that might be set on the outer debugger iframe. Anything in reflectList should be forwarded to each iframe instance

@shakyShane shakyShane marked this pull request as ready for review April 29, 2024 14:56
@shakyShane shakyShane force-pushed the 04-29-translations_for_prompt_breakage_screen branch from a861e11 to efffc8b Compare April 30, 2024 07:32
@shakyShane shakyShane force-pushed the 04-29-reflect_params_in_the_debugger branch from 140d6a0 to 1f69e7a Compare April 30, 2024 07:32
@shakyShane shakyShane changed the base branch from 04-29-translations_for_prompt_breakage_screen to main April 30, 2024 09:37
@shakyShane shakyShane force-pushed the 04-29-reflect_params_in_the_debugger branch from 1f69e7a to 40c07b8 Compare April 30, 2024 09:37
@shakyShane shakyShane force-pushed the 04-29-reflect_params_in_the_debugger branch from 40c07b8 to c1dbb19 Compare April 30, 2024 12:09
@shakyShane shakyShane merged commit 782d32a into main May 7, 2024
9 checks passed
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.

None yet

1 participant