Repository navigation
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
Export share links lose selected control settings during redirects, and component tests do not cover the pending, failed, and updating link behaviors.
2 open issues
1 file not reviewed
.github/extensions/replica-prototype/assets/renderer.js: Generated file
What changed in this PR
Aligns the Copilot canvas with Hub’s current share-link contract, replacing legacy Rails assumptions.
Changes:
- Uses UUID share IDs, nullable URLs, and explicit revocation results.
- Makes copy, open, and revoke actions reflect export availability.
- Updates regression tests, Storybook fixtures, and documentation.
| File | Description |
|---|---|
hub/docs/prototype-canvas.md |
Documents the current sharing contract. |
hub/client/hooks/use-canvas-share-links/types.ts |
Reuses extension share types. |
hub/client/hooks/use-canvas-share-links/index.ts |
Handles UUIDs and revocation results. |
hub/client/hooks/use-canvas-share-links/index.test.tsx |
Tests updated hook behavior. |
hub/client/hooks/use-canvas-share-links/en.ts |
Adds export-state messages. |
hub/client/features/prototype-canvas-share-links/stories.tsx |
Adds export-state fixtures. |
hub/client/features/prototype-canvas-share-links/index.tsx |
Gates actions by link availability. |
hub/client/features/prototype-canvas-share-links/index.test.tsx |
Covers readerless and revoking links. |
hub/client/application/prototype-canvas/stories.tsx |
Updates publication demo responses. |
hub/client/application/prototype-canvas/stories.test.tsx |
Updates expected share URLs. |
.github/extensions/replica-prototype/start-canvas-server/index.test.mjs |
Exercises UUID sharing through the server. |
.github/extensions/replica-prototype/share-links/index.test.mjs |
Tests destinations and export states. |
.github/extensions/replica-prototype/share-links/index.mts |
Implements the updated sharing contract. |
.github/extensions/replica-prototype/share-links/index.mjs |
Synchronizes the JavaScript implementation. |
Review effort: Balanced (adaptive)
Hub now reports its configured public share origin, and the extension accepts /s/ links only on that origin. Control settings are added only to Hub /shared/ links, because the public reader drops query parameters. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
The settings-encoding blocker incorrectly hides unrelated reader links and recovery URLs and must be restricted to Hub Copy/Open actions that add settings.
1 open issue
2 resolved since last review
1 file not reviewed
.github/extensions/replica-prototype/assets/renderer.js: Generated file
Review effort: Balanced (adaptive)
There was a problem hiding this comment.
🔵 Needs a closer look
Interacting changes to Hub share-link contracts, extension URL trust checks, and asynchronous export/revocation behavior exceed the limited-consequence scope for automated approval.
No open issues 🎉
1 resolved since last review
1 file not reviewed
.github/extensions/replica-prototype/assets/renderer.js: Generated file
Review effort: Balanced (adaptive)
|
Closing in favor of #500, which covers the same share-link contract fix. |
Port the selected origin contract from #510 without importing its history. Keep older same-Hub links and the existing sharing lifecycle safeguards. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>


Agent assessment
Self-reported assessment, not an independent review.
Assessed revision:
a5c8ea7dabf362c032630e73931b45a89f1dfa18↑ Share-link DB tests passed 8/8 before the merge; the merge did not change those files.
↑ New tests reject reader links on other origins and keep control settings off reader links.
↓ Not tested against a deployed Hub or the HTTPS public reader.
↓ CI for this head had not finished when assessed.
/shared/or/s/URLs; the extension parsed IDs as integers and accepted only/share/URLs.↓ No production trace was inspected.
Why
The Copilot canvas extension was written for the earlier Rails Hub. The current Hub identifies share links by UUID strings and returns their addresses as
/shared/<uuid>on Hub or/s/<uuid>on the public-sharing reader. When public exports are off, a link's URL isnull. The extension still expected numeric IDs and/share/<uuid>addresses, so it rejected Hub's responses and could not open or revoke links.What changes
The extension now accepts share-link IDs as UUID strings, while repository IDs, prototype IDs and Build numbers stay integers. It accepts link addresses only on Hub's own origin (
/shared/<uuid>) or on the public reader origin that/api/canvas/prototypenow reports aspublicShareOrigin(/s/<uuid>), and only when the last path segment matches the link's ID. Revoking a link reports Hub'srevokedorrevokingresult instead of a yes/no flag.The canvas share page now shows each link's export state:
The public reader drops query parameters when it redirects, so Include current control settings applies only to Hub
/shared/links. Reader links stay unchanged and the page says so.flowchart LR subgraph Before A[Hub returns id: UUID, url: /shared/... or /s/... or null] --> B[Extension expects numeric id and /share/ URL] --> C[Request rejected] end subgraph After D[Hub returns id: UUID, url: /shared/... or /s/... or null] --> E[Extension checks UUID and allowed origin and path] --> F[List, open, copy or revoke by export state] endhub/docs/prototype-canvas.mdnow describes this contract. The stories use the new link fixtures and add Export states and Control Settings Reader Link stories. No stories were removed.Storybook screenshots
Every story in Prototype canvas/Share links page is included, because the page component and its shared link fixture both changed. Prototype canvas/Publication example is limited to the two stories that open the share panel. All captures come from this head's Storybook build at 1024 px wide and full content height, with the share panel open in the Publication example stories.
Prototype canvas/Share links page, Light, 1024 px wide (36 stories)
Prototype canvas/Share links page / Empty, Light, 1024 px wide
Prototype canvas/Share links page / Thirty Day Maximum, Light, 1024 px wide
Prototype canvas/Share links page / Internal Only, Light, 1024 px wide
Prototype canvas/Share links page / Internal Url Unavailable, Light, 1024 px wide
Prototype canvas/Share links page / Sharing Disabled, Light, 1024 px wide
Prototype canvas/Share links page / Policy Changed, Light, 1024 px wide
Prototype canvas/Share links page / Access Changed, Light, 1024 px wide
Prototype canvas/Share links page / Single, Light, 1024 px wide
Prototype canvas/Share links page / Export States, Light, 1024 px wide
Prototype canvas/Share links page / Two Builds, Light, 1024 px wide
Prototype canvas/Share links page / Multiple, Light, 1024 px wide
Prototype canvas/Share links page / Many Links, Light, 1024 px wide
Prototype canvas/Share links page / Previous Build, Light, 1024 px wide
Prototype canvas/Share links page / Control Settings, Light, 1024 px wide
Prototype canvas/Share links page / Control Settings Warning, Light, 1024 px wide
Prototype canvas/Share links page / Control Settings Matching Build, Light, 1024 px wide
Prototype canvas/Share links page / Control Settings Uncommitted Changes, Light, 1024 px wide
Prototype canvas/Share links page / Control Settings Unknown Status, Light, 1024 px wide
Prototype canvas/Share links page / Loading, Light, 1024 px wide
Prototype canvas/Share links page / Failed, Light, 1024 px wide
Prototype canvas/Share links page / Unknown Outcome, Light, 1024 px wide
Prototype canvas/Share links page / Fresh Authorization Required, Light, 1024 px wide
Prototype canvas/Share links page / Creating, Light, 1024 px wide
Prototype canvas/Share links page / Created, Light, 1024 px wide
Prototype canvas/Share links page / Disconnected, Light, 1024 px wide
Prototype canvas/Share links page / No Build, Light, 1024 px wide
Prototype canvas/Share links page / Insufficient Permission, Light, 1024 px wide
Prototype canvas/Share links page / Permission Unknown, Light, 1024 px wide
Prototype canvas/Share links page / Expired Link, Light, 1024 px wide
Prototype canvas/Share links page / Never Expires, Light, 1024 px wide
Prototype canvas/Share links page / Created Link Recovery, Light, 1024 px wide
Prototype canvas/Share links page / Refreshing Existing Links, Light, 1024 px wide
Prototype canvas/Share links page / Control Settings Saving, Light, 1024 px wide
Prototype canvas/Share links page / Control Settings Failed, Light, 1024 px wide
Prototype canvas/Share links page / Invalid Label, Light, 1024 px wide
Prototype canvas/Share links page / Control Settings Reader Link, Light, 1024 px wide
Prototype canvas/Publication example, Light, 1024 px wide (2 stories)
Prototype canvas/Publication example / Share Management, Light, 1024 px wide
Prototype canvas/Publication example / Narrow Share Management, Light, 1024 px wide
Prototype canvas/Share links page, Dark, 1024 px wide (36 stories)
Prototype canvas/Share links page / Empty, Dark, 1024 px wide
Prototype canvas/Share links page / Thirty Day Maximum, Dark, 1024 px wide
Prototype canvas/Share links page / Internal Only, Dark, 1024 px wide
Prototype canvas/Share links page / Internal Url Unavailable, Dark, 1024 px wide
Prototype canvas/Share links page / Sharing Disabled, Dark, 1024 px wide
Prototype canvas/Share links page / Policy Changed, Dark, 1024 px wide
Prototype canvas/Share links page / Access Changed, Dark, 1024 px wide
Prototype canvas/Share links page / Single, Dark, 1024 px wide
Prototype canvas/Share links page / Export States, Dark, 1024 px wide
Prototype canvas/Share links page / Two Builds, Dark, 1024 px wide
Prototype canvas/Share links page / Multiple, Dark, 1024 px wide
Prototype canvas/Share links page / Many Links, Dark, 1024 px wide
Prototype canvas/Share links page / Previous Build, Dark, 1024 px wide
Prototype canvas/Share links page / Control Settings, Dark, 1024 px wide
Prototype canvas/Share links page / Control Settings Warning, Dark, 1024 px wide
Prototype canvas/Share links page / Control Settings Matching Build, Dark, 1024 px wide
Prototype canvas/Share links page / Control Settings Uncommitted Changes, Dark, 1024 px wide
Prototype canvas/Share links page / Control Settings Unknown Status, Dark, 1024 px wide
Prototype canvas/Share links page / Loading, Dark, 1024 px wide
Prototype canvas/Share links page / Failed, Dark, 1024 px wide
Prototype canvas/Share links page / Unknown Outcome, Dark, 1024 px wide
Prototype canvas/Share links page / Fresh Authorization Required, Dark, 1024 px wide
Prototype canvas/Share links page / Creating, Dark, 1024 px wide
Prototype canvas/Share links page / Created, Dark, 1024 px wide
Prototype canvas/Share links page / Disconnected, Dark, 1024 px wide
Prototype canvas/Share links page / No Build, Dark, 1024 px wide
Prototype canvas/Share links page / Insufficient Permission, Dark, 1024 px wide
Prototype canvas/Share links page / Permission Unknown, Dark, 1024 px wide
Prototype canvas/Share links page / Expired Link, Dark, 1024 px wide
Prototype canvas/Share links page / Never Expires, Dark, 1024 px wide
Prototype canvas/Share links page / Created Link Recovery, Dark, 1024 px wide
Prototype canvas/Share links page / Refreshing Existing Links, Dark, 1024 px wide
Prototype canvas/Share links page / Control Settings Saving, Dark, 1024 px wide
Prototype canvas/Share links page / Control Settings Failed, Dark, 1024 px wide
Prototype canvas/Share links page / Invalid Label, Dark, 1024 px wide
Prototype canvas/Share links page / Control Settings Reader Link, Dark, 1024 px wide
Prototype canvas/Publication example, Dark, 1024 px wide (2 stories)
Prototype canvas/Publication example / Share Management, Dark, 1024 px wide
Prototype canvas/Publication example / Narrow Share Management, Dark, 1024 px wide