Matches welcome: share public trade list via /t/:id #240
<!-- codex-pull-request-review-summary -->
<!-- codex-review-state:v1 {"code_review":{"commit_sha":"63d99fda3695a03eee5fcad1b82d9317d2626467","has_any_findings":true,"has_unresolved_findings":true,"status":"completed"},"security_review":{"commit_sha":null,"has_any_findings":null,"has_unresolved_findings":null,"status":null}} -->
<details>
<summary><strong>Codex Review Summary</strong>: ✅ Completed</summary>
This comment shows the latest Codex review activity on this pull request.
| Review | Status | Commit | Review trigger |
| --- | --- | --- | --- |
| 📝 Code Review | ✅ Completed <relative-time datetime="2026-11-29T04:40:34.450459Z">2026-11-29T04:40:34.450459Z</relative-time> | 63d99fd | PR opened |
<details> <summary>ℹ️ About Codex in GitHub</summary>
<br/>
Your 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.
</details>
</details>
<!-- codex-review-receipt:v1 -->
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 63d99fda36
<details> <summary>ℹ️ About Codex in GitHub</summary>
<br/>
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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".
</details>
<sub><sub>!P2 Badge</sub></sub> Block sharing after collection-load errors
If the initial collection read fails, useUserCollection leaves entries empty and sets the status to error, but this guard still enables sharing. If the share write succeeds, it can create an empty public list or overwrite an existing snapshot with an empty one; disable sharing on collection errors as well.
Useful? React with 👍 / 👎.
<!-- codex-code-review-finding:v1 -->
<sub><sub>!P2 Badge</sub></sub> Use a trade-list UTM medium for these links
This call changes only the campaign, while buildShareUrl hardcodes utm_medium=iso_uft. Consequently, links shared from Matches are attributed as ISO/UFT rather than trade-list traffic, which misclassifies the resulting pageviews; allow this call to set the medium too.
Useful? React with 👍 / 👎.
<!-- codex-code-review-finding:v1 -->
<!-- CURSOR_AUTOMATION_ID: ee6edd68-b302-11f1-bb68-864e54d14197 | RUN_ID: bc-243f08e0-d88d-49f6-912a-e7818516e933 -->
🔒 Agentic Security Review
Severity: HIGH
This useEffect writes a world-readable shares/{shareId} snapshot (and sets publicShareId) as soon as the welcome panel mounts, including enablePublicShare when the user has never opted in and after a revoked/tombstoned id. Opening /matches?welcome=1 is the normal post-onboarding path and only requires a signed-in session, so collectors can have ISO/UFT lists, ownerUid, display name (email local-part fallback), and Discord/region published without clicking Share.
Impact: Anyone who later obtains that share id can get the document without auth (firestore.rules allow public get on non-revoked shares). Collection’s enableShare() is click-gated; this path is not.
<div><a href="https://cursor.com/open?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9DVVJTT1IiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OjAwNzUxNTdiLWQ2NTctNDA4NS05OGY2LTc0Mzc5YWE1YTBhNCIsImVuY3J5cHRpb25LZXkiOiJobG9jRUo2OUl4eVZsNWYxc3cyVjFuMDVGSU11U3JjYXlMRFh0LVpWUFNBIiwiYnJhbmNoIjoiY3Vyc29yL21hdGNoZXMtc2hhcmUtdHJhZGUtbGlzdC00ZmM5IiwicmVwb093bmVyIjoiYmpheDEzIiwicmVwb05hbWUiOiJMb3N0RGVja3MiLCJwcm92aWRlciI6ImdpdGh1YiIsImhvc3RuYW1lIjoiZ2l0aHViLmNvbSJ9fQ" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-cursor-light.png"><img alt="Fix in Cursor" width="115" height="28" src="https://cursor.com/assets/images/fix-in-cursor-dark.png"></picture></a> <a href="https://cursor.com/agents?link=eyJ2ZXJzaW9uIjoxLCJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9XRUIiLCJkYXRhIjp7InJlZGlzS2V5IjoiYnVnYm90OjAwNzUxNTdiLWQ2NTctNDA4NS05OGY2LTc0Mzc5YWE1YTBhNCIsImVuY3J5cHRpb25LZXkiOiJobG9jRUo2OUl4eVZsNWYxc3cyVjFuMDVGSU11U3JjYXlMRFh0LVpWUFNBIiwiYnJhbmNoIjoiY3Vyc29yL21hdGNoZXMtc2hhcmUtdHJhZGUtbGlzdC00ZmM5IiwicmVwb093bmVyIjoiYmpheDEzIiwicmVwb05hbWUiOiJMb3N0RGVja3MiLCJwck51bWJlciI6MjQwLCJjb21taXRTaGEiOiJlZmZiNmJhZTA4YWI3MDc4NTY1NjVjMTAzNmZhYjJjYzhjNTk5Nzg4IiwicHJvdmlkZXIiOiJnaXRodWIiLCJob3N0bmFtZSI6ImdpdGh1Yi5jb20ifX0" target="_blank" rel="noopener noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/fix-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/fix-in-web-light.png"><img alt="Fix in Web" width="99" height="28" src="https://cursor.com/assets/images/fix-in-web-dark.png"></picture></a></div>
<sup>Reviewed by Cursor Security Reviewer for commit effb6bae08ab707856565c1036fab2cc8c599788. Configure here.</sup>
<details>
<summary>Stale comment</summary>
<blockquote>
</blockquote>
</details>
Intentional for this PR: iOS Safari requires navigator.share inside the click’s user activation, so we cannot await enablePublicShare / refreshPublicShare in handleShare. Preparing the /t/:id snapshot when the welcome panel mounts is the same opt-in public-list model as Collection’s “Share a public trade list link” toggle (which also writes shares/{id} before copy). This component only mounts on /matches?welcome=1, not every Matches visit.
chatgpt-codex-connector[bot]
bjax13
<!-- CURSOR_AGENT_PR_BODY_BEGIN -->
Summary
Replaces the Matches welcome panel Share your list placeholder with a working share flow that points at the collector's public trade list at
/t/:shareId.Behavior
navigator.shareuser activation).navigator.canSharewhen available; clipboard withwriteText→execCommandfallback; manual copy link if both fail.trade_list_sharedwithmethod(native|copy);AbortErrordoes not emit the event.How to verify on hosted app
1. Deploy via Front end only deploy after merge.
2. Sign in →
/matches?welcome=1→ wait until Share your list enables (not “Loading…” / “Preparing…”).3. Tap Share: mobile should open the share sheet; desktop should copy or show manual link.
4. Open
/t/:idin a private window.Tests
npm run check·cd frontend && npm run test:coverageCoverage for prep-on-load, tombstone minting, prefs-not-ready, AbortError, clipboard failure UI, and click path without
refreshPublicShare/enablePublicShare.Deploy steps
Hosting-only frontend deploy.
<!-- CURSOR_AGENT_PR_BODY_END -->
<div><a href="https://cursor.com/agents/bc-308c9ab2-0504-5b4f-be2f-c4d10db54fc9?cursor_ref=pr_footer&cursor_cta=open_in_web"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-web-light.png"><img alt="Open in Web" width="114" height="28" src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a> <a href="https://cursor.com/background-agent?bcId=bc-308c9ab2-0504-5b4f-be2f-c4d10db54fc9&cursor_ref=pr_footer&cursor_cta=open_in_cursor"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img alt="Open in Cursor" width="131" height="28" src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a> </div>