Skip to content

[Website] Keep Adminer and phpMyAdmin checks on their related Playground and show download errors - #4049

Merged
adamziel merged 2 commits into
trunkfrom
database-async-actions
Jul 14, 2026
Merged

[Website] Keep Adminer and phpMyAdmin checks on their related Playground and show download errors#4049
adamziel merged 2 commits into
trunkfrom
database-async-actions

Conversation

@adamziel

@adamziel adamziel commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

This PR keeps the Adminer and phpMyAdmin buttons tied to the current Playground and shows an error when database.sqlite cannot 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=static and npm exec nx typecheck playground-website --output-style=static.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

@adamziel adamziel changed the title [Website] Harden database tool detection and downloads Jul 14, 2026
@adamziel adamziel changed the title [Website] Ignore old database tool checks and show download errors Jul 14, 2026
@adamziel adamziel changed the title [Website] Keep Adminer and phpMyAdmin checks on the correct Playground and show download errors Jul 14, 2026
@adamziel
adamziel merged commit 4390045 into trunk Jul 14, 2026
53 checks passed
@adamziel
adamziel deleted the database-async-actions branch July 14, 2026 23:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment