Repository navigation
fix(docs): keep the gallery's sharing error from the reader's last action when a link update fails - #489
Conversation
…tion when a link update fails #348 (0ad268e) made reportSharing skip a debounced link update's failure while an error is already showing. #351 (b99eb9e) merged an older copy of docs/gallery.ts over it and the guard went away, so a failed background link update replaced the error from opening the playground, copying the gallery link or loading a link's edits with "Could not create a sharing link."
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Latest result Pull request merged. Final answersSession Pull request merged. Session Pull request evidence changed. Session Pull request evidence changed. Session Pull request evidence changed. Session Pull request evidence changed. Session Pull request evidence changed. Session Pull request evidence changed. Session Pull request evidence changed. |
comark-annotate
comark-badge
comark-bundle
comark-cards
comark-carousel
comark-cast
comark-charts
comark-chat
comark-chips
comark-cjk
comark-code
comark-code-notes
comark-colors
comark-comments
comark-critic
comark-deflist
comark-details
comark-diagrams
comark-diff
comark-embed
comark-fields
comark-figure
comark-file-tree
comark-footnotes
comark-git-graph
comark-github
comark-icon
comark-include
comark-keys
comark-links
comark-linter
comark-magic-move
comark-mark
markdown-it-to-comark
marked-to-comark
comark-mathml
comark-media
comark-metrics
migrate-to-comark
comark-motion
comark-outline
comark-properties
comark-qr
comark-quiz
comark-reading-time
remark-to-comark
comark-sources
comark-steps
comark-table
comark-tabs
comark-tests
comark-time
comark-ui
comark-xref
comark-zoom
commit: |
There was a problem hiding this comment.
Important
Preserve the action error for an overlapping update, but let a later edit report that the address bar still points to an older revision.
Approach: Centralizing error precedence in reportSharing() makes sense, but alert visibility is not a reliable way to tell whether an update belongs to the same action.
Reviewed changes — I traced all seven reportSharing() call sites and checked the failure sequence in a local Chromium fixture.
- Gallery error precedence: Explicit playground, copy, and shared-link load errors can still replace the alert; automatic link-update errors now show only while it is hidden.
gpt-6.2-sol(high) | 𝕏
There was a problem hiding this comment.
ℹ️ No P0 or P1 findings remain; one edge case is noted inline.
Approach: Tracking pending updates rather than alert visibility preserves the action error without silencing failures from later edits.
Reviewed changes — I re-reviewed 622f6c7f and checked both error paths in a local Chromium fixture running startGallery() with the installed codec.
- Scoped error precedence: Kept overlapping background failures from replacing an explicit action error, while letting later edits report their own failures.
- Separated background saves from Copy link retries: Dropped superseded background writes and their errors, while letting Copy link retry against the latest edit.
gpt-6.2-sol(high) | 𝕏

In the docs gallery, a failed background link update replaces the error from the reader's last action. "Could not open the playground." turns into "Could not create a sharing link." a moment later, and the reader no longer sees what went wrong with what they clicked.
#348 fixed this in
reportSharing: a call without a message returns early while an error is showing. #351 was built on a copy ofdocs/gallery.tsfrom before #348, and its merge withmainkept that copy, so the guard went away.This puts the guard back as #348 wrote it.
Tested: format, lint and both typechecks (root and
comark-ui-docs) pass. Nothing tests the gallery since #351 removed its e2e files, and I did not try the guard in a browser. As in #348, the error is never hidden again, so once one shows, later link-update failures stay silent for the rest of the page's life.