Skip to content

feat: update orbitalSim and provider to receive the defaultZoom value as a prop - #457

Merged
jeffinnes merged 1 commit into
develop-react-v19from
ji-456-Update_OrbitalSim_widget_to_receive_and_use_a_defaultZoom_prop
Jun 2, 2026
Merged

jeffinnes merged 1 commit into
develop-react-v19from
ji-456-Update_OrbitalSim_widget_to_receive_and_use_a_defaultZoom_prop

Conversation

@jeffinnes

@jeffinnes jeffinnes commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

What this change does

Resolves #456

This PR updates the OrbitalSimProvider and OrbitalSim component to handle receiving the defaultZoom as a prop. It also corrects a hardcoded default zoom value that has been overriding what was set in the datasets.

Additionally it updates the Storybook configuration for this widget to allow setting a default zoom value.

I also snuck in the prop Type fix from issue #445.

Notes

Regarding where the defaultZoom fallback value is set

I decided to make the defaultZoom a required prop that only accepts a number in the types definition in packages/epo-widget-lib/src/widgets/OrbitalSim/Context/OrbitalSimContext.types.ts. While allowing the prop to be null or undefined and setting a fallback value in the context provider is a valid approach that I considered, I ultimately felt that the fallback value should be handled in the client. This keeps the widget itself as agnostic as possible and allows the implementor to determine an use a default value that is appropriate for their use case instead of a value we arbitrarily set right now.

Testing

Basic testing can performed in the Storybook but yarn linking this package into the investigations-client and testing in the HazAst investigation is best.

Confirm the following testing is complete:

  • Testing the package builds successfully
  • Testing the component in isolation in its own story(ies)
  • Testing the component in any stories for widgets or other components that use it
  • Testing the component in the target client, if possible/feasible
  • Testing the target client builds successfully

… as a prop

Instead of getting the defaultZoom value from the orbitData object
@jeffinnes
jeffinnes requested a review from soshwosh June 2, 2026 17:14
@soshwosh

soshwosh commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Neither refreshing the page nor emptying the cache and doing a hard reload would get the change to apply in the client once yarn link-ed. Deleting the .next worked. Seems like this will only be an issue during local development, but leaving a comment for posterity/in case something arises later on.

@jeffinnes
jeffinnes merged commit 3676db9 into develop-react-v19 Jun 2, 2026
1 check passed
@jeffinnes

Copy link
Copy Markdown
Contributor Author

I discovered after merging this PR that apparently I had not actually pushed up my changes to fix the OrbitalSimContext's prop types as described in issue #445

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.

2 participants