T60: each fallback picker is keyed by its input, not its place, since Ely's combobox keeps its state by id and listens to the input it first met; after a removal moved the inputs, a picker keyed by place wrote another row's family into its new input at the next blur

This commit is contained in:
ZacharyZhang-NY committed 2026-10-19 17:48:06 -04:00
1 parent 885aa4bda0
commit 5d131e51d8
3 files changed
+9 -4

No files matched your search

+1 -1
View File
@@ -117,4 +117,4 @@ ELYTerminal. A terminal on GPUI and Ely components. `PRD.md` says what it does;
- 2026-10-19: the terminal shows a scrollbar, which a user asked for in issue #2 after 0.1.5: a program that tracks the mouse takes the wheel, so the wheel alone could not reach the history. A thumb rides the view's right edge, over the padding, in Ely's scrollbar sizes and colors, its thickness, its least length and the foreground at 22 and 42 percent; its length is the screen's share of the history, and its place where the view stands. A drag moves the view through the history, whatever mouse mode the program asked for; the bar covers the grid's hitbox, so the terminal sees none of its presses, and a release with no press of its own reports nothing. Ely's `Scrollbar` reads a gpui `ScrollHandle`, and the terminal's place is alacritty's display offset, so the bar is the terminal's own, drawn as Ely draws hers and dragged through gpui's drag as hers is; gpui sets a drag's anchor at its first move past the threshold, so a pointer that jumps far at once loses that jump. The alternate screen holds no history, so it shows none. Under Xorg's dummy screen, 500 lines in, a drag to the top showed the first prompt and lines 1 to 39, and with mouse tracking on, which sent the wheel to the program, the bar still scrolled.
- 2026-10-19: a plain click on the line the shell reads moves its cursor there, which a user asked for after 0.1.6, as Ghostty's `cursor-click-to-move`: a press with no modifier, one click, let go in its own cell with no selection, while OSC 133 says the shell reads a line, B since the last A or C, and the program tracks no mouse at the release. A shell whose prompt start says `click_events=1` or `2`, as fish from 4.1 says on its own, hears a click past the prompt's last cell before the cursor, or, where no prompt cell of its own line comes before the input, as under fish's empty prompt, from the first cell of the newest line typed, known by its number, not its place, since a prompt drawn at the screen's top leaves older lines below it, down to that line's last row or the cursor's, and never on a prompt cell, itself, a left press in SGR, its row the screen's or counted from the prompt's first, as kitty and Ghostty send it, and moves its own cursor, combining marks and its own redraws included: fish moves by code point, and its redraws drop the wrap flags a count would follow. Any other shell gets Left or Right arrows, one per cell, each pressed and let go as the keyboard would, through the key encoder, so DECCKM, kitty's flags and win32-input-mode shape them; the count runs only on the cursor's line, soft wraps joined, past the prompt's cells, which the prompt's link marks, so bash 3.2, which sends no C, moves nothing once its command left the prompt's line. Cells after the last character typed count only up to the cursor, so a click past the end goes to the end; a wide character takes one arrow. Never on the alternate screen. One line only, as Ghostty's `cl=line`. A right prompt or an autosuggestion past the typed text counts as text, as in Ghostty, so a click on it may take the suggestion. The first click of a double click moves the cursor before the word selects, as in Ghostty.
- 2026-10-19: files dropped on the terminal type their paths, which a user asked for after 0.1.6, as macOS Terminal does: each path followed by a space, the paths of one drop in its order, sent as a paste, bracketed when the program asked, and kept literal for the shell the session started, which its name says, as the integration reads it: for sh, bash, zsh, fish and any other, each character Ghostty escapes gets a backslash, and `^` and `~` too, which zsh's `extendedglob` reads; for pwsh and powershell, the default on Windows, single quotes, each single quote inside doubled, PowerShell's curly ones too, since PowerShell reads a backslash as a plain character and expands `$` inside double quotes; for cmd, double quotes, which keep `&`, `|`, `<`, `>` and `^` inert, the backslashes ending a path doubled, since a program's parser reads `\"` as a quote, as `C:\` ends, and a path holding `%`, or `!`, which cmd expands inside them under `/v:on`, stops the drop. Windows Terminal's quotes around a path with a space alone leave `$(...)` and `;` live in PowerShell. A program run inside the session, `cmd` under PowerShell among them, gets the session's own quoting. A path not in UTF-8, or holding a control character, which would act as it is typed, stops the drop, logged. gpui hands a drop to the hitbox under the pointer only while the last input was not the keyboard, and a file drag counts as no input of its own: after typing, a drop with no pointer move over the window since does nothing, and nothing in ELYTerminal sees it, which the owner chose to leave so. `shot`'s `drop@x,y` plays a drop through `Window::dispatch_event`, so AppKit's drag session itself goes untested.
- 2026-10-19: fallback fonts, which a user asked for after 0.1.6, since the Chinese and Latin fonts people like seldom come as one: `font_fallbacks` in the settings lists installed families, tried in order for a character Font family lacks, through gpui's `Font::fallbacks`, which CoreText's cascade list, DirectWrite's fallback builder and cosmic-text's chain each honor; the system's own fallback follows the last. On Linux gpui's cosmic-text path keeps the fallback the last character took while it covers the next, so shaping clusters stay whole: with two fallbacks, a character only the second covers carries the next one, which the first covers too, into the second; macOS and Windows choose per character. The owner chose to leave that so. Each family must load as the terminal draws it, as Font family must, so a family gpui would pass over without a word stops the start or the save, the error naming `font_fallbacks`; an empty name is refused. The field is new beside `font_family`, so a settings file from before loads as it was. Settings › Appearance lists them under Family: each an Ely `FontPicker` whose pick replaces it and a button that removes it, then Add fallback, which opens an empty picker whose pick adds one, its button closing it; a refused pick shows the saved family again, as Family's does. Each row keeps an input of its own, and a removal drops the removed row's input and takes the focus away, since Ely's combobox keeps a focused input's text, and an input kept by place would show, and on Enter save, the family removed. Ligatures and the bundled Nerd Font for private-use icons stand as before; the cursor preview keeps the family alone.
- 2026-10-19: fallback fonts, which a user asked for after 0.1.6, since the Chinese and Latin fonts people like seldom come as one: `font_fallbacks` in the settings lists installed families, tried in order for a character Font family lacks, through gpui's `Font::fallbacks`, which CoreText's cascade list, DirectWrite's fallback builder and cosmic-text's chain each honor; the system's own fallback follows the last. On Linux gpui's cosmic-text path keeps the fallback the last character took while it covers the next, so shaping clusters stay whole: with two fallbacks, a character only the second covers carries the next one, which the first covers too, into the second; macOS and Windows choose per character. The owner chose to leave that so. Each family must load as the terminal draws it, as Font family must, so a family gpui would pass over without a word stops the start or the save, the error naming `font_fallbacks`; an empty name is refused. The field is new beside `font_family`, so a settings file from before loads as it was. Settings › Appearance lists them under Family: each an Ely `FontPicker` whose pick replaces it and a button that removes it, then Add fallback, which opens an empty picker whose pick adds one, its button closing it; a refused pick shows the saved family again, as Family's does. Each row keeps an input of its own, and a removal drops the removed row's input and takes the focus away, since Ely's combobox keeps a focused input's text, and an input kept by place would show, and on Enter save, the family removed. Each picker's id is its input's entity, not its place: Ely's combobox keeps its state by id and listens to the input it first met, so a picker keyed by place, after a removal moved the inputs, wrote another row's family into its new input at the next blur. Ligatures and the bundled Nerd Font for private-use icons stand as before; the cursor preview keeps the family alone.
+7 -2
View File
@@ -212,7 +212,7 @@ impl SettingsWindow {
)
};
let rows = families.iter().enumerate().map(|(index, family)| {
let picker = FontPicker::new(("font_fallback", index), &self.fallbacks[index])
let picker = FontPicker::new(keyed(&self.fallbacks[index]), &self.fallbacks[index])
.selected(family.clone())
.on_change(pick(&this, index));
let remove = IconButton::new(("remove_fallback", index), IconName::X).on_click({
@@ -233,7 +233,7 @@ impl SettingsWindow {
});
let next = families.len();
let add = if self.adding {
let picker = FontPicker::new(("font_fallback", next), &self.fallbacks[next])
let picker = FontPicker::new(keyed(&self.fallbacks[next]), &self.fallbacks[next])
.on_change(pick(&this, next));
let cancel = IconButton::new("cancel_fallback", IconName::X).on_click({
let this = this.clone();
@@ -296,6 +296,11 @@ impl SettingsWindow {
}
}
/// A fallback picker's id, its input's: Ely's combobox keeps state by id and listens to the input it met first.
fn keyed(input: &Entity<TextInput>) -> (&'static str, u64) {
("font_fallback", input.entity_id().as_u64())
}
/// Saves the family picked at fallback `index`, past the last adds one; a refusal shows the saved family again, the list closed.
fn pick(
this: &Entity<SettingsWindow>,
+1 -1
View File
@@ -63,7 +63,7 @@ What no check reached: no real KWin drew the blur; of Wayland desktops, only Hyp
| Colors, styles, five underlines, wide characters, combining marks | T06 | `term::frame`, `term::ink`, `term::paint` tests | Pass |
| Box drawing, blocks and powerline shapes as geometry | T07 | `term::boxes` tests | Pass |
| JetBrains Mono, any installed font, Nerd Font icons | T06, T17 | `tests/fonts.rs` | Pass |
| Fallback fonts: installed families tried in order for a character the family lacks, listed under Family in Settings › Appearance | T60 | `settings` test: a file without `font_fallbacks` loads with none, named families keep their order, and an empty one is refused; on macOS with Menlo and `"font_fallbacks": ["Kaiti SC"]` the terminal drew `中文字体 終端` in Kaiti and Latin in Menlo, where without it the system drew them in PingFang; a fallback gpui cannot load, `No Such Font`, stopped the start with `font_fallbacks: the terminal cannot load "No Such Font"`, and an empty one with `font_fallbacks holds an empty family`; in Settings › Appearance, Add fallback opened an empty picker, picking Kaiti SC saved `["Kaiti SC"]` and the terminal took it at once, the row's X saved `[]`, and Apple Color Emoji, which gpui loads no font for, was refused and nothing saved; round 1 of T60's review found that removing the row whose input held the focus left the removed family in it, and Enter saved it over the next: a removal drops that row's input and the focus, so after removing Kaiti SC from `[Kaiti SC, Songti SC, PingFang SC]` with its input focused the rows showed Songti SC and PingFang SC and Enter saved nothing new; on Linux, gpui's cosmic-text path carries a character a second fallback took into the next, as AGENTS records | Pass |
| Fallback fonts: installed families tried in order for a character the family lacks, listed under Family in Settings › Appearance | T60 | `settings` test: a file without `font_fallbacks` loads with none, named families keep their order, and an empty one is refused; on macOS with Menlo and `"font_fallbacks": ["Kaiti SC"]` the terminal drew `中文字体 終端` in Kaiti and Latin in Menlo, where without it the system drew them in PingFang; a fallback gpui cannot load, `No Such Font`, stopped the start with `font_fallbacks: the terminal cannot load "No Such Font"`, and an empty one with `font_fallbacks holds an empty family`; in Settings › Appearance, Add fallback opened an empty picker, picking Kaiti SC saved `["Kaiti SC"]` and the terminal took it at once, the row's X saved `[]`, and Apple Color Emoji, which gpui loads no font for, was refused and nothing saved; round 1 of T60's review found that removing the row whose input held the focus left the removed family in it, and Enter saved it over the next: a removal drops that row's input and the focus, so after removing Kaiti SC from `[Kaiti SC, Songti SC, PingFang SC]` with its input focused the rows showed Songti SC and PingFang SC and Enter saved nothing new; round 2 found the pickers keyed by place, so after that removal a blur wrote PingFang SC into the first row and Enter saved it twice: each picker is keyed by its input, and the same removal, a click, the app activated and deactivated, and Enter, which in the build before saved `[PingFang SC, PingFang SC]`, kept `[Songti SC, PingFang SC]`; on Linux, gpui's cosmic-text path carries a character a second fallback took into the next, as AGENTS records | Pass |
| Cursor shapes, blink by setting and DECSCUSR, hollow unfocused | T06 | T06 review | Pass |
| xterm keys, cursor mode, Option as Alt, kitty protocol, keypad; a shifted symbol as its own key with Shift on macOS and Windows; win32-input-mode on Windows | T08, T44 | `term::keys` tests, `kitty_reports_the_key_shift_turned_into_a_symbol` red at `CSI 123;13u` before the fix; on macOS herdr 0.9.5, its `[keys]` `previous_workspace = "cmd+shift+ctrl+["` and `next_workspace = "cmd+shift+ctrl+]"`, run by `shot` in a fresh HOME: before, ⌘⇧⌃] sent `CSI 125;13u` and herdr stayed on its workspace; after, `CSI 93:125;14u` moved it to the next and ⌘⇧⌃[, `CSI 91:123;14u`, back; `term::win32` and `term::tap` tests on Windows | Pass |
| IME: marked text at the cursor, commits to the program | T08 | T08 review | Pass |