Skip to content

fix(content): head the agent card with the result waiting for a decision, and say how many placeholders it leaves - #1517

Merged
gkhngyk merged 12 commits into
ansvisor:mainfrom
cihan-gyk:fix/agent-card-results
Oct 26, 2026
Merged

gkhngyk merged 12 commits into
ansvisor:mainfrom
cihan-gyk:fix/agent-card-results

Conversation

@cihan-gyk

Copy link
Copy Markdown
Collaborator

Summary

Stacked on #1516. The PR's own changes are its last two commits.

In the live editor test (2026-10-25), with Next step on, the agent card headed "Next · Shorten to your Length" over a page rewrite still waiting to be accepted or rejected. The user asked "bu ne agent'ı?" (which agent is this?).

The card heads with what waits for a decision (_agent-card.tsx).

  • While a rewrite or a batch of suggestions waits for a decision, the card heads with it: "Content Agent rewrote the page to its rules" with "6,617 → 5,571 characters · …", or "Content Agent has N suggestions for you". Its own buttons stay (Compare / Reject / Accept, or Review / Reject all / Accept all).
  • Once nothing is left to decide, the card heads with the Next step as before ("Next · {step}", why it's next, its button), with the agent's result as "Last run: …".
  • With fix(content): leave rules held by quoted passages to the person, so the agent and Next step move on #1516, Next step moves on once the agent's work is done or out of its reach. So after Accept all the card shows the next step and why, in one line.

It says how many placeholders the result leaves to fill.

  • For a rewrite: the placeholders it adds (the page's own aren't the run's): "· 2 placeholders to fill".
  • For a batch: the placeholders its changes add.

pagePlaceholders now also reads a list item written without a paragraph, by its own words. That's how an agent's rewrite writes lists. Before, those placeholders weren't counted.

A rewrite's count is read once, not on every key the page takes.

Not changed: a batch's count reads each change's text with the general placeholder pattern, also for a heading. The suggestion doesn't say which block it's in, so a heading's "[2026 Update]" would count as one there.

Related issue

Editor test findings 2026-10-25 (group A, part 2).

Type of change

  • feat — New feature
  • fix — Bug fix
  • chore — Maintenance / dependencies
  • docs — Documentation only
  • refactor — Code change that neither fixes a bug nor adds a feature
  • test — Adding or updating tests

How to test

  1. With Quality on (Next step showing), run Rewrite page. While it waits, the card heads with "Content Agent rewrote the page to its rules", not "Next · …".
  2. Accept or reject it. The card heads with the Next step and why it's next, with the rewrite as its last run.
  3. A rewrite or a batch that adds placeholders says how many are left to fill.

Checklist

  • Branch follows the naming convention (feature/, fix/, chore/, docs/) — see CONTRIBUTING.md
  • Commits follow Conventional Commits
  • yarn lint passes (run from web/): 0 errors; the 6 warnings are in files this PR doesn't touch
  • yarn typecheck passes (run from web/)
  • yarn format:check passes (run from web/)
  • Changes are focused — one concern per PR

Web: yarn test and yarn build. A pre-push review ran; its findings are the last commit. The browser check is in the next batched local test session.

🤖 Generated with Claude Code

cihan-gyk and others added 11 commits October 25, 2026 21:35
…adings' answers and what the last rewrite came to, and offer a Length it can reach

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… for, keep its numbers on the row (00285), and read the floor's sections closer (pre-push review)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…and count the last rewrite only within its Length's band and the same kept text (pre-push review)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…er to rewrite the cited passages too when they hold the Length out of reach

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…e back, release an unused hold, keep a cited-too miss as evidence, and offer it only when cited passages hold the Length (pre-push review)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…he agent and Next step move on, and count open rules as the Rules tab does

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…es read the page, keep the Length's own words, and wait for the passages before dropping skips (pre-push review)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ion, not the next step, and say how many placeholders it leaves to fill

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…aphs, and read a rewrite's once, not on every key (pre-push review)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions github-actions Bot added the needs-migration Adds or edits a migration — apply it to the hosted database label Oct 25, 2026

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

Looks good.

What I checked:

  • Stack. The PR's own change is 7caf2cd and f878ff3, on #1516's head (109d174), with no merge commits. With the stack, it merges cleanly on main. It's web only, so nothing here waits for the API deploy.
  • The heading.
    • stepHead now follows nextShown. No step heads the card while the agent works, while a rewrite is open, or while any suggestion in a batch is open.
    • For a rewrite, the card heads with "Content Agent rewrote the page to its rules", with its characters and its Length line. For a batch, it heads with "Content Agent has N suggestions for you". Each keeps its own buttons, with no step reason or "Last run" under it.
    • Once everything is decided, the step heads the card again, with the run as "Last run". The person's tile follows the same condition.
  • Placeholders in a rewrite.
    • Counted only while the rewrite is open: its placeholders less the page's before it, never below 0.
    • Memoized on the two pages, so typing doesn't read them again.
    • Headings are read with the agent's forms only, as Quality reads them.
  • Placeholders in a batch. Each open change adds its count of new placeholders, never below 0. PLACEHOLDER is global, so match returns every match.
  • pagePlaceholders.
    • A li adds only its own text and inline elements. So the editor's <li><p> is still read once (by its p), nested lists are read once, and a task item's label isn't read.
    • Its only other caller, Quality's count in the editor, gives the same number as before for HTML whose lis hold a p.
  • Tests cover the heading over an open rewrite, the rewrite's and the batch's counts, and nested lists.

@github-actions github-actions Bot removed the needs-migration Adds or edits a migration — apply it to the hosted database label Oct 26, 2026
@gkhngyk
gkhngyk merged commit 043011b into ansvisor:main Oct 26, 2026
4 of 5 checks passed
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