Skip to content

fix(canvas): match the Hub share-link contract - #500

Merged
arniebradfo merged 13 commits into
build/hub/newfrom
feat/canvas-connected-sharing-client
Dec 4, 2026
Merged

arniebradfo merged 13 commits into
build/hub/newfrom
feat/canvas-connected-sharing-client

Conversation

@arniebradfo

@arniebradfo arniebradfo commented Dec 3, 2026 •

Copy link
Copy Markdown
Collaborator

Why

Canvas still expects the old Hub's share-link response. Connected users need to create and revoke links to published Builds using the Hub API that landed in #485.

What changes

New links stay pinned to the published Build shown when Share prototype opens. Canvas uses Hub's permissions and clears previously loaded public links if access is lost or the public reader address changes. It reloads the list without changing the displayed Build or retrying a create that may have finished.

For public exports, Canvas fills in a password under Hub's sharing policy. Copy it before creating the link and send it separately. Canvas copies reader URLs without adding current control settings. If Hub requires a password, an older link without one can still be revoked but cannot be copied or opened.

The Never Expires story was removed because current Hub links always have an expiry. The preview shell, Controls, comments, and Hub's sharing policy are unchanged. The hosted export worker was not exercised against a deployed service.

Storybook screenshots

Share links and export status

Prototype canvas/Share links page: Public Export Statuses - Light, 1024x768 viewport, list in view

Prototype canvas/Share links page: Single - Light, 1440x1250 viewport

Prototype canvas/Share links page: Two Builds - Light, 1440x1250 viewport

Prototype canvas/Share links page: Multiple - Light, 1440x1250 viewport

Prototype canvas/Share links page: Many Links - Light, 1440x1250 viewport

Prototype canvas/Share links page: Previous Build - Light, 1440x1250 viewport

Creation, refresh, and recovery

Prototype canvas/Share links page: Sharing Disabled - Light, 1440x1250 viewport

Prototype canvas/Share links page: Failed - Light, 1440x1250 viewport

Prototype canvas/Share links page: Creating - Light, 1440x1250 viewport

Prototype canvas/Share links page: Created - Light, 1440x1250 viewport

Prototype canvas/Share links page: Expired Link - Light, 1440x1250 viewport

Prototype canvas/Share links page: Created Link Recovery - Light, 1440x1250 viewport

Prototype canvas/Share links page: Refreshing Existing Links - Light, 1440x1250 viewport

Including control settings

Prototype canvas/Share links page: Public Export With Control Settings - Light, 1440x1200 viewport

Prototype canvas/Share links page: Password Required For Existing Link - Light, 1440x1200 viewport

Prototype canvas/Share links page: Control Settings - Light, 1440x1250 viewport

Prototype canvas/Share links page: Control Settings Warning - Light, 1440x1250 viewport

Prototype canvas/Share links page: Control Settings Matching Build - Light, 1440x1250 viewport

Prototype canvas/Share links page: Control Settings Uncommitted Changes - Light, 1440x1250 viewport

Prototype canvas/Share links page: Control Settings Unknown Status - Light, 1440x1250 viewport

Prototype canvas/Share links page: Control Settings Saving - Light, 1440x1250 viewport

Prototype canvas/Share links page: Control Settings Failed - Light, 1440x1250 viewport

Connected Canvas sharing

Prototype canvas/Publication example: Share Management - Light, 1440x1250 viewport

Prototype canvas/Publication example: Narrow Share Management - Light, 1440x1250 viewport with a 384px canvas

arniebradfo and others added 4 commits December 2, 2026 20:28
Use Hub share UUIDs, public addresses and link permissions. Keep the displayed Build pinned and refresh in-progress exports without reporting completion early.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Remove cached and recovery links on a hidden-target read, while keeping mutation failures distinct. Reject delayed pages from the discarded scope.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Clear cached URLs when Hub cannot confirm the target, keep reader addresses unmodified, and compare links by value when an Open and a refresh overlap.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Do not interpret a partial refresh as removing a previously loaded link. Update known statuses as pages arrive and discard unseen links only after a complete refresh.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@arniebradfo
arniebradfo requested review from a team and nshki as code owners December 3, 2026 05:20
Copilot AI adaptive review requested due to automatic review settings December 3, 2026 05:20
@arniebradfo
arniebradfo marked this pull request as draft December 3, 2026 05:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

A later pagination failure discards earlier revocation or URL updates, leaving stale share links available to copy.

1 open issue
1 file not reviewed
  • .github/extensions/replica-prototype/assets/renderer.js: Generated file
What changed in this PR

Aligns Canvas sharing with the Hub API introduced in #485, allowing connected users to manage links pinned to the displayed published Build.

Changes:

  • Adopts UUIDs, Hub-provided URLs, permissions, and revocation responses.
  • Displays export states, refreshes pending links, and clears cached links after access denial.
  • Updates regression coverage, stories, and documentation.
File Description
hub/​test/​canvas/​share-links-client/​index.db.test.ts Tests Build-pinned sharing through Hub.
hub/​docs/​prototype-canvas.md Documents the updated sharing contract.
hub/​client/​hooks/​use-canvas-share-links/​types.ts Reuses Hub contract types.
hub/​client/​hooks/​use-canvas-share-links/​index.ts Updates revocation, polling, and access handling.
hub/​client/​hooks/​use-canvas-share-links/​index.test.tsx Covers polling and recovery behavior.
hub/​client/​hooks/​use-canvas-share-links/​en.ts Adds export-status messages.
hub/​client/​features/​share-link-row/​types.ts Allows unavailable URLs.
hub/​client/​features/​share-link-row/​index.tsx Omits unavailable URL inputs.
hub/​client/​features/​prototype-canvas-share-links/​stories.tsx Adds export-state examples.
hub/​client/​features/​prototype-canvas-share-links/​index.tsx Applies link availability and permissions.
hub/​client/​features/​prototype-canvas-share-links/​index.test.tsx Tests link actions and export settings.
hub/​client/​application/​prototype-canvas/​stories.tsx Updates connected-sharing fixtures.
hub/​client/​application/​prototype-canvas/​stories.test.tsx Updates expected share URLs.
.github/​extensions/​replica-prototype/​start-canvas-server/​index.test.mjs Updates server integration expectations.
.github/​extensions/​replica-prototype/​share-links/​index.test.mjs Covers contract validation and lifecycle behavior.
.github/​extensions/​replica-prototype/​share-links/​index.mts Implements the updated extension contract.
.github/​extensions/​replica-prototype/​share-links/​index.mjs Updates the runtime JavaScript counterpart.

Review effort: Balanced (adaptive)

arniebradfo and others added 4 commits December 3, 2026 09:27
Keep the Hub login changes from #501 and rebuild the renderer from the combined source instead of merging generated JavaScript.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Preserve the published sharing branch while incorporating the exact upstream sources before reviewing the pagination fix.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Apply updates to displayed links as they arrive, without treating a partial refresh as complete. Keep revocation and address removal after a later read fails.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Integrate the live Hub base and rebuild the renderer from the combined sources. Keep the upstream Controls sharing test on the current UUID contract.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
arniebradfo and others added 5 commits December 3, 2026 14:15
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>
Integrate the current Hub base and rebuild the installed sharing transport from the validated combined tree.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Bind reader URLs to the authenticated Hub response, clear stale links, and restart list reads without changing the displayed Build or replaying writes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use the exact validated combined source tree, preserving the merged browser wrapper and regenerating the renderer and sharing transport together.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep the Hub password migration and themed confirmation, collect and submit generated passwords through the shared form, and preserve the reader cutover and Build pin while refreshing policy.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@arniebradfo
arniebradfo marked this pull request as ready for review December 4, 2026 03:14
@arniebradfo
arniebradfo merged commit 12f0203 into build/hub/new Dec 4, 2026
67 checks passed
@arniebradfo
arniebradfo deleted the feat/canvas-connected-sharing-client branch December 4, 2026 03:14
alliscode added a commit that referenced this pull request Dec 4, 2026
Rebuild generated canvas assets after merging #500.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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.

3 participants