Skip to content

Studio: Fix Copy preview link and Copy path failing in Safari - #9814

Closed
NilayYadav wants to merge 13 commits into
unslothai:mainfrom
NilayYadav:clipboard-user-gesture
Closed

NilayYadav wants to merge 13 commits into
unslothai:mainfrom
NilayYadav:clipboard-user-gesture

Conversation

@NilayYadav

Copy link
Copy Markdown
Collaborator

Both buttons awaited a network call before copying. Safari only allows a clipboard write while the click is still live, so the copy was rejected and you got "Couldn't copy the link".

Copy preview link now builds the URL from the store and copies straight away. Copy path prefetches the path when the menu opens so the copy is the first thing the click does.

@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 26, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 26, 2026
chatgpt-codex-connector[bot]

This comment was marked as resolved.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. What shall we delve into next?

Reviewed commit: 55b04d9a91

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

chatgpt-codex-connector[bot]

This comment was marked as resolved.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 26, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 26, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 26, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 26, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 26, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 26, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 26, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 26, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 26, 2026
@NilayYadav

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a6f1144a89

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

chatgpt-codex-connector[bot]

This comment was marked as resolved.

@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 26, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 27, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 27, 2026
@NilayYadav

Copy link
Copy Markdown
Collaborator Author

@codex review

1 similar comment
@NilayYadav

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8f237779e2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

chatgpt-codex-connector[bot]

This comment was marked as resolved.

@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 27, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 27, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 27, 2026
@unslothai unslothai deleted a comment from chatgpt-codex-connector Bot Aug 27, 2026
@NilayYadav

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: 5c1e057375

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@NilayYadav

Copy link
Copy Markdown
Collaborator Author

Before/after UI evidence

Pinned head 5c1e057375, merge base 32ba55b578, two isolated exact-SHA Studio installs on :8990 / :8991.

The scene clicks Copy preview link on a completed run in the History tab, in WebKit, on a Studio that reports a Cloudflare tunnel and answers /api/health in 6s once the app has booted. Six seconds is the ordinary slow-health case rather than a contrived one: fetchDeviceType already polls that endpoint for up to HARDWARE_DETECT_WAIT_MS = 5000ms while the backend measures hardware. Both sides are photographed at an identical 1500ms after the click.

fact BEFORE (merge base) AFTER (head)
health_calls_after_click 1 0
click_to_toast_ms 6390 1588
toast_visible_at_shot false true
copied_is_tunnel_link true true (control)
copy_button_visible true true (control)

BEFORE the click spends 6.4s in /api/health before it copies anything, so at the shot the card is untouched — no toast, no feedback of any kind. AFTER the refresh has already happened in an effect and the click copies first.

The controls are the point of the second half of the fix: copied_is_tunnel_link stays true at the same tunnel URL on both sides, so moving the refresh out of the click did not cost the store its tunnel URL — otherwise the button would have started copying a link only the host machine can open.

PR 9814 Copy preview link before/after

One limitation, stated plainly: Safari's actual clipboard denial does not reproduce under Playwright's WebKit — measured on this host, a write 9s after the click still resolves, in both the Studio origin and a bare page. So this pair proves the await that causes the denial is gone, not the denial itself. The behaviour under real Safari is unverified here.

health_calls_at_boot also moved (2 → 34) and is not evidence: it counts every /api/health from page load to the shot, so on the AFTER side — a Studio launched straight off a fresh install — it measures how long the cold boot took. Measured separately on that same build the calls land at 1.09s, 1.11s (app boot), 1.40s (the grid's mount read), then every 15s, which is the poll as written.

@NilayYadav

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

To use Codex here, create a Codex account and connect to github.

@NilayYadav

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: 5c1e057375

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@danielhanchen

Copy link
Copy Markdown
Member

Confirmed the awaited network call before the clipboard write is gone in history-card-grid.tsx and gguf-download-card.tsx, and the evidence pair shows the tunnel URL is still what gets copied. This also adds a 15s /api/health poll in the History tab and a hover-armed path resolve that costs a full Hugging Face cache scan per settled pointer, on every browser; could you confirm what those cost on a large catalog before I review?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants