Repository navigation
Experiment: give a draft's words Send's column under a mouse, with Send in the corner they leave free - #4714
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
# Conflicts: # dist/kernel/kernel.json
# Conflicts: # dist/kernel/kernel.json
# Conflicts: # browser/shadow.css # browser/styles/components/response.css # dist/kernel/kernel.json
In Firefox, when a margin card's reply field grew, by Shift+Enter or a soft wrap, its focus ring lost its top edge for the whole growth tween (about 300 ms); the sides and bottom stayed. While a card moves, box-motion draws the field's ring on the card's surface, which stands behind every part of the card. Two containers between the card face and the field painted paper of their own: the margin thread (`background: var(--paper)`) and its reply row (`background: inherit`). The reply row spans the field's width with 16px of top padding, so its paper covered the ring's 2px band above the field, while the side and bottom bands fell outside it. Both grounds date from #640, when the margin thread wore a focus tint and a pinned reply row had to match it. The card's face has since become the thread's one ground (the thread "fills it with no ground or ring of its own"), and box-motion holds that face transparent over its own paper fill while it moves, so the two backgrounds were redundant paint. The thread now paints `none`, which still overrides the quiet ground the theme gives a thread holding focus, and the reply row paints nothing. At rest the card looks the same: both read transparent over the card's opaque paper, focused or not. In a Firefox recording of three Shift+Enters, frames showing the side ring without the top fell from 27 to 0. box-motion.js now states the rule: the box's face is the only ground between the surface and a ring it draws. The floating panel already keeps it; nothing between its card and its field paints. test_a_margin_reply_shares_its_threads_opaque_surface asserted the thread and reply row were opaque and matched; it becomes test_a_margin_reply_stands_on_its_cards_face, which asserts they paint nothing over the card's opaque face as focus enters and leaves; and test_a_margin_card_is_one_frame_that_rings_for_its_thread checks "no tint" as the thread painting no ground rather than painting paper. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
# Conflicts: # browser/runtime/box-motion.js # dist/kernel/kernel.json
Main's #3897 moved caretAt onto the editor view; the free-corner check now calls view.caretAt as the rest of text-field.js does.
# Conflicts: # browser/shadow.css # browser/styles/theme.css # browser/theme.css # dist/kernel/kernel.json
Under a mouse, once words reach Send's corner, Send now waits unseen in the corner instead of leaving it: pointing at the corner shows it over the words on its opaque hover disc, and Tab shows it on the field's paper with its focus ring, so the action stays reachable by pointer and keyboard while the words keep the whole line. A click in the corner square now sends rather than placing the caret there. Showing it on hovering the whole box was rejected: the pointer rests in the box while typing, so Send would cover the corner's words most of the time. The field now hears its editor take or lose focus through a CodeMirror update listener (`field.focused()`), replacing focusin/focusout listeners on the host that the current-location lint refuses.
Once words reach Send's corner, Send now lets presses through to the words until the pointer has rested on it for 250 ms; only then does it show and take presses. A quick press at the words' end places the caret instead of sending, which the previous commit's show-on-arrival did not. Typing, or a press on the words, puts Send away until the pointer next moves, so a double-click on the last word selects it and Send never appears over a caret just placed. Tab still shows Send.
In the user's Firefox nearly every pointermove is followed, at the same point, by a pointerleave out to the document and a fresh enter (observations.jsonl on this and other pages: 2344 leaves to html for 3805 moves here). The dwell took each leave as the pointer going and cleared its timer, so Send never showed there, though Playwright's Firefox and Chromium showed it. A leave now reads its coordinates like a move: it puts Send away only when the point is off Send. A replay that dispatches a leave after each move fails on the previous commit and passes on this one.
Under a mouse the reply box gives its words the whole line, but a margin card's messages still ended Send's room (`--lf-comment-text-end`) short of the edge, so a message broke a word earlier than the same words in the reply under it (26 words of a test line in the box, 24 in the message). The card's column end is now the text inset under a mouse, where Send takes only a free corner, and the comment box the card grows from takes the free corner too, so the comment box, its card and the card's reply box break every line alike (48/48 and 26/26 words in Firefox). Send's own room is `--lf-comment-send-room`, which still spaces the comment box's empty hint from Other responses and sizes its corner. Send now shows after 150 ms of the pointer resting, not 250, and takes its hover tint as it appears: a browser can leave a still pointer unread as hovering the newly shown Send until it moves, so it showed in two steps, glyph then tint.
# Conflicts: # dist/kernel/kernel.json
When Send shows over the words under a still pointer, the browser can keep reading the pointer as over the words until it moves, so the cursor stayed an I-beam for a moment after the arrow showed. The field under it now takes the pointing hand from the same reveal state that shows Send and its tint.
# Conflicts: # dist/kernel/kernel.json
The corner reading counted every row whose line box touched the square Send stands in. Send is taller than a row, so in a two-row draft the first row, running to the edge, hid Send beside a short last row, and a trailing empty line brought it back (reported on the review page). Only the row across the square's middle, the one Send stands beside, now takes the corner. Over the triage draft Send was out of sight for 9 of 112 keystrokes, down from 52, most of which were this.
# Conflicts: # dist/kernel/kernel.json
Send now shows as soon as the pointer comes to its corner, with its tint and pointing hand, and takes presses only after the pointer has rested there for 150 ms, so a quick press aimed at the words' end still places the caret. Over the words its disc is the box's line tall rather than Send's 28 px face, so it stays clear of the row above (reported on the review page: "it's touching the line above"; "it might be better if it were instant").
The last fix sized Send's disc to a row only while words ran into the corner, so hovering Send beside a second row with the corner free still showed the full 28 px disc over the row above (reported again by the user). Under a mouse, words can stand above Send in every state, so Send is now a line tall (the aim floor at least) and its disc a line tall, whatever the corner holds; the box is as tall as its rows, and Send is centred on the last row (within 0.6 px at one, two and three rows, in the reply box and the comment box). Focus draws the hover disc with its ring inside the edge, where it drew a larger ring round Send's 28 px box that came within 2 px of the row above.
The user asked whether Send's highlight could be square. Under a mouse it is now a square the box's line tall, rounded down to an even number of pixels so the arrow centres in it (20 px in the reply and comment boxes). Focus draws the same square with its ring inside the edge, since a ring outside a square that fills its line reached into the line above. Over the words, Send's box is the field's paper and the letters before it fade into it across an em, where a narrower square left a cut stroke of the covered letter beside it.
# Conflicts: # dist/kernel/kernel.json
# Conflicts: # browser/styles/components/response.css # dist/kernel/kernel.json
…ce on its field Under a mouse the panel's field kept Send's room on every line while the shared corner reading hid Send once the last row reached a 34px square, so Send went away while its room still stood empty. With words, the field now gives that room to them and reads a corner as wide as its Send, which stands as tall as the row it is beside. Send reads its row as the field's 1lh, but the panel and the comment box set their words' face on leaf-text alone, so the panel's disc came out 18px beside 21px rows. Each now sets the face on its field, which the words inherit. Over the words Send's box is the field's paper, --lf-field-ground, which the panel restates as its own surface.
…under a mouse drafts/test_send_corner.py follows the card's reply box in Chromium and Firefox and the panel's field in Chromium: Send hides once the words reach it and they run under its column; on a paused clock a press 1 ms short of the rest reaches the words, and one after it sends. It fails with the rest cut to 0 ms and with the panel keeping its room. The line-break test now also holds a comment's lines from the comment box into the card. The panel row test and the compact comment test asserted the room Send kept on every line, which under a mouse the words now take; the compact test's room for touch already failed on main by 3px since #3824. Under a mouse an empty card reply box is one row tall, its frame included, so the card's reserved reply row drops its extra 2px, which had let the draft jump up 2px at its first wrap.
# Conflicts: # dist/kernel/kernel.json # tests/browser/test_chrome_contracts.py
leaf-agent
previously approved these changes
Oct 30, 2026
The user chose to try it although common practice keeps Send drawn beside or below the words; the header names main's room on every line as the layout to return to.
max-sixty
added a commit
that referenced
this pull request
Oct 30, 2026
… its seat test_the_draft_binding_badge_and_send_press_share_the_row_end has failed since #4714 (3a99348; bisected on main, where it still fails), not since this branch's composer work: it failed the same way on ac685b5. CI ran it on #4738 because this branch edited its file. Under a mouse, #4714's rules give a draft's words Send's column and stand Send in the corner, on the last row, by `.lf-compose-field:has(> .lf-compose-submit)`. That reached the one-line field that adds an option too, outranked its own seat for Add (`--lf-option-add-seat-end`), and dropped Add to the foot of a card's taller row, 16 px below the binding badge it shares a centre line with. A one-line field has no column above Send to give its words, so the corner's rules now apply only where the field holds lines (no `aria-multiline="false"` editor); a one-line field keeps the room and seat its owner gives its action, as every field did before #4714. The selectors keep their specificity, so the panel's and options' own rules still win where they did. test_floating_status_records_feedback_only_when_its_words_show read the panel field's only key badge; the focused field now shows two, so it reads the send key's.
This was referenced Oct 30, 2026
leaf-agent
added a commit
that referenced
this pull request
Oct 30, 2026
The single-space composer test still required a 28px Send disc after #4714 deliberately made its face no taller than the text row under a mouse. Current main reproduces the reported 20px-versus-28px failure. Remove the two fixed-size assertions and correct the probe's description. The test retains its resting and hovered paint checks, clicks the passage composer's Send, and verifies that each of the three composers records exactly one space. No layout or interaction behavior changes. Validation: the reported test fails before this change and passes after it (`uv run pytest tests/browser/drafts/test_composer.py::test_a_single_space_is_message_content_in_every_composer -q -n0`). Ruff lint and formatting checks pass for both edited files. Closes #4754 — automated triage Co-authored-by: leaf-agent <[email protected]>
leaf-agent
added a commit
that referenced
this pull request
Oct 30, 2026
The narrow-field caret check treated a trailing space's DOM Range edge as the painted caret. With `pre-wrap`, that space can hang outside the line while Chromium pulls its native caret back inside. The CI screenshot shows the caret inside the field despite the −2.421875px Range reading. The test now moves left across the trailing space before measuring, checking the caret beside the final ink. It keeps both engines, the narrow allocation, the clipping assertion, and the held final-motion frame from #4442. No runtime geometry changes. The original Chromium case passes immediately before #4714 and fails at that change, which deliberately gives draft words Send's column under a mouse. It also fails on current main with the reported −2.421875px reading. Both Chromium and Firefox cases pass with this correction. This preserves #4714's layout choice rather than reserving extra room to satisfy a Range measurement. Closes #4755 — automated triage Co-authored-by: leaf-agent <[email protected]>
This was referenced Oct 31, 2026
leaf-agent
added a commit
that referenced
this pull request
Oct 31, 2026
The design-comment identity test now moves the pointer into Send's corner and waits for it to arm before making its ordinary click. #4714 deliberately lets draft text use that corner and requires a pointer rest before Send accepts a press; Playwright's click actionability check was waiting for the button to accept pointer events before moving there. The unchanged test reproduced the reported 120-second interception timeout on current main. With this setup correction, the same test passes through sending, revision, and the retained design anchor assertions (8.63 seconds). This preserves #4714's interaction and changes no runtime behavior. Closes #4823 — automated triage --------- Co-authored-by: leaf-agent <[email protected]>
max-sixty
added a commit
that referenced
this pull request
Oct 31, 2026
…4847) Under a mouse, Send hides once the field's last row reaches its corner (#4714). After Backspace joined two lines in the floating panel, Send stayed drawn over the last row's final letters (the user's capture, in Firefox); after a newline split a line off, Send could stay hidden beside a free corner. The field reads whether its words reach the corner when an edit lands and when its box resizes. An edit that changes the line count also resizes the panel's field, and the panel's motion then carries the words from where they were drawn to their new rows with `--lf-field-carry`, a translate that lasts the 300 ms tween (`box-motion.js`, `carryContent`). The reading falls inside that tween, so it measured the words up to a row away from where layout puts them, and nothing read again when the tween ended. `#cornerTaken` in `composing/text-field.js` now moves its square by the field's own carry, so every reading answers for the words at rest, and Send hides or returns at the keystroke. A card's reply grows at its foot, so its words don't travel and it never showed the bug. ### Test `test_send_follows_the_corner_when_an_edit_adds_or_removes_a_line` splits a line off the panel's last row and joins it back, in Firefox and Chromium. Both fail on main, one at the split and one at the join, and pass here. > _This was written by Claude Code on behalf of max-sixty_
max-sixty
added a commit
that referenced
this pull request
Oct 31, 2026
…f our own Markdown handling (#4738) A browser exploration of the composer's live preview (seven agents, about 600 typed attempts, and 1,426 generated drafts compared line by line with the sent message) found the preview drawing many drafts differently from what was sent. Multi-line `>` quotes and ``` fences were the cases that surprised in use. This branch fixes those, makes Shift+Enter read the draft the same way the preview and the message do, and narrows the dialect where CommonMark only surprised. ### What changes for a writer - **Nested quotes, code in a quote, lists in a quote** are drawn as the message nests them. Quotes and list items are now CodeMirror `BlockWrapper` boxes around their lines, as `blockquote` and `li` are in the message, rather than per-line classes that CodeMirror merged into one level. - **An open fence** draws the line being typed inside its code box, so it no longer jumps in on the first key. - **Shift+Enter** continues each quote's `>` and each item's indent from the preview's markdown-it reading, fences included. It leaves a list or quote on the second press on an empty line, outdents an empty nested item to the outer list, and continues task items as `- [ ] `. CodeMirror's own Markdown parser no longer runs in the composer. - **Constructs the preview left as source** are drawn: a `---` rule, entities, a hidden trailing `\`, hidden leading spaces, and task checkboxes. Tabs are 8 wide in both draft and message. Up and Down reach every line, including the short blank lines in a gap of a draft edited in place, and keep their column through code. - **A rule and a code fence take full lines** in the draft, the sent message and page prose, so revealing their source under the caret moves nothing (`browser/AGENTS.md`, "Stability"); before, the composer jumped 20px at a rule and 12px at each fence line. A rule is one line tall with its stroke through the middle, at the same place as before; a code block has a code line above and below its code, which gives every code block 8px more room above its code. The caret-dependent shortening of those lines is deleted. - **Every composer that holds lines shows the new-line key** while focused and empty, for example `Reply ⏎ · New line ⇧⏎`, since Enter keeps sending. In a narrow box the label shortens first; the hint goes only when even a 4em label can't fit. An empty field now keeps its actions' room, so no placeholder runs under the mic or Send. - **Setext headings and indented code blocks are off**, in `markdown.js` and `passages.py`. A `---` under a line is a rule, and leading spaces are text. Neither construct appears in the 2,579 messages and 17 drafts in local saved pages. - **Fixes:** - A bare URL right after a backtick, `~` or a CJK letter no longer crashes the preview for the rest of the draft. - In Firefox, typing over a selection that crosses formatting replaces it. Gecko left the selection in place inside a shadow root. - A `*` bullet no longer has its emphasis placed on it. - Words the parser kept verbatim are placed directly instead of aligned, about 330 → 190 ms per key on a pasted 3,000-line draft. ### Where to look - `browser/runtime/composing/field-editor.js` holds the block boxes in `decorate`, `continueBlocks` for Shift+Enter, the arrow binding for skipped lines, and the exported `DRAWN` set. - `browser/runtime/markdown.js` changes the dialect, adds the verbatim fast path, and starts alignment past container markers. `build/vendor.mjs` records an item's content indent (`meta.indent`) and exports `BlockWrapper`. - `tests/runtime/markdown-preview.test.mjs` is a guard that fails when the renderer enables a rule the preview neither draws nor lists as kept as source (tables, reference definitions). - `browser/styles/components/response.css` keeps #4714's Send-in-the-corner rules to fields that hold lines. They also reached the one-line "Add another option" field and dropped its Add 16px below its key badge, which `test_the_draft_binding_badge_and_send_press_share_the_row_end` has caught on main since #4714. - `browser/styles/floating-panel.css` scopes the panel's separator style to its own `.lf-fp-rule`, so it no longer reaches a rule inside a message. ### Testing Each change was used cold in Chromium and Firefox by an independent reviewer before code review, over seven rounds; every finding is fixed with a test that failed before its fix. `pnpm run test:runtime` passes 703/703, and the focused browser tests in `test_chrome_contracts.py`, `drafts/test_composer.py`, `drafts/test_draft_editing.py` and `test_render_floating_panel.py` pass. The broad suite runs in this PR's checks. ### Known and left open - The quote markers' reveal swaps a mark class, which CodeMirror applies as an unchanged child write. That predates this branch. - Right-to-left text and Tab indenting list items are unchanged. > _This was written by Claude Code on behalf of max-sixty_
This was referenced Nov 1, 2026
leaf-agent
added a commit
that referenced
this pull request
Nov 1, 2026
The dictation journey still required Dictate and Send to have identical top edges. #4714 deliberately made Send shorter under a mouse, centred on the last text row, so that assertion now reports a four-pixel difference despite the intended layout. Remove the obsolete vertical box comparison. The journey retains horizontal placement, empty-to-typed control switching, sending and microphone restoration across the panel, widget and anchored composers. The existing panel row test separately checks glyph alignment before typing and through a wrapped draft. No product rendering changes. Verified the reported journey fails before the change with `assert 4 < 1`; after the change, it and `test_the_row_s_marks_and_presses_share_the_words_line` pass (2 passed). Closes #4928 — automated triage Co-authored-by: leaf-agent <[email protected]>
leaf-agent
added a commit
that referenced
this pull request
Nov 1, 2026
The shadow-seating test still expected desktop drafts and sent messages to reserve Send's full column. #4714 deliberately gave mouse users that column back, while retaining Send's room on touch. The test now expects the desktop thread inset and keeps the touch expectation and all floating-versus-shadow comparisons. On current main, the desktop case reproduced the reported `13px` versus `61px` failure and the touch case passed. Both cases pass with this expectation corrected; product behavior is unchanged. Closes #4930 — automated triage Co-authored-by: leaf-agent <[email protected]>
This was referenced Nov 1, 2026
leaf-agent
added a commit
that referenced
this pull request
Nov 1, 2026
The refused-reply journey now measures the compact Reply field when an empty diff reply has no visible action button, and compares the panel controls' shared aim across refusal instead of requiring Dictate and Send to have identical heights. This preserves the compact reply behavior restored in #4586 and the shorter, centered Send introduced in #4714. No product rendering changes. The panel failure reproduced at the prior PR head: Dictate occupied y=848–880 and Send y=852–876, both centered at 864. The corrected assertion still requires the action's horizontal position and vertical center, and the following passage's edges, to remain fixed. Exact draft restoration, refusal visibility, retry identity and single admitted reply assertions remain intact. Validation: all four `test_refused_reply_retains_its_live_foot` cases pass (outlet, nested-end, margin and panel); Ruff lint, formatting and diff whitespace checks pass. The outlet missing-node crash was reproduced on unchanged main during the original repair. Closes #4945 — automated triage --------- Co-authored-by: leaf-agent <[email protected]>
max-sixty
added a commit
that referenced
this pull request
Nov 23, 2026
…focus on a press inside the panel field's ring (#6800) Two comment boxes draw their focus ring one band inside their edge: the floating panel's field (#5963) and a thread card's reply box (#6773). Things the box holds paint the field's paper to that edge: Send's box once the words run under Send's corner and the pointer rests on it (#4714), and an error about the box. Both are positioned at z-index 1, and a box's outline paints beneath its positioned children, so the ring broke: for Send's height on the panel field's right edge, or around the whole box under an error. Same in Chromium and Firefox, light and dark. Each ring now draws on the box's `::after`, laid over what the box holds, as surfaces.css says a focused box whose band something would cover does. Its place and corners don't change: the other panel and card states' stills differ from main only in antialiasing at the ring's corners. The panel field, holding the caret, runs to the panel's edges, so a 6px band of its slot's padding lies inside the ring but outside the words' box, and a press there took the focus to the panel in both engines. The slot now keeps the words' focus on a press of its own. Where to look: no stills state reached these cases, which is how they shipped. `plan-page-comment-send-shown`, `plan-page-comment-error` and `plan-card-reply-error` now do. The card's `::after` stands at `inset: -1px`, over the field's 1px border, where its outline stood; the thread-panel-overflow branch reworks that box's padding, so whichever lands second rebases. Max reported the broken ring from a Leaf page. Tests: `test_the_field_s_ring_stands_over_what_covers_its_words`, `test_a_card_reply_s_ring_stands_over_an_error_about_it` and `test_a_press_inside_the_field_s_ring_keeps_its_words_focused` each fail on main. > _This was written by Claude Code on behalf of max-sixty_ --------- Co-authored-by: Claude <[email protected]>
max-sixty
added a commit
that referenced
this pull request
Nov 23, 2026
The comment box widens with its first line again, from the least width (320 px) up to the measure (592 px), then wraps; the card Send opens starts at the box's width, so the comment keeps the line breaks it was typed with. #5846 had removed the earlier growth because the card kept the box's width and wrapped every long answer at 320 px; since #5991 a tall answer widens a slim card, which removes that problem. Width comes from CSS intrinsic sizing (`width: max-content` between `min-width` and `max-width`) rather than script. | | main | this branch | | --- | --- | --- | | Typing a one-line comment | <img src="https://gist.githubusercontent.com/max-sixty/edff8c80bd56f00079829fe55a6efb8a/raw/27cf6416e9bf2eaef11be97649212f7155c18d20/typing-before.png" width="400"> | <img src="https://gist.githubusercontent.com/max-sixty/edff8c80bd56f00079829fe55a6efb8a/raw/27cf6416e9bf2eaef11be97649212f7155c18d20/typing-after.png" width="400"> | | The card Send opens | <img src="https://gist.githubusercontent.com/max-sixty/edff8c80bd56f00079829fe55a6efb8a/raw/27cf6416e9bf2eaef11be97649212f7155c18d20/sent-before.png" width="400"> | <img src="https://gist.githubusercontent.com/max-sixty/edff8c80bd56f00079829fe55a6efb8a/raw/27cf6416e9bf2eaef11be97649212f7155c18d20/sent-after.png" width="400"> | What the diff doesn't show: - A change of the box's width alone no longer asks its placement (`box-motion.js`, `changed`): the words widen it inside the room the placement gave it. So the placement reserves that room when it places the box: it stands clear of chrome such as the floating panel across every column the box may widen into (`comment-placement.js`, `overflow`), and the comment box's watch also hears the pane that bounds it. - The box widens only from the edge its placement holds when that is where its words start (`comment-placement.js`, `widens`); elsewhere (left of the text, right of right-to-left text, dragged in a right-to-left page) it takes the measure at once. A draft long enough to scroll also holds the box at the measure, since CodeMirror draws only the lines near what shows. - Cost: a key that widens the box takes 1–2 ms more main-thread time (`leaf-dev bench --input draft`), most of it the text field re-reading which words reach Send's corner; it doesn't grow with the page. Two behaviours were put to the maintainer, who kept both as built: - **Send under a mouse.** The box is exactly as wide as its words, so Send, which stands in the corner the words leave free (#4714), hides while a one-line comment fills the box (above, right); Enter still sends. Keeping Send's room on every line, as under a finger, would end every comment's lines about 30 px earlier. - **A card reopened later.** The card Send opens starts at the box's width (left); reopened later it starts at the least width (right), so reopened cards stay as slim as before. Opening at the first message's width would cost a measurement each time a card opens. | Just after Send | Reopened later | | --- | --- | | <img src="https://gist.githubusercontent.com/max-sixty/edff8c80bd56f00079829fe55a6efb8a/raw/27cf6416e9bf2eaef11be97649212f7155c18d20/reopen-sent.png" width="380"> | <img src="https://gist.githubusercontent.com/max-sixty/edff8c80bd56f00079829fe55a6efb8a/raw/27cf6416e9bf2eaef11be97649212f7155c18d20/reopen-later.png" width="380"> | The maintainer asked for this change and chose both behaviours above; Codex reviewed it three times. New tests cover the widening and Send's line breaks, a key that widens drawing at once, right-to-left pages (by `dir`, by CSS, and dragged), a scrolling draft, a narrowing pane, and clearance from the panel; about 190 focused browser tests, the runtime tests and `pnpm run check` pass. > _This was written by Claude Code on behalf of max-sixty_
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.
Under a mouse, a composer's words now run the whole line, and Send takes the corner they leave free. Before, every line of a draft stopped short of Send's column, about 30 px, so the column above Send stood empty. The user picked this design on the review page, over keeping that room and over a Send that stays hidden until the corner frees.
Under a finger nothing changes: the boxes keep Send's room on every line, as on main.
Experimental. The user chose to try this although it departs from common practice: chat and comment boxes elsewhere keep Send drawn beside or below the words and leave the column above it empty. The header in
response.cssrecords that, and names main's layout, with Send's room kept on every line, as the one to return to.What the user sees
How it works
text-field.jsadds--lf-field-corner. A box that sets it gets:state(corner-taken)whenever the words in view, or the caret, reach that square. Only the row across the square's middle counts.input.jssetsdata-send-pointedon the field as soon as the pointer is inside Send's box, anddata-send-armedonce it has rested there forSEND_DWELL. It reads the pointer's position from both moves and leaves, because Firefox follows nearly every move with apointerleaveat the same point.response.cssholds the shared rules under(hover: hover) and (pointer: fine): the field keeps no room at the end of its lines, and Send is a line tall, centred on the last row, hidden while the corner is taken and not pointed at, and ignoring presses until armed. The panel's sheet is unlayered and outranks those rules, sofloating-panel.cssrestates them for its own field.1lh. So the comment box and the panel now set their words' face on the field rather than onleaf-text, which inherits it; before, the panel's disc came out 18 px beside 21 px rows. Over the words Send's box is painted in--lf-field-ground, which the panel sets to its own surface.--lf-comment-reply-row,chrome.css) drops the extra 2 px it had kept. Without that, the draft jumped up 2 px at its first wrap.Tests
drafts/test_send_corner.py. It covers the card reply in Chromium and Firefox and the panel's field in Chromium, on a paused page clock. In each, Send hides once the words reach it and the words run under its column. A press 1 ms short of the rest reaches the words, and a press after the rest sends. I checked it fails when the rest is cut to 0 ms, and when the panel keeps its room.test_a_reply_written_in_a_card_keeps_its_line_breaks_once_sentnow also checks that a comment keeps its line breaks from the comment box into the card, under a mouse and under a finger.test_the_row_s_marks_and_presses_share_the_words_linetest_a_compact_comment_keeps_no_room_for_send_under_a_mouse, formerly…reserves_only_the_room_send_occupies. It replaces the assertion that fix: align compact comment test with shared Send spacing #4700 aligned on main: under a mouse the words keep no room for Send.test_the_margin_reply_keeps_its_shape_when_the_user_enters_itfails on main as it does here.