Skip to content

feat(cli): add --anchor-area to pin a comment to an area - #428

Merged
gregberge merged 1 commit into
mainfrom
claude/area-comment-anchor
Nov 19, 2026
Merged

gregberge merged 1 commit into
mainfrom
claude/area-comment-anchor

Conversation

@gregberge

Copy link
Copy Markdown
Member

Description

Adds --anchor-area <x,y,width,height> to argos comment create and argos media comment create, so an agent can pin a comment to a whole region of a screenshot (a component, a section) instead of a single point.

  • API: builds on feat(comments): comment on an area of a screenshot or media argos#2802, which adds the area anchor ({ type: "area", x, y, width, height }, normalized 0-1, x,y = top-left corner) to the REST API and MCP.
  • Client schema: packages/api-client/src/schema.ts is hand-edited to add the area variant, because the live API doesn't serve it yet. The next build-schema-types run will produce the same shape.
  • Validation (lib/anchor.ts): four numbers, each 0-1, width and height above 0, and x + width / y + height at most 1 (1e-9 tolerance, the same as the backend). The three anchor flags can't be combined.
  • Behavior change for existing flags: the shared number parser now rejects an empty value, so --anchor-point 0.5, fails instead of being read as 0.5,0.
  • Where the flag works:
    • comment create: requires --diff, like the other anchors. The "needs a diff" error now names the flag that was used.
    • media comment create: refused with --reply-to, like --anchor-point.
  • Output: areas print as area 0.1,0.2 0.3x0.25, both as Diff: … (area …) and as Pinned: area …. formatAnchor is now an exhaustive switch.
  • Skills:
    • argos-cli: an <anchor> placeholder in the build and media comment commands, plus when to use an area versus a point.
    • argos-pr-review: the "pin the comment" bullet now covers area, point and lines.
    • argos-upload: reading back Pinned: area … and the anchor field.

Type of changes

enhancement

Checklist

  • The commits message follows the Conventional Commits' policy
  • Lint and unit tests pass locally (check-types, lint, check-format, test for @argos-ci/cli and @argos-ci/api-client: 215 and 28 tests; check-types and lint for every package depending on the api-client)
  • I have added tests if needed (anchor.test.ts, format.test.ts)
  • My changes requires a change to the documentation
  • I have updated the documentation accordingly (argos-ci/docs, see below)

Further comments

Release this after argos-ci/argos#2802 is deployed: until then, the API rejects an area anchor. The docs change is in the claude/area-comment-anchor branch of argos-ci/docs.

🤖 Generated with Claude Code

`argos comment create` and `argos media comment create` take
`--anchor-area <x,y,width,height>`: a rectangle in normalized 0-1
coordinates, with x,y at its top-left corner. Comments print an area
anchor as `area 0.1,0.2 0.3x0.25`.

The api-client schema gets the `area` anchor variant by hand, until the
API serving it is deployed and the file can be regenerated. The
argos-cli, argos-pr-review and argos-upload skills say when to mark an
area rather than a point.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@argos-ci
argos-ci Bot temporarily deployed to argos-javascript/preview November 19, 2026 14:27 Inactive
@argos-ci
argos-ci Bot temporarily deployed to argos-javascript/preview November 19, 2026 14:29 Inactive
@argos-ci
argos-ci Bot temporarily deployed to argos-javascript/preview November 19, 2026 14:30 Inactive
@argos-ci
argos-ci Bot temporarily deployed to argos-javascript/preview November 19, 2026 14:32 Inactive
@argos-ci
argos-ci Bot temporarily deployed to argos-javascript/preview November 19, 2026 14:33 Inactive
@argos-ci
argos-ci Bot temporarily deployed to argos-javascript/preview November 19, 2026 14:33 Inactive
@argos-ci
argos-ci Bot temporarily deployed to argos-javascript/preview November 19, 2026 14:33 Inactive
@gregberge
gregberge merged commit 118baa8 into main Nov 19, 2026
72 of 73 checks passed
@gregberge
gregberge deleted the claude/area-comment-anchor branch November 19, 2026 14:54

This branch was successfully deployed

1 active deployment
argos-javascript/preview — 5ed6b3c5 Deployed Nov 19, 2026 by argos-ci[bot]
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