Show a confirmation's text in a well, with its line breaks, scrolling #34

Closed
opened 2026-10-20 20:21:38 -05:00 by jeff · 0 comments
Owner

A Confirmation for a program's write, or for an Unsafe paste, shows the text as three dim rows of at most 64 cells. Each line break is a ⏎, tabs are spaces, and other control characters are dropped, all in the same color as the Confirmation's own words. So it is hard to tell what would be pasted from what harrier is saying, and anything past the third row cannot be seen. A read shows no text, so it is unchanged.

Setting the text apart

  • The text is in a well: an inset box with an edge line, in the pane's own background, holding the text in the pane's full foreground color.
  • A dim label above the well gives the size: "3 lines · 42 B", or "1 line · 5 B" for one line. It counts lines as Toast.count does, and gives the size as Confirmation.formatSize does.
  • The question, the why, the types and the buttons stay on the Confirmation's fill.

How the text is laid out

  • Each line gets its own row. Every line break gets a dim ⏎: \n, \r\n as one, and a lone \r, which reaches the program as Enter just as the others do (Confirmation.unsafePaste counts it so).
  • Long lines wrap at the well's width, with a dim ↪ starting each continuation row. No grapheme is split, and a wide one takes two cells.
  • Tabs expand to the next 8-column stop.
  • Control characters are never dropped. They are shown dim: C0 other than tab and the line breaks as U+2400–U+241F (␛ ␇ ␀ …), DEL as ␡, and C1 and bytes that are not UTF-8 as �.

Size and scrolling

  • The well grows with the text until the Confirmation fills the pane (the current top margin, and one cell below), then scrolls. All of the text can be reached, however large; only the rows on screen are laid out.
  • The Confirmation widens to fit the longest line, up to 120 cells or the pane less its margins. It is never narrower than today's 64.
  • An image written along with the text stays above the well (at most 8 rows), and the well gets the height that is left.
  • The well starts at the top, with the pane scrollbar style (decor/Scrollbar) along its right edge when it scrolls.

Keys and pointer

  • The mouse wheel over the well scrolls it.
  • PageUp and PageDown scroll a well's height, and Up and Down one line.
  • Left, Right, Tab and shift+Tab move between the answers. Up and Down no longer do.
  • Enter and Escape answer, wherever the well has been scrolled to.
A **Confirmation** for a program's write, or for an **Unsafe paste**, shows the text as three dim rows of at most 64 cells. Each line break is a ⏎, tabs are spaces, and other control characters are dropped, all in the same color as the Confirmation's own words. So it is hard to tell what would be pasted from what harrier is saying, and anything past the third row cannot be seen. A read shows no text, so it is unchanged. ## Setting the text apart - The text is in a **well**: an inset box with an edge line, in the pane's own background, holding the text in the pane's full foreground color. - A dim label above the well gives the size: "3 lines · 42 B", or "1 line · 5 B" for one line. It counts lines as `Toast.count` does, and gives the size as `Confirmation.formatSize` does. - The question, the why, the types and the buttons stay on the Confirmation's fill. ## How the text is laid out - Each line gets its own row. Every line break gets a dim ⏎: `\n`, `\r\n` as one, and a lone `\r`, which reaches the program as Enter just as the others do (`Confirmation.unsafePaste` counts it so). - Long lines wrap at the well's width, with a dim ↪ starting each continuation row. No grapheme is split, and a wide one takes two cells. - Tabs expand to the next 8-column stop. - Control characters are never dropped. They are shown dim: C0 other than tab and the line breaks as U+2400–U+241F (␛ ␇ ␀ …), DEL as ␡, and C1 and bytes that are not UTF-8 as �. ## Size and scrolling - The well grows with the text until the Confirmation fills the pane (the current top margin, and one cell below), then scrolls. All of the text can be reached, however large; only the rows on screen are laid out. - The Confirmation widens to fit the longest line, up to 120 cells or the pane less its margins. It is never narrower than today's 64. - An image written along with the text stays above the well (at most 8 rows), and the well gets the height that is left. - The well starts at the top, with the pane scrollbar style (`decor/Scrollbar`) along its right edge when it scrolls. ## Keys and pointer - The mouse wheel over the well scrolls it. - PageUp and PageDown scroll a well's height, and Up and Down one line. - Left, Right, Tab and shift+Tab move between the answers. Up and Down no longer do. - Enter and Escape answer, wherever the well has been scrolled to.
jeff closed this issue 2026-10-20 21:52:14 -05:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
jeff/harrier#34
No description provided.