Skip to content

Commit f3e8cc3

Browse files
authored
Remove persistent suggestion outcome labels (#323)
Suggestion decisions already expose a complete feedback path: busy paint while delivery is unresolved, the content transition when it settles, the shared notice, and Undo. This removes the additional persistent “Accepted” / “Rejected” text from successful settlements so the margin retains only controls the reader can still use. Actionable failures still keep their receipt beside Retry and Cancel. This also records that distinction in the shared UI guidance, updates the suggestion registry and example copy, and removes tests that existed only to preserve settled success receipts. The browser-test cleanup also repairs a `decision` / `ask` variable-name mismatch in an existing ask-arrival geometry assertion. Tests: - `uv run pytest tests` (888 passed) - `uv run pytest tests/test_render_pages.py::test_a_copy_keeps_a_wide_widget_inside_its_standing_reaction_rail` - `uv run pre-commit run --all-files` > _This was written by Codex on behalf of max-sixty_
1 parent 9f1c8cb commit f3e8cc3

16 files changed

Lines changed: 123 additions & 335 deletions

‎examples/corpus.html‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1133,7 +1133,7 @@ <h1>Release notes, drafted</h1>
11331133
Icon color carries positive or negative intent; a small corner mark carries
11341134
interaction state. A selected reaction keeps its square mark even under the
11351135
pointer. One peer stays visible, while … unfolds larger sets. Accept or reject a
1136-
change to try its receipt and Undo, or rewrite a draft and save it. Press
1136+
change, undo that choice, or rewrite a draft and save it. Press
11371137
<kbd>g</kbd> to reveal the contents labels and navigation shortcuts, or use
11381138
<kbd>j</kbd>/<kbd>k</kbd> to scroll down/up a little while reading.
11391139
</p>

‎examples/release-notes.html‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ <h1>Release notes, drafted</h1>
2525
Icon color carries positive or negative intent; a small corner mark carries
2626
interaction state. A selected reaction keeps its square mark even under the
2727
pointer. One peer stays visible, while … unfolds larger sets. Accept or reject a
28-
change to try its receipt and Undo, or rewrite a draft and save it. Press
28+
change, undo that choice, or rewrite a draft and save it. Press
2929
<kbd>g</kbd> to reveal the contents labels and navigation shortcuts, or use
3030
<kbd>j</kbd>/<kbd>k</kbd> to scroll down/up a little while reading.
3131
</p>

‎skills/leaf/assets/CLAUDE.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,11 @@ all enumerable labels in the control's current font and sets a minimum width.
480480
Re-measure after changing type tokens; avoid numeric reservations where the
481481
possible words are available.
482482

483+
Submission feedback uses the shared lifecycle: busy paint while delivery is
484+
unresolved, the resulting content or control state as durable confirmation, and
485+
`notice` for a transient acknowledgment. Persistent status text is for a state the
486+
reader must return to or act on, such as failure.
487+
483488
## Keyboard, focus, and navigation
484489

485490
One register defines every runtime and widget key. A row binds keys, states what

‎skills/leaf/assets/registry.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"lf-suggestion": {
3-
"description": "One proposed change to content the user has already seen, decided in place. lf-old holds the current markup verbatim, lf-new the proposal: both slots replace, lf-new alone inserts, lf-old alone deletes. A widget-state change has no separate patch shape: put the complete old and new widget markup in those slots when one is genuinely needed. Pending, the old reads struck and the new tinted, with accept/reject controls in the page margin; deciding folds the retired half away and reaches the agent as an `accept` or `reject` action whose outcome survives later revisions. Deciding leaves visible Accepted or Rejected receipt text beside an Undo Button while the gesture can still be withdrawn. Undo or `z` takes back that named decision: the log keeps the decision and its withdrawal, and the change comes back pending — the complete state renderer receives its undecided initial value, preserving the widget and its children. `resolves` names the comment whose thread this change answers — accepting resolves that thread too. Suggestions don't nest, and a reply can't carry one (reply markup is frozen in the log, so no version could settle it). Fresh content — a new section, the first version — is written straight instead, and a block the user is to write in their own words is a lf-draft: theirs to rewrite, not the agent's to propose. The user can also just comment on a pending suggestion rather than decide it. An undecided one can also be taken back: a later version drops the wrapper and everything inside lf-new with it, since withdrawing it leaves the page where a reject would (x-withdrawn-as). It can't keep the proposal as settled prose, and it can't drop what lf-old wraps — losing that is the user's own accept to give. An undecided one is a standing decision (see $awaits) — counted in the banner, stepped to by `a`/`A`, and the one kind a single press answers wholesale, which is the banner's Accept all.",
3+
"description": "One proposed change to content the user has already seen, decided in place. lf-old holds the current markup verbatim, lf-new the proposal: both slots replace, lf-new alone inserts, lf-old alone deletes. A widget-state change has no separate patch shape: put the complete old and new widget markup in those slots when one is genuinely needed. Pending, the old reads struck and the new tinted, with accept/reject controls in the page margin; deciding folds the retired half away and reaches the agent as an `accept` or `reject` action whose outcome survives later revisions. Undo remains in the page margin while the gesture can still be withdrawn. Undo or `z` takes back that named decision: the log keeps the decision and its withdrawal, and the change comes back pending — the complete state renderer receives its undecided initial value, preserving the widget and its children. `resolves` names the comment whose thread this change answers — accepting resolves that thread too. Suggestions don't nest, and a reply can't carry one (reply markup is frozen in the log, so no version could settle it). Fresh content — a new section, the first version — is written straight instead, and a block the user is to write in their own words is a lf-draft: theirs to rewrite, not the agent's to propose. The user can also just comment on a pending suggestion rather than decide it. An undecided one can also be taken back: a later version drops the wrapper and everything inside lf-new with it, since withdrawing it leaves the page where a reject would (x-withdrawn-as). It can't keep the proposal as settled prose, and it can't drop what lf-old wraps — losing that is the user's own accept to give. An undecided one is a standing decision (see $awaits) — counted in the banner, stepped to by `a`/`A`, and the one kind a single press answers wholesale, which is the banner's Accept all.",
44
"type": "object",
55
"properties": {
66
"id": {"type": "string", "pattern": "^[a-z0-9][a-z0-9-]*$"},

‎skills/leaf/assets/runtime/chrome.css‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ body { position: static; box-sizing: border-box; }
356356
/* Pointer and hover feedback belong to interactive offers. BAKE removes the role
357357
and tab stop from standing reaction marks, which retain their shape without
358358
promising a press. A status keeps its ghost ring in the page-map walk, while its
359-
hand and hover response go. Decided suggestions export sibling text receipts. */
359+
hand and hover response go. */
360360
.lf-margin-button:is(button, [role="button"]):not([data-lf-behavior="status"]) {
361361
cursor: pointer;
362362
}

‎skills/leaf/assets/runtime/living-margin.js‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,9 @@
133133
state has a separate small corner mark: a dot for engaged, an open moving ring for busy
134134
(static under reduced motion), a diamond for failed, and a square for settled. The mark
135135
is enough to state that a Button is busy, so the Button itself stays at full opacity
136-
and keeps its pointer. Busy also sets `aria-busy="true"`; failed and settled actions
137-
need visible words, not color or shape alone. A status's phase is its transient hover
138-
or focus label instead of a corner mark. Standing reactions reuse the settled square in
136+
and keeps its pointer. Busy also sets `aria-busy="true"`; a failure keeps visible words
137+
beside the controls that can repair it. A status's phase is its transient hover or focus
138+
label instead of a corner mark. Standing reactions reuse the settled square in
139139
their margin palette and seated marks, so they remain distinct from hover without
140140
changing the shared ring or fill. Reaction toggles retain their vocabulary labels and
141141
`aria-pressed`; withdrawing a token returns its palette Button to idle.
@@ -159,8 +159,9 @@
159159
engaged. Reversible actions normally act immediately and offer Undo, which withdraws
160160
the named logged gesture under the same authored-version, replayability, and
161161
pending-delivery guards as keyboard Undo. Confirmation is for a genuinely irreversible
162-
effect, not routine Save or Accept. Settled outcomes are visible receipt text beside an
163-
active Undo or context disclosure: never leave an inert Button-shaped status.
162+
effect, not routine Save or Accept. The layer-wide submission lifecycle in CLAUDE.md
163+
governs feedback; a settled cluster keeps only the actions still available there, such
164+
as Undo, and never leaves an inert Button-shaped status.
164165
165166
The Page-map keyboard scope owns the cluster's way back out. When a thread card stands
166167
over an unfolded `…` group, Escape closes the card first and folds the secondary

‎skills/leaf/assets/runtime/presentation.js‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -517,11 +517,11 @@ export function renderSaid(root) {
517517
//
518518
// Its two neighbours in that vocabulary stay silent, and the line between them is what
519519
// the paint is the only copy of. A retraction is one: nothing else on the page says the
520-
// decision was undone. data-lf-reader-override and data-lf-reported are not — each marks a state
521-
// whose substance is already in the control and receipt's visual and semantic state (a
522-
// check, tint, and visible "Accepted") or the status this pass speaks. The outline
523-
// identifies the state as a reader override or provisional report; work receipts
524-
// separately state whether the agent has processed it.
520+
// decision was undone. data-lf-reader-override and data-lf-reported are not — each marks a
521+
// state whose substance is already in the widget's visible and semantic state (for
522+
// example, a selected option's check and tint) or the status this pass speaks. The
523+
// outline identifies the state as a reader override or provisional report; work
524+
// receipts separately state whether the agent has processed it.
525525
function quietFacts(el) {
526526
const words = el.hasAttribute(PAGE_PAINT_ATTRIBUTE.restated)
527527
? ["rewritten since your decision"]

‎skills/leaf/assets/runtime/widget-elements.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ export function relabel(node, label, { says } = {}) {
463463
}
464464

465465
// Room for a word not yet said, taken from the words themselves. A control that will
466-
// rewrite its own label ("✓ Accept" to "✓ Accepted", a count gaining a digit) must
466+
// rewrite its own label ("Approve version" to "✓ Version approved", a count gaining a digit) must
467467
// hold the widest word's room from the start, or the press rewrites the one line a
468468
// press may not move. Stating that room as a number is a measurement that stops
469469
// being true silently when the words or the font change, so the control measures the

‎skills/leaf/assets/theme.css‎

Lines changed: 9 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1499,27 +1499,16 @@ lf-suggestion[data-lf-state] > :is(lf-old, lf-new) {
14991499
[data-lf-retired] { display: none; }
15001500
lf-suggestion[data-lf-state="accept"]:not(:has(lf-new)),
15011501
lf-suggestion[data-lf-state="reject"]:not(:has(lf-old)) { display: none; }
1502-
/* Whose job it is to say the change is only proposed, in each medium. On screen the
1503-
* ✓/✗ row hanging on the change's own line says it, and this word stays clipped for
1504-
* whoever is listening. A copy has no row — export strips a control the page doesn't
1505-
* speak through, and a pending one says nothing yet, so it goes whole — which left the
1506-
* two states saying opposite amounts there: a decided change keeps its "Accepted", a
1507-
* pending one kept nothing, and a struck red paragraph with an empty margin beside it
1508-
* is exactly what a deletion looks like once it has happened. The word #voice already
1509-
* writes is what the copy shows instead, so nothing new is drawn and both readings of
1510-
* the page keep the same text in the same place.
1502+
/* A pending suggestion still has to say it is proposed when generated controls are
1503+
* absent. On screen the ✓/✗ row carries that fact and this word stays clipped for
1504+
* whoever is listening. A static copy and paper expose the word #voice already writes
1505+
* in each slot, so the proposal remains distinguishable from settled content without
1506+
* adding another label or moving it elsewhere.
15111507
*
1512-
* Paper is in the base too, and it is the medium this note used to overstate: print
1513-
* drops every offer, `[data-lf-said]` included, so a decided change says nothing there
1514-
* either and the asymmetry the paragraph above describes is the copy's alone. What the
1515-
* word buys on paper is the pending state stating itself at all.
1516-
*
1517-
* Stated the way the copy states every affordance (see the widget-chrome norm): the
1518-
* page the markup describes is the base, and the live page's version of it goes inside
1519-
* the screen guard — so the clip is what is granted, rather than the word being drawn
1520-
* and then taken back. `user-select` is not touched either way: this is the runtime's
1521-
* reading of the paint rather than the page's own words, so a paragraph copied out of
1522-
* a published page must not come away carrying it.
1508+
* The page the markup describes is the base, and the live page's clipped version goes
1509+
* inside the screen guard. `user-select` is not touched: this is the runtime's reading
1510+
* of the paint rather than authored prose, so copying a published paragraph must not
1511+
* carry the word with it.
15231512
*
15241513
* inline-block, because lf-old is struck and CSS runs a decoration through every
15251514
* in-flow inline descendant — a descendant cannot cancel it, and `text-decoration:
@@ -1539,15 +1528,6 @@ lf-suggestion:not([data-lf-state]) > :is(lf-old, lf-new) > .lf-quiet {
15391528
* packing, and the focus-ring allowance belong to .lf-margin-item below. */
15401529
.lf-sug-actions { display: inline-flex; align-items: center; gap: 4px;
15411530
white-space: nowrap; }
1542-
/* A settled suggestion keeps state as visible, selectable receipt text. Its circle is
1543-
* Undo, so it remains a genuine action; failure uses the same receipt anatomy beside
1544-
* Retry and Cancel. Generated controls disappear from static export while the receipt
1545-
* remains ordinary document text. */
1546-
.lf-sug-receipt { color: var(--ink-2); font-weight: 600; }
1547-
.lf-sug-actions[data-lf-outcome="accept"] .lf-sug-receipt { color: var(--ok-ink); }
1548-
.lf-sug-actions[data-lf-outcome="reject"] .lf-sug-receipt { color: var(--danger-ink); }
1549-
.lf-sug-actions[data-lf-margin-receipt="failed"] .lf-sug-receipt { color: var(--danger-ink); }
1550-
15511531
/* The living margin is a retained projection with one cluster per page target. Its
15521532
* primary Button, optional `…`, and the secondary Buttons that ellipsis unfolds share
15531533
* one host. One packing pass keeps the clusters clear, docks each whole unit when the

‎skills/leaf/assets/widgets/lf-suggestion.js‎

Lines changed: 17 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
*
55
* The log owns the absolute outcome, so reloads and tabs converge. Once that outcome
66
* stands, the surviving slot remains and the retired slot folds away as trackable
7-
* motion. The durable outcome is visible, selectable receipt text; its circle is Undo,
8-
* so a Button-shaped thing always still performs or reveals something.
7+
* motion. Undo remains while that decision can still be withdrawn. The shared busy
8+
* state and notice carry delivery feedback without restating the settled content.
99
*
1010
* The suggestion owns only those controls and their semantics. It contributes the row
1111
* through `registerMarginItem`; the living margin joins it to comment threads,
@@ -123,7 +123,7 @@ customElements.define(
123123
"lf-suggestion",
124124
class extends HTMLElement {
125125
#row = null;
126-
#receipt = null;
126+
#failureReceipt = null;
127127
#deciding = null; // the decision in flight, so a second press joins it
128128
#failed = null;
129129
#accept = null;
@@ -193,9 +193,8 @@ customElements.define(
193193
this.#margin = registerMarginItem({
194194
key: `suggestion:${this.id}`,
195195
// An accepted deletion (or rejected insertion) has no surviving slot and the
196-
// suggestion itself leaves layout. Its receipt still describes the containing
197-
// passage, so that passage becomes the durable perch instead of making a word
198-
// marked data-lf-said disappear with a target that now paints no box.
196+
// suggestion itself leaves layout. Undo still belongs to the containing passage,
197+
// so that passage becomes its perch while the gesture can be withdrawn.
199198
target: () =>
200199
!this.dataset.lfState ||
201200
shownParts(this).some((part) => part.checkVisibility())
@@ -222,8 +221,8 @@ customElements.define(
222221
{
223222
id: `suggestion:${this.id}`,
224223
// Before settlement this contribution is the Ask, so suppress the shared
225-
// Ask at the same target. Afterwards the item keeps the receipt and Undo
226-
// controls in this cluster without inventing another page-map reading.
224+
// Ask at the same target. Afterwards Undo remains in this cluster without
225+
// inventing another page-map reading.
227226
kind: this.dataset.lfState ? "action" : "ask",
228227
...(this.dataset.lfState ? {} : { represents: true }),
229228
text: this.dataset.lfState
@@ -258,8 +257,7 @@ customElements.define(
258257
// WORDS), and the name that has to carry the change as well. The
259258
// change's own words come in rather than being read here, because settling
260259
// retires the slot they live in and a name asked for afterwards would answer the
261-
// id. Both controls restate together. The persistent outcome belongs to #receipt,
262-
// outside the tooltip whose visibility depends on a hover or focus.
260+
// id. Both controls restate together.
263261
#name(btn, state, change) {
264262
const kind = verb(btn);
265263
btn.removeAttribute("data-lf-said");
@@ -303,11 +301,6 @@ customElements.define(
303301
if (!this.#row) return;
304302
const outcome = this.dataset.lfState;
305303
if (outcome && !this.#failed) {
306-
this.#receipt ??= document.createElement("span");
307-
this.#receipt.className = "lf-sug-receipt";
308-
relabel(this.#receipt, outcome === "accept" ? "Accepted" : "Rejected", {
309-
says: true,
310-
});
311304
this.#undo ??= this.#utilityButton({
312305
key: "undo",
313306
icon: "undo",
@@ -321,21 +314,16 @@ customElements.define(
321314
"aria-label",
322315
`Undo ${outcome === "accept" ? "accepting" : "rejecting"} the suggested change: ${change}`,
323316
);
324-
this.#row.dataset.lfOutcome = outcome;
325-
this.#row.dataset.lfMarginReceipt = "settled";
326-
this.#replaceControls(
327-
...(undoableAction(this, outcome) ? [this.#undo] : []),
328-
this.#receipt,
329-
);
317+
delete this.#row.dataset.lfMarginReceipt;
318+
this.#replaceControls(...(undoableAction(this, outcome) ? [this.#undo] : []));
330319
return;
331320
}
332321

333-
delete this.#row.dataset.lfOutcome;
334322
if (this.#failed) {
335-
this.#receipt ??= document.createElement("span");
336-
this.#receipt.className = "lf-sug-receipt";
323+
this.#failureReceipt ??= document.createElement("span");
324+
this.#failureReceipt.className = "lf-margin-receipt";
337325
relabel(
338-
this.#receipt,
326+
this.#failureReceipt,
339327
this.#failed.undo
340328
? `Undo failed · ${outcome === "accept" ? "Accepted" : "Rejected"}`
341329
: "Failed",
@@ -358,7 +346,7 @@ customElements.define(
358346
for (const control of [this.#retry, this.#cancelFailure])
359347
marginButtonState(control, "failed");
360348
this.#row.dataset.lfMarginReceipt = "failed";
361-
this.#replaceControls(this.#retry, this.#cancelFailure, this.#receipt);
349+
this.#replaceControls(this.#retry, this.#cancelFailure, this.#failureReceipt);
362350
return;
363351
}
364352

@@ -444,7 +432,7 @@ customElements.define(
444432
// it — so nothing is owed the reader during the round trip, and the round trip
445433
// is local. What waiting buys is the absence of the other half: a settled
446434
// suggestion the server never took had to be un-settled in front of the reader,
447-
// a frame of "✓ Accepted" over a fold that started and stopped. The rule that
435+
// a frame of settled content and Undo over a fold that started and stopped. The rule that
448436
// decides which gestures wait, and what waiting costs, are in CLAUDE.md.
449437
#decide(outcome) {
450438
if (this.dataset.lfState) return Promise.resolve(true);
@@ -566,8 +554,8 @@ customElements.define(
566554
// decision lands; the layer then writes the same mark unconditionally.
567555
renderRetired(this);
568556
if (this.#row) {
569-
// The durable outcome is ordinary receipt text. The only remaining circle is
570-
// Undo, which still acts; no disabled Button-shaped status survives settlement.
557+
// The only remaining circle is Undo, which still acts; the fold and surviving
558+
// content carry the outcome without leaving another status beside them.
571559
this.#renderControls(change);
572560
}
573561
this.#margin?.update();

0 commit comments

Comments
 (0)