Repository navigation
feat(content-editor): show a version 2 brief's plan in the Brief tab and edit its TL;DR, angle, answers and proof (brief rules PR 9) - #1546
Merged
Conversation
…(the TL;DR, the angle, each section's answer, format and facts, the proof to gather against Your input, and folded writing notes) and edit its TL;DR, angle, answers and proof (brief rules PR 9) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…otes in the page while folded, name each Add input by its proof, read the editor's version once, and move the notes' punctuation into en.json (pre-push review) Co-Authored-By: Claude Opus 5.5 <[email protected]>
gkhngyk
approved these changes
Oct 26, 2026
gkhngyk
left a comment
Contributor
There was a problem hiding this comment.
Looks good, with follow-ups.
What I checked:
- How brief text reaches the page.
- Every new field is rendered as React text or an attribute (
title,aria-label). There's nodangerouslySetInnerHTML, no<a>, nohreforsrc. t()andt.rich()take the brief's words as values, which aren't parsed. The<muted>tags come fromen.jsononly.- A fact's source shows its label as text. Its
refisn't rendered anywhere. - A planned link shows its words and its page as text, and its address only as a
title.draftBriefSchemakeeps a link only with an http(s) address, and drops the rest.
- Every new field is rendered as React text or an attribute (
- A brief before version 2.
- Each new row, list and the notes render only when their field is there, so such a brief shows nothing new.
- The H2 line is now a flex row. It looks the same, except that a long heading wraps under itself.
- Edit brief adds nothing to it. With
v2false there's notldr,angle,prooforanswerkey, andversionstays absent. The test pins this.
- Edit brief, version 2.
- The limits are
BRIEF_V2_LIMITS, the onesdraftBriefSchemareads with: TL;DR and angle 500, an answer 600, and at most 6 proofs of 300. - An empty TL;DR, angle or answer saves as
null, whichv2textaccepts. An empty proof is dropped. - Each section keeps its format and facts through
...s, so they move with it, and a removed section takes them along. entities,links,freshness,leftOutandversionare kept through...brief.v2is read once, when Edit opens.- Save goes through
saveDraftBrief, unchanged: it parses withdraftBriefSchema, then checks the 64 KB, and "too long" still shows. - The kind's
Selectgetsitems, and a value that isn't a listed kind is ignored.
- The limits are
- Proof and Your input.
givenis set only once Your input is read. While it loads, fails or is off,givenis null, so there's no mark and no Add input.inputsGivenis Quality's own, and it follows Your input as the person edits it.- A case or a test counts as experience, as
brief.tsand the server's prompt say. - Add input calls the editor's
addInput, as Quality's Add does: it opens the panel and the Brief tab, and scrolls to Your input.
- Accessibility.
- The Writing notes toggle is a button in the
h4, witharia-expanded. Itsaria-controlsnames thedl, which stays in the page withhiddenwhile folded. The chevron isaria-hidden. - Each Add input is named "Add input: ", visible words first.
- In Edit, each kind, proof and Remove control is named by its number, and the TL;DR, the angle and each answer have a label.
- The Writing notes toggle is a button in the
- Strings. Every new string is in
en.json. The formats, fact kinds and proof kinds have a key for each value of the schema's enums, and the schema reads any other value as none. - Tests.
- The view, proof, notes and edit tests fail without the change.
- The two version 1 tests pass either way, as guards should.
- They render the real component. Only the action is mocked; see item 3.
- Merge.
- Before and after the API deploy.
- The API on prod writes no version 2 brief, and the flag is off. So every brief there looks and edits as it does today.
- Nothing a user sees changes at merge, or at the API deploy while the flag is off.
Earlier open items:
- A fact's source ref isn't checked to be http(s) (#1540 item 3).
- Not touched, and still safe: this PR shows only the label and links nothing.
draftBriefSchemachecks link addresses, but reads a fact'srefas plain text.- Keep it open for the first change that opens a fact's source.
- Nothing reads
leftOut,entitiesorlinks(#1543 item 4, #1545).- Partly done: the Brief tab now shows them.
- The writer's
briefTextand the fan-out rules still don't read them.
Follow-ups:
- "In Your input" is read by kind, not by proof (
web/src/app/[locale]/(dashboard)/dashboard/content/editor/[draftId]/_brief-tab.tsx:427,:434-452;web/src/lib/content/draft-inputs.ts:197).- Any table, or any Ansvisor row picked, marks every data proof "In Your input", whatever it holds. "Returns by model" then reads as given and loses its Add input, when it's exactly what's missing.
- With Quality below phase 2, Your input isn't shown. The proof list still says "Add it in Your input" (
web/messages/en.json:4347). - Fix:
- Word the mark by kind: "Your input has data" or "Your input has experience", by
PROOF_INPUT. Keep Add input on the row. - Pass whether Your input is on (
yourInput != null). When it's off, leave "Add it in Your input" out of the info line.
- Word the mark by kind: "Your input has data" or "Your input has experience", by
- Renaming or removing an H2 in Edit brief leaves a planned link pointing at it (
_brief-tab.tsx:621,:703-705).links[].sectionnames an H2 by its text, and...briefkeeps it as it was.- So after a rename, Writing notes say "in 'Old heading'", and the writer, once it reads links, won't find that H2.
- Fix:
- Keep each section's heading as built (
was: s.heading) in the editor's state. - On save, move a link's
sectionto the new heading, or tonullwhen its H2 is gone. - Or have the writer read a section it can't find as anywhere.
- Keep each section's heading as built (
- No test checks that what Save sends passes the schema (
_brief-tab.test.tsx:542,:563).- The mock returns the brief as sent, so a field
draftBriefSchemarefuses would still pass here and fail in the app as "Couldn't save". - Fix:
- In the version 2 edit test, assert
draftBriefSchema.safeParse({ ...saved, origin: 'edit' }).success. - Add a fact whose
refisn't an http(s) address, and assert the tab renders it as text with no link. The first change that links a source then has to check the ref.
- In the version 2 edit test, assert
- The mock returns the brief as sent, so a field
4 of 12 tasks
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.
Summary
Brief rules 2026, PR 9 of 10: the Brief tab shows a version 2 brief's plan, and Edit brief edits it.
main. No migration.CONTENT_BRIEF_RULESon: feat(content): plan each section's answer, format and facts in the brief behind CONTENT_BRIEF_RULES, with the cited pages numbered and the rules in effect (brief rules PR 4) #1540 and feat(content): plan the page in the brief behind CONTENT_BRIEF_RULES: essentials, angle, proof to gather, fan-outs left out and freshness, with Brief › Your input as sources (brief rules PR 5) #1543 (merged) and feat(content): name the brand, its products and competitors as written, and plan links to the pages listed only, in the brief behind CONTENT_BRIEF_RULES (brief rules PR 6) #1545. The fields are the ones feat(content): read and keep the brief's version 2 through Edit brief (brief rules PR 3) #1539'sdraftBriefSchemareads.What the tab shows for a version 2 brief
TL;DR and Angle: rows under Goal and Audience.
Each section:
Proof to gather: the brand's own proof, each with its kind.
inputsGiven).Writing notes, folded until opened (kept in the page while hidden, so the button's
aria-controlsnames it):sca.example/brew), an internal one its path;These are the writer's notes, so they're read-only here.
Edit brief, for a version 2 brief
null.Related issue
Roadmap CE-EVAL-001 / brief rules 2026 (no GitHub issue).
Type of change
feat— New featurefix— Bug fixchore— Maintenance / dependenciesdocs— Documentation onlyrefactor— Code change that neither fixes a bug nor adds a featuretest— Adding or updating testsHow to test
web/src/lib/content/__fixtures__/brief-v2.jsonis one. You can also rebuild with feat(content): plan each section's answer, format and facts in the brief behind CONTENT_BRIEF_RULES, with the cited pages numbered and the rules in effect (brief rules PR 4) #1540, feat(content): plan the page in the brief behind CONTENT_BRIEF_RULES: essentials, angle, proof to gather, fan-outs left out and freshness, with Brief › Your input as sources (brief rules PR 5) #1543 and feat(content): name the brand, its products and competitors as written, and plan links to the pages listed only, in the brief behind CONTENT_BRIEF_RULES (brief rules PR 6) #1545 deployed andCONTENT_BRIEF_RULES=true.I checked this in the browser at 1024 px, light and dark, on a demo draft with a version 2 brief (put back afterwards).
Checklist
feature/,fix/,chore/,docs/) — see CONTRIBUTING.mdyarn lintpasses (run fromweb/)yarn typecheckpasses (run fromweb/)yarn format:checkpasses (run fromweb/)Web checks, run locally after the review fixes:
yarn format: no changes.yarn lint: 0 errors.yarn typecheck: clean.yarn test: 424 files, 4,020 passed.yarn build: OK, with CI's placeholder env.Then I merged today's
main(with #1541's rules in the side panel) with no conflicts, and ran the typecheck and the Brief tab, editor page, rebuild and agent-write tests again: 278 passed.Tests:
Pre-push review
A review agent read the change before the push. It found nothing high and confirmed:
answer: nullandtldr/anglenull are safe fordraftBriefSchema;Fixed from it:
aria-controlspointed at nothing while the notes were folded;en.json;InputsGivenis now exported fromdraft-inputs.ts;🤖 Generated with Claude Code