Skip to content

feat(hub): sync unpublished preview comments - #37

Open
lukasoppermann wants to merge 5 commits into
mainfrom
lukasoppermann-unpublished-preview-comments
Open

lukasoppermann wants to merge 5 commits into
mainfrom
lukasoppermann-unpublished-preview-comments

Conversation

@lukasoppermann

@lukasoppermann lukasoppermann commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Why

Authors should be able to discuss local previews before publishing them, including previews with uncommitted changes. Requiring an imported Build blocks that feedback, while guessing the next Build number could attach comments to someone else's publication.

What changes

Canvas saves local comments in Hub immediately against a draft revision identified by source content. Draft conversations stay out of published reviews, repository-wide feeds, notifications and learning collection until a successful Build with matching content is imported. Association preserves the conversation and happens once, without predicting a Build number. Existing published conversations retain their normal behavior.

The source snapshot leaves staged files unchanged. Starting selection captures a fresh source revision or exact published Build. Later edits, commits and preview reloads preserve the comment text and its original target. Saving sends the comment to Hub once, then refreshes status and conversations in the background. A refresh failure does not undo a confirmed save. Changes to the Hub connection or Prototype still require a new selection. Draft rows have no fabricated Build links, and the sidebar explains when comments become visible in published reviews.

Deploy Hub with migration 20261020080000_add_draft_review_revisions before updating the plugin and its bundled assets. Local commenting requires a named branch with an initial commit. Git clean filters are unsupported, and changed submodules must be committed or discarded before selection.

Rendered submission remains unverified because Storybook's nested preview stayed blank. Full keyboard and screen-reader checks are also outstanding.

Save unpublished preview feedback as Hub draft revisions and attach it only to a successful Build with matching source content. Preserve published review behavior and reject saves against stale local source.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 1a0f3eb5-727a-4361-b09e-256fd982857d
@lukasoppermann
lukasoppermann requested review from a team and nshki as code owners October 20, 2026 07:50
Copilot AI max review requested due to automatic review settings October 20, 2026 07:50

Copilot AI 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.

🟡 Changes recommended

Unresolved data-preservation and publication/commenting regressions block safe deployment.

7 open issues
What changed in this PR

Adds Hub-backed conversations for unpublished local previews, preserving them until matching source content becomes a successful Build.

Changes:

  • Store draft revisions and associate conversations with verified Builds.
  • Capture local source without changing staged files and reject stale submissions.
  • Update canvas rendering, publication visibility, tests and documentation.
File Description
hub/​test/​models/​draft_review_revision_test.rb Tests revision identity and Build association.
hub/​test/​integration/​canvas_draft_reviews_test.rb Tests draft APIs, access and visibility.
hub/​docs/​review-collaboration.md Describes unpublished conversations.
hub/​docs/​prototype-canvas.md Documents source capture and draft lifecycle.
hub/​db/​schema.rb Records draft storage and constraints.
hub/​db/​migrate/​20261020080000_add_draft_review_revisions.rb Adds revisions and comment references.
hub/​config/​routes.rb Exposes draft preparation.
hub/​app/​models/​review_comment/​thread.rb Excludes draft resolution analytics.
hub/​app/​models/​review_comment.rb Supports draft identity and published scopes.
hub/​app/​models/​repository/​branch_presence.rb Preserves unpublished draft branches.
hub/​app/​models/​prototype.rb Associates draft revisions.
hub/​app/​models/​notification.rb Suppresses unpublished notifications.
hub/​app/​models/​draft_review_revision.rb Prepares revisions and creates comments.
hub/​app/​models/​build/​draft_reviews.rb Verifies source and associates drafts.
hub/​app/​models/​build.rb Queues draft association after success.
hub/​app/​javascript/​utils/​review-thread-matches-filters/​types.ts Allows unpublished Build selection.
hub/​app/​javascript/​utils/​review-thread-matches-filters/​index.ts Handles absent Build numbers.
hub/​app/​javascript/​utils/​review-comment/​schemas.ts Accepts draft comment payloads.
hub/​app/​javascript/​utils/​resolve-prototype-publication/​fixtures.ts Adds revision fixture data.
hub/​app/​javascript/​utils/​prototype-canvas/​types.ts Defines revision status fields.
hub/​app/​javascript/​utils/​prototype-canvas/​en.ts Explains draft publication visibility.
hub/​app/​javascript/​features/​review-comments-sidebar/​index.tsx Avoids missing Build URLs.
hub/​app/​javascript/​features/​review-comment-row/​index.tsx Omits unpublished Build links.
hub/​app/​javascript/​features/​prototype-canvas-hub-panel/​stories.tsx Adds a local-draft example.
hub/​app/​javascript/​features/​prototype-canvas-hub-panel/​index.tsx Loads and submits revision-bound comments.
hub/​app/​javascript/​features/​prototype-canvas-hub-panel/​index.test.tsx Covers unpublished commenting controls.
hub/​app/​controllers/​review_thread_reads_controller.rb Uses scoped comment lookup.
hub/​app/​controllers/​review_comment_resolutions_controller.rb Uses scoped resolution lookup.
hub/​app/​controllers/​review_comment_replies_controller.rb Uses scoped reply lookup.
hub/​app/​controllers/​review_comment_reactions_controller.rb Uses scoped reaction lookup.
hub/​app/​controllers/​concerns/​review_comment_pages.rb Serializes draft identity and nullable links.
hub/​app/​controllers/​concerns/​review_comment_actions.rb Scopes editing and deletion.
hub/​app/​controllers/​concerns/​has_review_comment_context.rb Separates published and draft context.
hub/​app/​controllers/​canvas_api/​review_comments_controller.rb Creates and lists draft comments.
hub/​app/​controllers/​canvas_api/​review_comment_threads_controller.rb Restricts agent retrieval to published threads.
hub/​app/​controllers/​canvas_api/​draft_revisions_controller.rb Validates draft preparation requests.
.github/​extensions/​replica-prototype/​start-canvas-server/​index.test.mjs Covers submission and revision conflicts.
.github/​extensions/​replica-prototype/​start-canvas-server/​index.mjs Prepares and validates local revisions.
.github/​extensions/​replica-prototype/​README.md Documents requirements and deployment order.
.github/​extensions/​replica-prototype/​capture-review-revision/​index.test.mjs Covers source capture and staging preservation.
.github/​extensions/​replica-prototype/​capture-review-revision/​index.mjs Captures source using a temporary index.

Review effort: Max

Comment thread .github/extensions/replica-prototype/start-canvas-server/index.mjs Outdated
Comment thread .github/extensions/replica-prototype/start-canvas-server/index.mjs
Comment thread .github/extensions/replica-prototype/start-canvas-server/index.mjs
Comment thread hub/app/javascript/features/prototype-canvas-hub-panel/index.tsx
Comment thread hub/app/javascript/features/prototype-canvas-hub-panel/index.tsx Outdated
Comment thread hub/app/javascript/features/prototype-canvas-hub-panel/index.tsx
Comment thread hub/db/migrate/20261020080000_add_draft_review_revisions.rb
Reuse draft preparation across status polls, preserve push-first publication for never-pushed drafts, and isolate revision-scoped comment responses without discarding composed text. Show stale-save recovery in the composer and preserve existing review children during SQLite table rebuilds.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 1a0f3eb5-727a-4361-b09e-256fd982857d
Keep the original review target through source edits and preview reloads, then refresh after Hub confirms the save.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 1a0f3eb5-727a-4361-b09e-256fd982857d
Regenerate the canvas renderer from the combined commenting and publishing source.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 1a0f3eb5-727a-4361-b09e-256fd982857d
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 81640dc7-0f59-4d95-9037-01b4eb681d03
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.

2 participants