Repository navigation
feat(chat): check the page after each reply and fix what it finds - #1174
Merged
Merged
Conversation
After a reply's edits apply, the editor checks the page for text they made hard to read, surfaces a theme left in the old colors, declarations the page overrides, and selectors that matched nothing. When it finds any, the model makes one more apply_css call within the same reply, which stays one turn for Undo. The check names the cause, not the symptom: how many of a selector's elements are affected, which of the reply's selectors painted the background, and which of its variables set the text color. A fix that makes text hard to read is undone. The eval harness reads when to fix from the tool module, so it runs the loop as the extension does. Co-Authored-By: Claude Opus 5.5 <[email protected]>
- The page check reuses countMatches and the outline's isVisible, splits selector lists with the shared splitter, stops sampling at 3 elements, skips the contrast scan when no edit can change contrast, and works out who painted or colored text only for the problems it reports. - A reply keeps its stop function on itself, a fix that's taken back comes to null instead of a marker, and one function builds the turn for one call or several. - Providers share one call-id rule, and toolResultFor always takes the call it describes. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Bundle sizeNo change to what the popup or content scripts load.
|
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The tool result already names each problem, so the prompt no longer lists them; the three ways to fix one are a list of their own. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…roblem The page check listed at most six examples, so when a variable colored a hundred texts the fix round only saw the few listed and changed the variable on just those. Text one of the reply's variables colors is now one problem with how many texts it covers, and the fix changes the variable where it was set. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The color math gets its own module and tests; unreadable text, clashing surfaces and declarations with no effect each get a file, and the eval harness finds the check as a folder too. Co-Authored-By: Claude Opus 5.5 <[email protected]>
unreadable, clashing and no-effect become unreadable-text, missed-surface and overridden-declaration, in their problem types, files and functions, and each check states its rule and thresholds. The eval summary's columns follow, and still count the earlier names from older checkouts. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
After a reply's edits apply, Chat now checks the page and, when it finds problems, the model gets one more apply_css call to fix them within the same reply. The user still sees one reply, and Undo takes back both calls together.
Review notes: the loop lives in
store/chat.ts; the check inpage-bridge/chat/style-check.ts.Eval (
yarn eval:chat --base v4 --runs 3, Sonnet 5.5 low): checks 81% → 86%, unreadable 0.8 → 0, zero-match 0.6 → 0.1, cost per reply $0.028 → $0.037. The gain is all on themes (Dracula's topic pills and buttons); layout cases are unchanged.Testing: lint, typecheck, Jest, Storybook interaction tests.
🤖 Generated with Claude Code