YPE-1565: Show error when YouVersionProvider has no appKey#264
YPE-1565: Show error when YouVersionProvider has no appKey#264cameronapak wants to merge 2 commits into
Conversation
Render a styled "Missing app key" message instead of a blank page; hooks provider throws for hooks-only consumers. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: 243cf88 The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
role="alert" already implies aria-live="assertive"; the explicit polite value downgraded announcement urgency for a config error. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Hey @camrun91, what do we do about locales that we add that aren't yet Crowdin translated? Do we put in potential strings or leave those in English in these locale files?
There was a problem hiding this comment.
What do you mean new locals? If you are talking adding new strings the process will be to add them to the file in the localization repo. This is a good test to find out the best way to do this as the english source files shouldn't need to be translated and we need a process to make this quicker
Empty/missing
appKeyrendered a blank page. Now: UI provider shows a styled "Missing app key" message; hooks provider throws.MissingAppKeypanel + Storybook storyYPE-1565
🤖 Generated with Claude Code
Greptile Summary
This PR fixes a blank-page regression (YPE-1565) when
YouVersionProviderreceives a missing or emptyappKey. The UI package now shows a styled, i18n-aware "Missing app key" error panel instead of rendering nothing, while the hooks package throws a descriptive error for hooks-only consumers.packages/ui: NewMissingAppKeycomponent withrole=\"alert\", light/dark theme support, and translations in en/es/fr;YouVersionProviderintercepts the bad key before delegating to the base provider.packages/hooks: Earlythrowbefore any hook calls gives hooks-only consumers a loud, actionable failure rather than a silent empty render.undefined,'', and whitespace-only inputs for both providers; a Storybook play-function story validates the rendered alert.Confidence Score: 5/5
Safe to merge — the change is a targeted guard for a misconfiguration path that previously produced a blank page, and it does not touch any production data or auth flows.
Both providers handle the three invalid-key variants correctly, the UI provider correctly places its hook call before the early return, tests cover all cases, and i18n keys are in sync across all three locale files.
No files require special attention.
Important Files Changed
Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD A[YouVersionProvider called] --> B{appKey empty / whitespace?} B -- Yes, UI package --> C[Return YvStyles + MissingAppKey panel] B -- Yes, hooks package --> D[throw Error non-empty appKey required] B -- No --> E[Normal render path] E -- UI package --> F[BaseYouVersionProvider + YvStyles + children] E -- hooks package --> G[useResolvedTheme + context setup + children] D --> H[Nearest ErrorBoundary or app crash] C --> I[Styled alert panel with i18n message]%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%% flowchart TD A[YouVersionProvider called] --> B{appKey empty / whitespace?} B -- Yes, UI package --> C[Return YvStyles + MissingAppKey panel] B -- Yes, hooks package --> D[throw Error non-empty appKey required] B -- No --> E[Normal render path] E -- UI package --> F[BaseYouVersionProvider + YvStyles + children] E -- hooks package --> G[useResolvedTheme + context setup + children] D --> H[Nearest ErrorBoundary or app crash] C --> I[Styled alert panel with i18n message]Reviews (2): Last reviewed commit: "fix(ui): remove redundant aria-live on a..." | Re-trigger Greptile