[Website] Keep Adminer and phpMyAdmin checks on their related Playground and show download errors - #4049
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Hardens database tooling UX in the Playground website by preventing stale async detections from updating UI state after the active Playground changes, and by making database downloads more resilient and user-visible when failures occur.
Changes:
- Ignore stale async results in phpMyAdmin/Adminer detection effects via cancellation guards.
- Improve database download UX (busy state, error reporting, safer link lifecycle, delayed blob URL revocation).
- Add unit tests for
downloadDatabase()behavior around missing files and URL revocation timing.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| packages/playground/website/src/components/site-manager/site-database-panel/phpmyadmin-button.tsx | Adds effect cancellation to prevent stale phpMyAdmin detection updates. |
| packages/playground/website/src/components/site-manager/site-database-panel/adminer-button.tsx | Adds effect cancellation to prevent stale Adminer detection updates. |
| packages/playground/website/src/components/site-manager/site-database-panel/download-button.tsx | Adds download busy/error UI and refactors/exports downloadDatabase() with safer link/blob handling. |
| packages/playground/website/src/components/site-manager/site-database-panel/download-button.spec.ts | Adds jsdom-based unit tests for download behavior and URL revocation delay. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
This PR keeps the Adminer and phpMyAdmin buttons tied to the current Playground and shows an error when
database.sqlitecannot be downloaded.The Database panel has two buttons: Open Adminer and Open phpMyAdmin. Before showing them, the panel asks the current Playground whether each tool is already installed. That answer is asynchronous. If the user switches to another Playground before it arrives, the answer belongs to the old Playground but can update the buttons for the new one. If the check fails, it also creates an unhandled promise rejection.
Each check now stops updating state after its Playground is replaced or the button is unmounted. Failed checks are logged and leave the button ready to try the install.
The database download button now shows a busy state while it reads
database.sqlite. A missing file or failed read shows an error below the button instead of becoming an unhandled rejection. The temporary download link is removed after the click, and the blob URL is revoked after 60 seconds instead of immediately.This is needed before these buttons move into the Dock in #3965.
Verified with
npm exec nx test playground-website --output-style=staticandnpm exec nx typecheck playground-website --output-style=static.