Repository navigation
Conversation
…in its words Four messages still spelled a key in their words: "Annotations hidden — o shows them", "3 changes since v12 — v shows them", "Edit discarded; g D restores it" and a refused send's "Draft kept — g i resumes writing". Each now offers its step as a press, which the panel field's end says with its key only while that key would make it, and with its word alone to a finger: Show annotations o, Show changes v, Restore edit g D and Resume writing g i. - Errors can carry a press (errors.js, `press`). The panel's field offers it after the error's words, and the Errors list offers it beside Dismiss. A text field's cover draws no press, so the refusal whose words went out of view is about no box. - Each field reading names its own press (field-readings.js, `press`), so the end takes a notice's or an error's press before the page's own, replacing the special case for a notice's press under "moment". - News may offer a press. It passes on the notice's time with its press, since it answers nothing the user did; Max kept since-seen's notice timed over one holding until the next input. While the pointer rests on the panel, a press of news neither arrives nor leaves (notifications.js, `restOnSeat`), as the page's own press already held still there. The press of the user's own gesture still stands until their next input. - `architecture/spelled-keys` (eslint.config.mjs) refuses a string in the runtime or a package that spells a shortcut after a dash or semicolon. Over the 19,891 string literals in browser/ and packages/, the pattern matched exactly these four before the change and none after; `announce` words, which only a screen reader hears, are exempt. - The press type is `Press`, since errors use it too. Behaviour changes: "Annotations hidden" now holds until the user's next input, like every press after the user's own gesture, and offers its press on a touchscreen too. A screen reader hears the notice's words without the key. "Edit discarded" lands the caret in the reply box, where the field shows no shortcuts, as it showed no notice there before. Tests: the refusal tests expect "Draft kept" with Resume writing g i at the field's end and in the Errors list; the since-seen tests expect Show changes v; the annotations test presses Show annotations; a runtime test holds the news press's timing, and field-readings and the lint rule have cases of their own.
# Conflicts: # browser/runtime/field-readings.js
An independent review of the previous commit found the hold it gave news's
press (notifications.js `restOnSeat`) released only when the pointer left
the panel: a parked pointer kept a press of news from showing, or kept an
expired one up, through any number of keys. A second news press arriving
under the pointer was dropped by the requeue. The panel already held its own
press still under a resting pointer (`pagePress`), releasing on input too, so
news's press now goes through that one hold as a press arriving on its own,
and `restOnSeat`, its state and the requeue branch are deleted. News's words
still pass on the notice's time; its press may stay under the pointer until
the next input, as Next On Me already did. An input now repaints the field's
end when what it held has changed, which the latch relied on some other
paint for.
Since a notice's press is no longer the only kind, the field's reading takes
a notice's press only where it answers the user's gesture, so news no longer
displaces an error from the field either.
Every press is now made by `commandPress` (keyboard/control-keys.js), which
gives it the command's shortcut, and a listener hears the press and its
shortcut after a notice's or an error's words ("2 changes since v1. Show
changes, v"). The previous commit had left a screen reader with no route to
Resume writing or Restore edit, whose menu rows hide where keys reach them.
Every notice with a press now announces it, Resolve's Next thread included.
Errors: an error's press shows only while it can act (`stands`), in the
field and the Errors list; the list runs it once the view is put away
(`putAwayThen`); and dismissing an error moves focus to the next row's
Dismiss again, which a second button per row had broken. A refusal whose
words came back partly to a box on screen stands over that box, as before,
and offers Resume writing only when no box shows them.
`architecture/spelled-keys` no longer reports a count or the article after a
dash ("— 3 changes", "— a process exited"); it still matches the four old
strings and nothing in the tree (0 of 19,922 strings). The rule for the
words now has one home, the field-readings header.
Behaviour the tests protect: the since-seen test holds news's press under a
resting pointer until a key (it fails without the input repaint), the live
region assertions now include the press, and the refusal test resumes
writing from the Errors list.
…eld shows A second review of 91fae07 found that a pointer parked on the panel, as after a Cmd-Tab back, kept news's Show changes from ever showing: the panel's hold kept the field's end until the next input, and news offered its press only while its words showed, so a return with no input within the notice's four seconds offered no press at all. That was the third fix to holding news's press under the pointer. The hold exists so a press that changes with the server's reading doesn't swap under the user's aim; a notice's press arrives with words saying why the end changed, and Show changes is easy to take back (browser/AGENTS.md promises only that no hard-to-undo action arrives under a still pointer). So news's press is now the field reading's own, as any notice's is: it shows at once with its words, a resting pointer's included, in a thread and in a stance too, and goes with them. `pageOffer` and `pagePress` are back to main's form, the input repaint the hold relied on is gone, and the page's own press, Open latest and Next On Me, keeps the hold. News still doesn't take the field from an error: the error reading yields only to a notice's press that isn't news. The review also found that a listener heard keys from a second computation: `commandSteps` matched only a row's own id, so Resolve's Next thread, a route of the thread walk, was announced with no key, and it joined key chips, so Restore edit's Shift+d was announced "g D", which screen readers read as "g d". A press now gets its keys from one place, `keysNow` (keyboard/control-keys.js, moved from floating-panel.js), which the field's end and the listener both read: the field spells them as chips, the listener hears them in the spoken form `spokenBinding` gives, and on a touch screen hears none, as main's words left the key out there. `activeCommandLabel` takes the spelling as a parameter. A press no longer carries its command, which nothing read. Behaviour the tests protect: the since-seen test now shows Show changes under a parked pointer with the words and sees it go with them (it asserts the opposite of what the previous test asserted on 91fae07), and a runtime test hears Next thread's `t` and Shift+t spoken as "Shift+t".
A review of 46d4281 found that a listener heard Restore edit with no key. Discarding a changed rewrite leaves the caret in the reply box, where `keysNow` rightly finds no key that acts, and the announcement read that same function. The field's end follows the caret, so it shows a key only while the key acts. An announcement is said once and can't follow the caret, so it now says the command's whole shortcut, as main's "g D restores it" did, spoken "g Shift+d". The same gap reached a refusal raised while the user writes in another box and since-seen news heard with the caret in the field. `commandSteps` answers "what is this command's shortcut" by id, and now resolves routes, so the thread walk's `thread.next` has its `t` for a listener and for the page's controls alike. It takes the spelling as a parameter; `keysNow` builds on it and keeps only what acts from here; and `activeCommandLabel` is back to main's form. browser/AGENTS.md's owners table gains the row for both. The command reference still composes each entry's spoken form from the rows it lists, since it lists every alternative binding of a row rather than answering by id. The rewrite test now hears "Edit discarded. Restore edit, g Shift+d" with the caret in the reply box; with the listener reading `keysNow` it hears "Edit discarded. Restore edit" and fails.
…commandSteps by route id formatGoToAddress spelled a Go-to destination's shortcut for a notice's words; no notice reads it now that a press carries its keys (control-keys.js, commandSteps). A review of b8c1330 found it, and that asking commandSteps for a routed row by the row's own id returns no shortcut, which its docstring now says.
leaf-agent
left a comment
There was a problem hiding this comment.
#6687 is an open alternative to this PR. It converts the same four notices and edits the same files: field-readings.js, floating-panel.js, keyboard/control-keys.js, notifications.js, since-seen.js and the same browser tests. The two can't both land, and they settle the design questions in this PR's "To weigh" differently:
- Errors. Here an error carries a press, so a refused send offers Resume writing
gi. In #6687 an error offers no press, and the error says "Draft kept" alone. - News under a resting pointer. Here news's Show changes shows under a parked pointer and leaves with its words. #6687 holds every press the field's end shows, news's included, while the press can still act (
steady). - Hold until next input. Here a notice that offers a press for the user's own gesture holds until the next input. #6687 makes that hold the caller's choice (
holds), separate frompress.
The increment since my last review is sound. It moves keysNow into control-keys.js, lets commandSteps resolve a route's id, and drops the onUserInput repaint and formatGoToAddress. Nothing in it calls for a change, so the only open question is which PR lands. Under the repository's yolo merge mode an approval here would merge this design before you choose, so I'm leaving that choice to you.
Escape from a changed rewrite leaves the caret in the thread's reply box, where the field says the box's own words and no notice. The Escape that took the caret out counted as the next input, so it ended "Edit discarded" before the field could show it, and Restore edit never showed to anyone who sees the panel. Main's timed words did show there for the rest of their four seconds. A held notice now ends at the user's first input while the panel shows it, in the field or the folded leaf's peek. The panel, which knows what its field says, passes such inputs to notifications.js's `endHeldNotice`. While the caret is in the field, or the field says something else such as selected words or a search, the notice waits. Once the caret leaves, the field shows "Edit discarded · Restore edit g D" until the next input. The rewrite test now sees that line after Escape leaves the box, and nothing about Restore edit while the caret is in it. With every input ending the notice, as before, it fails with "the panel says 'Reply… c', not 'Edit discarded · Restore edit g D'".
While the pointer rests on the panel, the field's end keeps the press it showed past its notice's moment (floating-panel.js, `steady`), meant to last until the pointer leaves or the user's next input. The hold read the input count only when the panel painted, so an input that painted nothing in the panel, such as an arrow key scrolling the page, left it standing: after news passed, the field kept "Away · Show changes v" through ArrowDown until the pointer left. The session working on #6685 found it. Now the user's next input repaints a held field's end. An input on the held press itself is that press being made, which a paint would take from under its click, so it keeps the hold, as it keeps a holding notice (notifications.js, `pressesNotice`, which both now ask). Tests: test_news_s_press_stays_under_a_resting_pointer_until_the_next_input is new and fails without the change; the resting-pointer test now also clicks the held press, which fails without the exemption.
A held notice, such as "Edit discarded" with Restore edit, ended at the user's first input while the panel's field reading said "notice". That reading holds while the field's end shows no press and while a draft covers the words, so the notice could end unseen: - With the caret in a margin card's reply, or a thread's reply in the page, `g` types a letter, so the field said "Edit discarded" without Restore edit. The Escape that left the reply ended the notice, and Restore edit never showed. Before this branch the field said "Edit discarded; g D restores it" for four seconds there. - With the user's draft in the field, the words stood only in the hidden placeholder, and the next input ended the notice. The panel now counts a notice as shown only while the field shows its words, with no draft and the caret elsewhere, and its press where it offers one, which the field's end shows only while a key of the press's would make it. The box's rule for that is exported as `pressSays` (composing/input.js), so the box and the panel read one answer. Folded, the leaf's peek still counts as showing the notice. The rewrite test now runs in a margin card as well as the panel's view: with the caret in the card's reply the field offers no Restore edit, and the Escape that leaves the reply brings "Edit discarded · Restore edit g D". Before this change the card case fails there.
A held notice, such as "Edit discarded" with Restore edit, stood until the user's first input while the panel showed it whole. A review found that this could hold a notice for as long as something hid it, with background news waiting behind it the whole time: - an undo's "Undone: …" under an error, until the error was dismissed; - any held notice under a draft in the field, until the draft was sent or emptied. "Annotations hidden · Show annotations o" then took a new thread's field in place of "Reply… c" after the comment was sent. Now every notice holds its seat for its time, four seconds. A notice of the user's own gesture that offers a press, or one its caller holds, then stays until the user's next input. Inputs within its time leave it standing, so the Escape that takes the caret out of a reply box after a discard, in the panel's thread view or beside a margin card, shows "Edit discarded · Restore edit g D". A notice still hidden when its time is up goes unseen at the next input, as it did before this branch; the live region has said it. A user who stays in the reply box for more than four seconds after a discard therefore no longer sees Restore edit when they leave it. notifications.js owns the notice's whole lifetime again. This removes the panel's `noticeShown`, the exported `endHeldNotice` and `pressSays`. The runtime test now presses Escape within the notice's time and expects the notice to stay; the rule before this branch, which ended it at the first input, fails there. The rewrite test passes in the panel's view and in a margin card.
The user asked for the best of this PR and #6685, which converted the same four notices, and for the rules on how long words stay to be easy to change, since they mean to replace them with a better guess at what the user still needs. So how long a notice stands is one rule in one place (notifications.js, `showNotice`), taken from #6685: every notice stands its four seconds; one answering the user's own gesture with a press, or an undo's, then stays until the user's next input, and an input within its time doesn't end it; news passes with its press. Callers no longer choose: `holds` goes from Next thread and Resume writing, which stay by the rule, and stays only for an undo's notice, which has no press. "Annotations hidden" now stays until the next input after its time, and after a discard, the Escape that leaves the reply box shows Restore edit rather than ending its notice. The field's error yields to a gesture's notice with a press, read from whether the notice is news rather than from `holds`. The pointer hold goes back to the page's own press, Open latest or Next On Me, as on main (floating-panel.js, `pagePress`): a notice's press comes and goes with its words, which say why the field's end changed, and a gesture's stays until the next input anyway. Gone: `steady`, a press's `stands` at the field's end, and the input watch that ended the general hold. Not taken from #6685: an error's press (Resume writing on a refused send, and a press in the Errors list), a mechanism for a rare path whose words Threads' Drafts and `g i` already reach; the `architecture/spelled-keys` lint, which catches one form of a key written into words; and the spoken shortcut, since the live region now hears words alone. Tests: the runtime notice test covers the rule; a browser test sees Show annotations stay through an input within its time and go at the first after; news's press goes with its words under a resting pointer, as #6685's test had it.
|
Superseded by #6687, which takes this PR's rule for how long a notice stays (every notice stands 4 s; one that answers the user's own gesture with a press, or an undo's, then stays until their next input) and its pointer hold (only the page's own press waits for the pointer to leave). #6687 leaves out this PR's spoken shortcut in the live region, the press on touchscreens, the presses on errors and in the Errors list, and the
|
… words The user had said yes, on #6685, to errors that carry a press and to a lint rule against keys spelled in Leaf's words; the previous commit left both out, which reversed that yes. This restores them. An error about no text field may offer the press that recovers from it (errors.js, `press`): a refused send whose words went back to a box out of view offers Resume writing (drafts.js, `keepRefusedWords`). The panel field's end shows it after the error's words with the keys that would make it now, and the Errors list offers it beside Dismiss. A field reading whose words come with a press now names it (field-readings.js, `press`), so the end offers a notice's press and an error's the same way, in place of a branch for notices alone. `architecture/spelled-keys` (eslint.config.mjs) refuses a string that spells a key after a dash or a semicolon and then a verb, the form the four notices used. It reads that form, not every way of writing a key; `announce` calls are exempt. Tests: the refusal tests see Resume writing at the field's end and run it from the Errors list; runtime tests cover what the lint refuses and admits.
The rule let any string inside an announce() call spell a key, since #6685's spoken shortcut did. Nothing on this branch needs that: no announcement takes the dash-or-semicolon form, and the follow-up Max chose reads every announced key from the register (keyboard/scopes.js, saying). Its message now names saying as an announcement's way to say a key.
Four panel notices wrote their keys into their words: "2 changes since v1 — v shows them", "Annotations hidden — o shows them", "Edit discarded; g D restores it" and "Draft kept — g i resumes writing". Nothing checked those keys, so a phone showed `v`, and the discard notice named `g` while the caret sat in the reply box, where `g` types a letter. Now a notice names an action only through `press`, which the panel field's end shows with the keys that would make it now (`keyboard/control-keys.js`, `commandKeysNow`). This PR also takes the best of #6685, which converted the same four notices; Max asked for the merge and for the rules on how long words stay to be easy to change. What a reviewer should weigh: - **How long a notice stands is one rule** (`notifications.js`, `showNotice`), from #6685: every notice stands 4 s; one answering the user's own gesture with a press, or an undo's, then stays until the next input, and inputs within the 4 s don't end it; news passes with its press. Callers no longer pass `holds` for Next thread or Resume writing. So "Annotations hidden" now stays until the next input after its 4 s, and the Escape that leaves the reply box after a discard shows Restore edit. - **A touchscreen is shown no press at the field's end**, reversing #6483's word-alone press for a finger: Max judged a word alone there reads as status, and the panel's menu and lists reach each press's result. - **The live region hears a notice's words alone**, as on main; a screen reader meets the press as a button with its key chip inside. - **The pointer hold is main's**, for the page's own press only. - **An error may carry the press that recovers from it** (`errors.js`, `press`), from #6685: a refused send whose words went out of view offers Resume writing at the field's end and beside Dismiss in the Errors list. A field reading whose words come with a press names it (`field-readings.js`, `press`), so notices and errors share one path to the end. - **`architecture/spelled-keys`** (`eslint.config.mjs`), from #6685, refuses a string that spells a key after a dash or semicolon, the form the four notices used, including in what a screen reader hears from `announce`; #6702 has those announcements read their keys from the register. It reads that form, not every way of writing a key. - Left out from #6685: the spoken shortcut after a notice's words. Max asked for this in a Claude Code session; a separate Claude Code reviewer read the earlier rounds. Tests: `test:runtime`, `check:browser` and the affected browser tests pass; the new retention tests fail with the rule reverted. > _This was written by Claude Code on behalf of max-sixty_
Four messages still spelled a key in their words: "Annotations hidden — o shows them", "3 changes since v12 — v shows them", "Edit discarded; g D restores it" and a refused send's "Draft kept — g i resumes writing". Each now offers its step as a press at the panel field's right end, which shows the key only while it would make the press and shows a finger the word alone: Show annotations
o, Show changesv, Restore editgDand Resume writinggi. A screen reader hears the press and its shortcut after the words, as "2 changes since v1. Show changes, v", with a modifier named ("g Shift+d"), since a reader says a chip's "D" as "d". This finishes what #6679 started for the composer's "Draft kept".How the field's end now picks its press:
errors.js,press), is the field reading's own (field-readings.js). It shows at once and goes with its words (notifications.js): news such as since-seen's Show changes after four seconds; the user's own gesture's after those four seconds too, and then not until the user's next input, so it never leaves from under a hand on its way to the press. Inputs within the four seconds leave it, so the Escape that takes the caret out of a reply box, where the field shows no notice, shows it. The Errors list offers an error's press beside Dismiss. News never takes the field from an error.floating-panel.js,pagePress): while the pointer rests on the panel it changes only at the next input or when the pointer leaves.keyboard/control-keys.js,commandPress), from the page command whose key makes it. The field's end shows the keys that would make it from where the caret is (keysNow). A listener hears the command's whole shortcut wherever the caret is (commandSteps, which now resolves a route such as the thread walk'st), since the words are said once and can't follow the caret.architecture/spelled-keys(eslint.config.mjs) refuses the form the old words took: a key after a dash or semicolon, then a verb. Over the 19,922 stringsbrowser/andpackages/write, it matched these four before and none after. It catches that form, not every way of spelling a key.To weigh: Show changes can now appear under a pointer resting on the panel, since its words arrive with it and say why the end changed; holding it still there kept it from ever showing on a return with the pointer parked. When the words pass, the press it covered, such as Next On Me, comes back under that pointer. "Annotations hidden" now stays its four seconds and then until the next input, like every notice of the user's own action that offers a press. Every such notice now announces its press, Resolve's Next thread included. "Edit discarded" leaves the caret in the reply box, where the field shows no Restore edit, so it shows once the caret leaves within the four seconds, and then until the next input. A held notice still hidden when its four seconds are up, as with the caret kept in that box or a draft in the field, goes unseen at the next input, as the old words did; the live region has said it. Holding it until the panel had shown it kept it, and the news behind it, for as long as a draft or an error hid it. While such a notice stands, news arriving waits behind it until the user's next input, since the field has one seat for both; a screen reader hears the news as it arrives.
#6687 converts the same four notices differently, and only one of the two should land; Max is choosing between them. Max asked for this in a Claude Code session, and six rounds of findings from independent review are fixed in it. Tests:
pnpm run check:browserandpnpm run test:runtimepass.