Skip to content

fix: remove beforeunload receipt popup, upgrade share to Web Share API#22

Merged
nitrocode merged 2 commits into
mainfrom
copilot/fix-receipt-sharing-popup-issue
Apr 22, 2026
Merged

fix: remove beforeunload receipt popup, upgrade share to Web Share API#22
nitrocode merged 2 commits into
mainfrom
copilot/fix-receipt-sharing-popup-issue

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 22, 2026

  • Identify root cause: CSS display: flex on .modal-overlay and .share-doom-panel overrides the HTML hidden attribute (author stylesheet beats user-agent stylesheet)
  • Add [hidden] { display: none !important; } to the CSS reset section to enforce the hidden attribute universally

- Remove beforeunload handler that tried to show receipt modal on
  page leave — browsers block custom modals in beforeunload, causing
  a broken native dialog instead
- Update openSharePopup to use navigator.share (native OS share
  sheet on mobile/modern browsers) with Twitter fallback
- Rename receipt "Share Receipt" → "Share" and "Copy Text" →
  "Copy Receipt" for cleaner UX

Agent-Logs-Url: https://github.com/nitrocode/token-deathclock/sessions/df71b0f3-a0c9-4299-8b2a-2a6efa44cb60

Co-authored-by: nitrocode <7775707+nitrocode@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 22, 2026

👁️ PR Preview

🚀 Open Preview

Deployed from commit 1d9d240 · Updates on every push to this PR
(Preview is removed automatically when the PR is closed.)

CSS `display: flex` on `.modal-overlay` and `.share-doom-panel` was
overriding the browser's user-agent `[hidden] { display: none }` rule
(author stylesheets have higher priority than UA stylesheets). This
caused the receipt modal to render as a full-screen overlay the moment
the page loaded, blocking all content.

Adding `[hidden] { display: none !important; }` in the CSS reset
section enforces the semantic meaning of the HTML `hidden` attribute
regardless of what display value a class sets.

Agent-Logs-Url: https://github.com/nitrocode/token-deathclock/sessions/51461cef-791a-4bae-b565-79a3dd0840d9

Co-authored-by: nitrocode <7775707+nitrocode@users.noreply.github.com>
@nitrocode nitrocode merged commit 9c68264 into main Apr 22, 2026
3 of 4 checks passed
@nitrocode nitrocode deleted the copilot/fix-receipt-sharing-popup-issue branch April 22, 2026 09:45
github-actions Bot added a commit that referenced this pull request Apr 22, 2026
Copilot stopped work on behalf of nitrocode due to an error April 22, 2026 09:46
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