Repository navigation
#580 (part 3): the signature bar is the composer's Basic Text group - #860
Draft
ragelfundionctrumnar wants to merge 3 commits into
Draft
ragelfundionctrumnar wants to merge 3 commits into
ragelfundionctrumnar wants to merge 3 commits into
Conversation
3 tasks done
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
ragelfundionctrumnar
force-pushed
the
fix-580-part-3
branch
2 times, most recently
from
November 8, 2026 16:37
f1eb69a to
49138f7
Compare
|
ragelfundionctrumnar
force-pushed
the
fix-580-part-3
branch
5 times, most recently
from
November 14, 2026 18:10
348e01a to
a0c8125
Compare
…format.align
A paragraph of a message or a signature can be aligned left, centred or
right. For now that is the command format.align {"value": "left" |
"center" | "right", from?, to?}, for scripts, the command line and
agents; the ribbon's buttons and the keys come in part 2. It goes out as
text-align on the paragraph's <div>, inline, as Outlook writes it, and
comes back on a paste and when a draft reopens. A picture is aligned
with its line, the one above a signature's text included. A list item
is always left, so a nested list never inherits a centring and every
mail program shows the same thing; a blank line's alignment is not kept
by HTML. Clear All Formatting puts a paragraph back to left.
Also done on the way:
- Alignment is stored only when it isn't left, and read leniently: a
mailbox written before reads and writes as it did, and a value a later
version writes reads as left instead of costing a signature its text
and its pictures.
- The details hash takes alignment in only when it isn't left, so a
signature made from its details by 0.8.2 still reads as made from
them (pinned with hashes taken on main).
- Paragraph::with_runs takes the place of the three rebuilds that kept a
paragraph's kind and level and would have dropped its alignment:
removing a signature's picture, tidying a signature, and the text
beside a signature's lead picture. That last one now takes out only
the lead picture's first place, so a logo standing twice is sent twice.
- The HTML reader keeps a block's alignment (text-align, align=,
<center>; justify and start read as left, end as right), and marks
every block inside a list item as part of it (Block::in_item): a
paste reads a further paragraph, a heading, preformatted text and a
table's cells inside an item as left, like the item.
- Bullets, Numbering, Increase and Decrease Indent and Clear All
Formatting take the paragraphs a selection takes as alignment does: a
line selected with its break no longer makes the line after it a list
item, which would have cost it its alignment, nor moves it a level or
out of its list. Whether a selection is all centred (or left, or
right) passes its list items by, as aligning it does.
- format.align stays out of the Commands list, which runs a command
with no params.
- Parity checklist (246 of 330), ui-parity, gaps, docs/log.d rows, release notes
(the feature, and the fix to Bullets, Numbering and Clear All Formatting);
"Align Text" in the catalogues.
Human-reviewed, AI-assisted, nobody's mailbox harmed.
Align Left, Center and Align Right are in the Message tab's Basic Text group, in a column of their own after Bullets and Numbering (in the classic ribbon too, whose columns of three it leaves as they were). Each shows whether the selection goes its way, and one that is on puts the paragraph back to left, as Outlook's do; each tooltip says its own key, but in the browser, where the keys stay the browser's, the three name none. While the body of a message or File › Signatures' editor has the keyboard, Ctrl+L, Ctrl+E and Ctrl+R align the paragraph left, centred or right: there Ctrl+R no longer replies and Ctrl+E no longer goes to the search, and everywhere else they do as before. The editor draws a centred or right line where it will be sent, each wrapped row on its own and a picture alone on its line included, and the caret, a click, the selection and a picture's frame follow it. A plain-text message is drawn left, as it goes, and the buttons show no alignment there. In the browser the three keys stay the browser's; the buttons are the way. Also done on the way: - A paragraph is laid out left and each row moved after, to the pixel, rather than laid out with epaint's own alignment, which lines a row up by its first glyph that isn't a space and would have put a picture alone on a centred line its own width left of the middle. One function, with what it counts on in epaint 0.37.0 said beside it. - A wrapped row is centred without the space it was broken at, and the spaces it wraps after stand at the body's edge, where the caret goes through them, as in a word processor, their underline ends and a selection of them shows as a sliver; no row is moved past the edge to round it to a pixel. - A picture made as wide as the body leaves room for the character it stands as in the text: in a font that draws that character, epaint put the picture's room on an empty row and the picture left of the body, whichever way its line went. - A signature's picture being resized grows from its middle on a centred line and from its right on a right one; the sliver that shows a selected line break stays inside the body on a right line. - The ribbon's tooltips and the simplified row's menu look a key up by the control's name before its command's, so three buttons on one command say three keys. - Three icons drawn in code: lines of text, long and short by turns, standing at the left, the middle or the right. - ui-parity, gaps, roadmap, README, release note; "Align Left", "Center" and "Align Right" in the catalogues. Human-reviewed, AI-assisted, nobody's mailbox harmed.
…group File › Signatures formats a signature with the Message tab's Basic Text buttons. Under Font, Size, Colour, Highlight, Link and the picture controls, a row of Bold, Italic, Underline, Bullets, Numbering, Align Left, Center, Align Right, Decrease and Increase Indent and Clear All Formatting, drawn as the ribbon draws them, from the one list the ribbon's group is made from, so the two can't drift apart. Each shows what the signature's selection is, its tooltip names it with its own key where it has one, and after a click the keyboard is back in the signature, so typing goes on there. No command changed: the editing commands already act on the open signature. Also done on the way: - ribbon::basic_text(look) is the group's list; the Message tab builds its group from it, unchanged. - The bar's own B, I and U buttons give way to the group's, and the three tooltips they had with them. - Highlight joins Font, Size and Colour in the bar's first row, as the Message tab's Text Highlight Color, so every control of the group is on the bar; a highlight in a signature is saved and sent like one in a message. - After an editing command the keyboard goes back to the text it acted on: the open signature's while there is one (the bar's B, I and U used to leave it nowhere), asked for apart from a message's, which is asked for by its id (UCSLabs#286); HTML and Plain Text, which change the message alone, give it back to the message. A request waits for an editor that can take it, and a signature closed, or opened again, takes its request with it. - The control protocol lists File › Signatures' kinds: signature, signatureBody (there since signatures were edited in the composer's editor) and signatureBar. - ui-parity (the bar, and that its buttons have no name for a screen reader, as the ribbon's small ones), gaps, roadmap, README, release note, docs/log.d rows. Human-reviewed, AI-assisted, nobody's mailbox harmed.
ragelfundionctrumnar
force-pushed
the
fix-580-part-3
branch
from
November 15, 2026 03:55
a0c8125 to
7c266cd
Compare
|
This branch has not been deployed
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.



Builds on #859
Part 3 of 4 for #580. UI only: no model or command changes, because the editing commands already act on the open signature. Kept as a draft until part 2 is merged.
What changes for the person using MailCraft
What it deliberately leaves out: a name for a screen reader on the new buttons. The ribbon's small buttons have none on purpose (tests that find menu items by name count on it), so these are the same;
ui-parity.mdsays so.Reading order
crates/ui-egui/src/ribbon.rs:pub(crate) fn basic_text(look: &Look) -> Vec<Item>, the Message tab's whole Basic Text group (15 items), moved out ofmessage(), which now builds its group from it unchanged (after the Clipboard group's Format Painter, as before).Item::tip_textispub(crate).crates/ui-egui/src/signatures.rs:basic_text(app, ui, look)draws a second row from that list, every item that runs a command, each withwidgets::small_frame(its checked state from the look), its tooltip throughcommand_tooltipwith the item's key, and its rect asapp.hit.add("signatureBar", hit_id(item.key), rect). The old B/I/U loop andcommand_labelare gone. The first row gains a Highlight menu (ribbon::highlight_menu). The layout combo and the picture row are as they were.crates/ui-egui/src/lib.rsandcompose/editor.rs: after an editing command the keyboard goes back to the text it acted on.want_body_focusasks for the open signature while there is one (signature_focus_wanted, apart from a message'sbody_focus_wanted, which names its compose id since A new mail and a contact open in a window of their own #286), else for the message; HTML and Plain Text, which change the message alone, always ask for the message. Each editor takes only its own, and only when it can take the keyboard; a signature closed or opened again takes its request with it.crates/ui-egui/src/signatures_tests.rs(new, registered inlib.rs), with its ownsignature_pagein a window tall enough for the preview to be drawn; one incrates/engine/src/cmd/signature_tests.rs.control-protocol.md(a "File › Signatures" row with the hit kindssignature,signatureBody, which was already there and undocumented, andsignatureBar),ui-parity.md(the Backstage row and the screen-reader bullet),gaps.md,README.md,ROADMAP.md(rows asdocs/log.d/*/580-3.md), the third line ofpackaging/release-notes.d/new/580.md, and "Highlight" in the six catalogue files.How it was checked
New tests in
signatures_tests.rs, each seen failing first:the_signature_bar_offers_every_basic_text_control_of_the_message_tab: every button of the ribbon's group that runs a command is on the bar.bullets_from_the_signature_bar_make_the_open_signature_a_list_itemthe_signature_bar_shows_what_the_selection_isclear_formatting_on_the_signature_bar_leaves_plain_left_textcentre_from_the_signature_bar_is_shown_in_the_preview_as_senttyping_goes_on_in_the_signature_after_a_bar_buttonthe_messages_format_gives_the_keyboard_to_the_message_not_the_open_signaturea_signature_closed_before_it_took_the_keyboard_back_leaves_nothing_for_the_nextcrates/ui-egui/src/compose_window_tests.rs:a_windows_format_switched_while_a_signature_is_open_gives_the_keyboard_back_to_its_messagecrates/engine/src/cmd/signature_tests.rs:a_highlight_in_the_open_signature_is_saved_and_goes_outThe ribbon's existing tests pass unchanged, so the Message tab's group is as it was.
cargo xtask cipasses on this branch (on parts 1 and 2, onmainat 049c16b), all 12 steps.Looked at in light and dark with
ui_shotbefore the rebase: a centred signature line, the new row, the Center button on, and the centred line in the preview.Reviewed by a second model (Codex) over one round, until it found nothing more; after the rebase onto today's
mainit found that HTML and Plain Text, run while a signature is open, would have sent the keyboard to the signature, that a request could outlive its signature, and that a message behind an open signature lost its request; fixed and tested.Hand-tested on Linux (GNOME, Wayland) with
--sample: File › Signatures with a rich signature open, the new row of buttons, the Highlight menu, Center shown in the preview, typing straight after a click; a popped-out message switched to Plain Text while Signatures was open kept the keyboard where it was. Not tried by hand: the window at 1024 px wide, and other display scales.cargo xtask cipasses"Allow edits by maintainers" is ticked
I have signed the CLA
Human-reviewed, AI-assisted, nobody's mailbox harmed.