feat(hub): sync unpublished preview comments by lukasoppermann · Pull Request #37 · github/replica · GitHub
Skip to content

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

Merged
lukasoppermann merged 9 commits into
mainfrom
lukasoppermann-unpublished-preview-comments
Oct 21, 2026
Merged

lukasoppermann merged 9 commits into
mainfrom
lukasoppermann-unpublished-preview-comments

Conversation

@lukasoppermann

@lukasoppermann lukasoppermann commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Why

Authors need to comment before publishing, including with uncommitted edits. Keeping that feedback on their device avoids storing unpublished comments in Hub or attaching them to the wrong Build.

What changes

The canvas saves unpublished comments privately on the author's device across restarts. Authors can edit or delete them. Source edits, commits and preview reloads preserve the target captured when selection starts.

While open, the canvas uploads comments only when a newer imported Build matches their saved source. Confirmed uploads remove the local copy; failures retain it and show an error. Uncertain uploads are checked against Hub rather than blindly sent again. Published conversations keep their existing API and access rules, with no Hub draft records or migration.

Local commenting requires a named branch with an initial commit. Source capture preserves staged files; active Git clean filters and changed submodules report an explicit limitation.

Local comments before first publication, shown with Storybook fixture data

End-to-end publication against an authenticated Hub and full keyboard and screen-reader review remain unverified. Complete-suite runs also encountered intermittent canvas publication and checkout UI timeouts.

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 Outdated
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 Outdated
lukasoppermann and others added 7 commits October 20, 2026 10:29
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
Replace Hub-backed drafts with private local persistence and source-matched upload through the published review API.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Retain lifecycle and user-flow integration coverage while removing repeated setup, request bookkeeping and obsolete Hub-draft scenarios.

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

@nshki nshki 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.

Thanks, @lukasoppermann. Greening this for you!

@lukasoppermann
lukasoppermann merged commit 1f75e63 into main Oct 21, 2026
39 checks passed
@lukasoppermann
lukasoppermann deleted the lukasoppermann-unpublished-preview-comments branch October 21, 2026 01:09
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.

4 participants