Repository navigation
feat(hub): sync unpublished preview comments - #37
Open
lukasoppermann wants to merge 5 commits into
Open
lukasoppermann wants to merge 5 commits into
lukasoppermann wants to merge 5 commits into
Conversation
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
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved data-preservation and publication/commenting regressions block safe deployment.
7 open issues
Avoid repeated draft preparation during unchanged status polls · New Allow publishing drafts from never-pushed branches · New Rebuild committed renderer assets for the updated comment protocol · New Match Current Build filtering against the active revision ID · New Prevent stale revision responses from overwriting selected comments · New Show stale revision recovery details in the comment composer · New Preserve SQLite child rows during review comment migration · New
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
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

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_revisionsbefore 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.