Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

feat(web): add interactive review mode for web diffs#33

Open
ajoslin wants to merge 2 commits intoremorses:mainfrom
ajoslin:feat/web-review-mode
Open

feat(web): add interactive review mode for web diffs#33
ajoslin wants to merge 2 commits intoremorses:mainfrom
ajoslin:feat/web-review-mode

Conversation

@ajoslin
Copy link

@ajoslin ajoslin commented Feb 26, 2026

Summary

  • Add mode=review web runtime for diff pages with GitHub-style line commenting: hover +, inline composer, queue/delete/edit/reply flows, and grouped Submit Review behavior.
  • Add callback posting modes: default structured markdown body (text/markdown) and optional callback_json_template (application/json) with {{text}} validation.
  • Wire review runtime into web capture path and line metadata so comments anchor to actionable code lines, including split modified rows on the added/right side.
  • Keep PR screenshot artifacts in temporary branch folder tmp-pr-screenshots/.

Screenshot Links (branch files)

Light mode

Dark mode

Split modified row behavior

Output Breakdown (summary in PR body)

  • Default callback mode (callback_json_template omitted):
    • Method: POST
    • Content-Type: text/markdown; charset=utf-8
    • Body format:
## Review of <file-or-selected-changes>[(n comments)]

- `<file:line>` <comment text>
- `<file:line>` In reply to <file:line> - <reply text>
  • Template callback mode (callback_json_template provided):
    • Requires {{text}} placeholder in template
    • Method: POST
    • Content-Type: application/json
    • Body is template JSON with {{text}} substituted by the markdown review text

Example template:

{"text":"{{text}}","target":"ext-system","meta":{"kind":"review"}}

Example posted payload:

{
  "text": "## Review of b/README.md\n\n- `b/README.md:6` Template + token test",
  "target": "ext-system",
  "meta": { "kind": "review" }
}
  • Invalid template behavior:
    • If {{text}} is missing or template does not produce a JSON object, review mode is disabled and an error banner is shown.
  • URL parsing behavior:
    • Tokenized callback query params are preserved (for example ?token=...&authToken=...) in both default and template modes.

Verification

  • bun test src/web-utils.test.ts
  • bun run prepublishonly
  • lsp_diagnostics clean for:
    • src/review/web-review-mode.ts
    • src/web-utils.tsx
    • src/ansi-html.ts
    • src/web-utils.test.ts

@remorses
Copy link
Owner

Cool! Can you share a url I can try? You can change the domain in the worker and deploy in your Cloudflare account with wrangler deploy

Implement GitHub-style inline review comments with queued or single-submit callback posting, and include light/dark evidence artifacts documenting screenshot states and callback outputs.
@ajoslin ajoslin force-pushed the feat/web-review-mode branch from b960883 to b4d0462 Compare February 26, 2026 16:55
@ajoslin
Copy link
Author

ajoslin commented Feb 26, 2026

Sure, generating, also cleaned up PR body a bit

@ajoslin
Copy link
Author

ajoslin commented Feb 26, 2026

Then of course we could integrate this into Kimaki for world domination with a POST to local kimaki server on review submit 👌👌

@remorses
Copy link
Owner

remorses commented Feb 26, 2026

I was thinking we could setup a way to read back the comments for the agent. So model can use webfetch with ?commentsonly and get back the comments, with surrounding context.

I am also thinking, what if we make this comments system more general and also add it in traforo tunnel urls?

Similar to Vercel preview comments. So you can add comments to any dev server preview html page url, then the model can fetch those comments and see your instructions close to the element they refer.

For example: imagine working on a Next.js app from the phone on Discord, the agent will show you the kimaki tunnel url to preview the app, you can open it, enable comments and comment "make this button bigger". Then the model can fetch the same url with ?commentsonly and see your instructions and update the right button.

I think I like this more general approach of comments on pages better, the critique case would also become much simpler, and you can comment to a precise keyword instead of a full line. I will work on this this week

@remorses
Copy link
Owner

remorses commented Feb 26, 2026

Here is how it would look like: https://liveblocks.io/examples/overlay-comments/nextjs-comments-overlay?exampleId=z-WQsI1qaxe_5Rk

This would even work for real time collaboration! for example to work on a project with your teams and send messages to the same thread in Discord, comments on the tunnel url

@ajoslin
Copy link
Author

ajoslin commented Feb 26, 2026

hmm cool idea yeah I like it

does that work with dynamic SPAs that change all the time?

@remorses
Copy link
Owner

Nice point. I need to think about it. I need a good way to associate comment to a point in the screen, that is responsive too. Will research what Vercel Preview comments do

@ajoslin
Copy link
Author

ajoslin commented Feb 26, 2026

Nice point. I need to think about it. I need a good way to associate comment to a point in the screen, that is responsive too. Will research what Vercel Preview comments do

hmm i think the right approach is a JS script tag / library that works inside of a dev site instead of trying to put the dev site inside a review app

so i can inject a script in dev, then have the review up on featurebranch.myapp.com?critique_review_id=xyz and it will add all of the shit on top

my main client app for example is very hard to deploy, tons of services etc , getting a vercel style preview url is near impossible

but getting a feature branch (or local tunnel url) link with a review system script embedded inside is possible

great idea really

@ajoslin
Copy link
Author

ajoslin commented Feb 27, 2026

Just copy agentation.dev

@ajoslin
Copy link
Author

ajoslin commented Mar 2, 2026

so can we merge this as-is? i know you have a cool feature planned but this would be huge right now! Would be a super minimal kimaki or opencode addon to get it to feed review comments back in 1 by 1

@remorses
Copy link
Owner

remorses commented Mar 3, 2026

Latest critique has support for agentation to add comments

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