Fix analytics tab not rendering on first click#22
Merged
Conversation
The stonks-dashboard custom element was being created before the external scripts defining its class had loaded. The Svelte web component didn't upgrade properly, leaving the tab blank until a second click (when scripts were cached). Now loadScript returns a Promise and AnalyticsTab waits for both scripts to load before rendering the custom element. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
admin-mcp | 6dd9e18 | Commit Preview URL Branch Preview URL |
Jun 25 2026, 03:50 PM |
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
<stonks-dashboard>custom element was created before the external scripts defining its class had loadedloadScriptnow returns aPromisethat resolves ononloadAnalyticsTabwaits for both scripts to load viaPromise.allbefore rendering the custom elementTest plan
🤖 Generated with Claude Code
Summary by cubic
Fixes a race condition that left the Analytics tab blank on first click. The tab now waits for the dashboard scripts to load before rendering the web component, so it shows up reliably even on slow networks.
loadScriptnow returns a Promise (resolves ononload, rejects ononerror).AnalyticsTabusesPromise.allto loadstonks-dashboard.jsandstonks-insights.js, setsscriptsReady, and renders only after both are loaded.Written for commit 6dd9e18. Summary will update on new commits.