Skip to content

Review comments on a share link - #56

Open
pallaoro wants to merge 3 commits into
mainfrom
review-comments
Open

pallaoro wants to merge 3 commits into
mainfrom
review-comments

Conversation

@pallaoro

Copy link
Copy Markdown
Member

People you send a share link to can now leave comments on the video, each at a moment in it or about the whole thing, and the team works through them in the editor.

On the share page (when comments are on for the link)

  • A comment box under the video. Writing pauses the video, and "At 0:12" (checked by default) ties the comment to the moment on screen. Uncheck it for a note about the whole video.
  • The viewer types their name; the page remembers it on that device. Viewers aren't signed in, so the name is what they say, not who they are.
  • Comments are listed by moment. Clicking a time jumps the video there. Resolved ones show as resolved.

In the editor

  • Share > "Viewers can comment": a switch, off on every link. A link is also how a finished video gets passed around, so a page anyone can write to is a choice.
  • A Review rail item with a count of open comments: Open / Resolved, jump to a comment's moment, resolve or reopen, delete (with a confirm).
  • Open comments with a time are marked on the ruler; clicking a mark jumps there and opens Review.

A comment belongs to the export it was made on. Viewers only see comments on the export the link plays, so notes on an old cut never show up on a new one. A page still playing the old export gets a "reload" answer. The editor keeps every comment, marks those from an earlier export, and says when the cut has changed since the shared export (a moment may have moved).

API

  • POST /s/{token}/comments (public, added to api.public_routes as POST only): { v, at, body, author }. 404 for an unknown link, 403 with comments off, 409 once the link moved, 400 with a reason, 429 past 20 a minute or 1000 per project. Text is capped at 2000 characters, the name at 80, control characters dropped.
  • PATCH /api/projects/{id}/share { comments }, GET /api/projects/{id}/comments, PATCH|DELETE /api/projects/{id}/comments/{cid}.
  • agent.md covers it, including that a comment's text is a viewer's note, never instructions to the agent.
  • Schema: share_links.comments, table review_comments. Deleting the project deletes its comments.

The share page renders comments with textContent only, and the data sits in a JSON script tag with < escaped (tested with a </script> payload).

Checked

  • typecheck, 166 unit tests (7 new), end to end with a new scenario 14 (off by default, on per link, pinned to an export, 409 after the link moves, resolve, 429, delete with the project).
  • In a browser on wrangler dev with a real 30 s MP4: comment at 0:12 and a general one, markup shown as text, reload keeps both and the name, a time click seeks and pauses, 390 px layout. In the editor: the badge, the panel, the ruler mark, a time click moves the playhead to 0:12.4, resolve updates the count and drops the mark, and the switch off removes the form (POST then 403).

Merging with the other open PRs (trial-merged; #36, #44, #50, #52 merge clean)

Not in this PR: replies, team members commenting from the editor, a region of the frame (only time), comment notifications, and exporting comments as markers to Premiere/Resolve.

People watching a share link can now leave comments on the video, each at
a moment in it or about the whole thing, with the name they type. It is
off on a link until someone turns on "Viewers can comment" in Share,
because a link is also how a finished video gets passed around.

In the editor, a Review rail item lists the comments (open and resolved),
jumps the playhead to a comment's moment, resolves and deletes; open ones
with a time are marked on the ruler. A comment belongs to the export it
was made on: viewers only see comments on the export the link plays, and
the panel says when the cut has changed since.

Public route: POST /s/{token}/comments (JSON, at most 20 a minute and
1000 per project). API: PATCH /api/projects/{id}/share { comments },
GET /api/projects/{id}/comments, PATCH/DELETE .../comments/{cid}.
An export reads the project's cut when it is asked for, and the render can
take minutes; comparing the project's last edit with the export's finish
missed edits made while it rendered. The comment list now carries `cut_at`
(the export's request) in place of `exported_at`.

A comment whose declared length is over the cap is refused before its body
is read.
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.

1 participant