Merge PR #9197: fix(ui): the font menu opens on the current family's recent row (#9160)

Docs: status lines and revision rows kept from both sides.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This commit is contained in:
David MannandClaude Opus 5.5 committed 2026-10-25 15:02:38 +01:00
commit dbe1e4e604
3 files changed
+74 -23

No files matched your search

+53 -19
View File
@@ -768,27 +768,61 @@ fn open_menu_arrows_walk_on_through_recent_fonts() {
}
/// Opened on a family that is also a recent one (the usual case: every pick records it), the
/// arrows start from its alphabetical place, and only that row is marked.
/// menu marks its copy in the recent group, as Photoshop's does (#9160), and only that row; the
/// arrows walk on from there through the list as shown (Photoshop: ↓ goes to the next recent
/// family).
#[test]
fn open_menu_on_a_recent_font_steps_through_the_alphabet() {
fn open_menu_on_a_recent_font_marks_its_recent_row() {
use egui_kittest::kittest::NodeT;
for (key, want) in [(Key::ArrowDown, "Family 06"), (Key::ArrowUp, "Family 04")] {
let mut h = harness_with_recents(FontPreview::Off, vec!["Family 05".into(), "Family 09".into()]);
h.state_mut().current = "Family 05".into();
h.run();
open(&mut h);
let marked = |h: &Harness<'static, State>, label: &str| {
h.query_all_by_label(label).filter(|n| n.accesskit_node().toggled() == Some(egui::accesskit::Toggled::True)).count()
};
assert_eq!(marked(&h, "Family 05"), 1, "one row marked");
h.key_press(key);
h.run();
assert_eq!(h.state().current, want);
h.key_press(Key::ArrowDown);
h.key_press(Key::ArrowUp);
h.run();
assert_eq!(h.state().current, want, "and walks on from there");
}
let mut h = harness_with_recents(FontPreview::Off, vec!["Family 05".into(), "Family 09".into()]);
h.state_mut().current = "Family 05".into();
h.run();
open(&mut h);
let marked = |h: &Harness<'static, State>, label: &str| -> Vec<f32> {
h.query_all_by_label(label).filter(|n| n.accesskit_node().toggled() == Some(egui::accesskit::Toggled::True)).map(|n| n.rect().top()).collect()
};
let tops = |h: &Harness<'static, State>, label: &str| -> Vec<f32> {
let mut t: Vec<f32> = h.query_all_by_label(label).map(|n| n.rect().top()).collect();
t.sort_by(f32::total_cmp);
t
};
assert_eq!(marked(&h, "Family 05"), [tops(&h, "Family 05")[0]], "the upper (recent) copy alone is marked");
h.key_press(Key::ArrowDown);
h.run();
assert_eq!(h.state().current, "Family 09", "↓ walks on to the next recent family");
h.key_press(Key::ArrowUp);
h.run();
assert_eq!(h.state().current, "Family 05", "and ↑ back");
}
/// #9160: the menu opens showing the current family, as Photoshop's does: a family deep in the
/// list is scrolled to the top of the view, not left wherever the list happens to start.
#[test]
fn open_menu_shows_the_current_family() {
let mut h = harness_with_recents(FontPreview::Off, vec!["Zeta Sans".into()]);
h.state_mut().current = "Family 40".into();
h.run();
open(&mut h);
h.run();
let popup = popup_rect(&h).expect("the menu is open");
let row = h.query_all_by_label("Family 40").next().expect("its row").rect();
assert!(popup.contains_rect(row), "Family 40 is in view: {row:?} in {popup:?}");
}
/// The current family is in view the frame the menu opens, with the app's scroll animation on:
/// the reveal jumps, where an animated scroll left the row outside the popup for a while.
/// The harness turns animations off, so this turns a slow one back on.
#[test]
fn open_menu_shows_the_current_family_without_animating() {
let mut h = harness_with_recents(FontPreview::Off, Vec::new());
h.ctx.all_styles_mut(|s| s.scroll_animation = egui::style::ScrollAnimation::duration(10.0));
h.state_mut().current = "Family 40".into();
h.run();
h.query_all_by_role(Role::ComboBox).next().unwrap().click();
h.run_steps(4);
let popup = popup_rect(&h).expect("the menu is open");
let row = h.query_all_by_label("Family 40").next().expect("its row").rect();
assert!(popup.contains_rect(row), "Family 40 is in view: {row:?} in {popup:?}");
}
/// The same through the real options bar, where the pick itself records the recent family.
+19 -3
View File
@@ -1828,16 +1828,26 @@ pub(crate) fn family_picker_in(
let ql = q.to_lowercase();
// The recent group stays as it was when the menu opened: each arrow step applies (and so
// records) a family, and moving it to the top would send the next step back up.
let opening = ui.data(|d| d.get_temp::<Vec<String>>(recents_id).is_none());
let open_recents: Vec<String> = ui.data_mut(|d| d.get_temp_mut_or_insert_with(recents_id, || recents.to_vec()).clone());
let (rows, n_recent) = font_menu_rows(families, labels, &ql, &open_recents);
// A recent family is listed twice. The current family's row is the one the last arrow
// selected while it still shows that family, else its alphabetical copy, so the arrows
// step through the alphabet as on the closed field.
// selected while it still shows that family, else its first copy: as in Photoshop, the
// one in the recent group when it has one (#9160), and the arrows walk on from there.
let mut selected = ui
.data(|d| d.get_temp::<usize>(row_id))
.filter(|&i| rows.get(i).is_some_and(|(f, _)| *f == current))
.or_else(|| rows.iter().skip(n_recent).position(|(f, _)| *f == current).map(|i| i + n_recent))
.or_else(|| rows.iter().position(|(f, _)| *f == current));
// The menu opens on the current family, as Photoshop's does: at the top of the list when
// it is a recent one, else its row at the top of the view. Kept until a laid-out pass
// (the popup's first pass only measures).
let reveal_id = search_id.with("reveal");
if opening {
ui.data_mut(|d| d.insert_temp(reveal_id, true));
}
let reveal = (ui.data(|d| d.get_temp::<bool>(reveal_id)).unwrap_or(false) && !ui.is_sizing_pass())
.then(|| selected.map(|i| if i < n_recent { 0 } else { i }))
.flatten();
let mut stepped = None;
if down || up {
let next = match selected {
@@ -1886,6 +1896,11 @@ pub(crate) fn family_picker_in(
let response = ui.add_sized([330.0, row_h], button);
if stepped == Some(i) {
response.scroll_to_me(Some(egui::Align::Center));
} else if reveal == Some(i) {
// Jump, not glide: the menu opens with its current family in view. Arrow
// steps above keep the animation.
response.scroll_to_me_animation(Some(egui::Align::Min), egui::style::ScrollAnimation::none());
ui.data_mut(|d| d.remove::<bool>(reveal_id));
}
if let Some((size, _)) = preview
&& ui.is_rect_visible(response.rect)
@@ -1925,6 +1940,7 @@ pub(crate) fn family_picker_in(
d.remove::<bool>(focus_id);
d.remove::<Vec<String>>(recents_id);
d.remove::<usize>(row_id);
d.remove::<bool>(search_id.with("reveal"));
});
}
let hovered_font = response.inner.unwrap_or_default();
+2 -1
View File
@@ -1,6 +1,6 @@
# UI parity: tools, handles, modifiers and feel
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-24 · **Change:** minor (Type options bar alignment and direction follow the target paragraph; a swatch click recolours selected type and shape layers with any tool, #9238; UI scale presets done: 105–120% steps, #3222; ⇧⌥ blend mode letters; painting tool Mode menus; ⌥ + an adjustment's shortcut reopens it at its last settings, ⌥⌘L / ⌥⌘M, #8900; Crop default mode: moving the image under the box snaps the frame's edges and centre, #8580; View › Extras hides the Move transform controls, #6699; adjustment clipping stays visible in compact Properties, #5231; Color panel modes from its panel menu, the same in every theme, UI-217-17, #6000; a picked colour recolours the selected type and shapes; Hand tool ⌘ / ⌥ are Zoom In / Zoom Out while held, #6434; the wheel steps value fields, #5473; a dragged guide shows its X or Y beside the pointer, #7680; Type options bar "T" icon scrubs the font size, #6437; Move tool: dragged selected pixels take their own outline as the selection, #7538; artboard backgrounds remain below child Free Transform previews; ⌫/Delete removes the selected smart filter, #4751; Object Finder foreground/background discrimination (#6548); rounded triangle, polygon and star corners; shape Fill/Stroke popovers accept hex RGB values, #6176; a guide let go over either ruler is removed, #6286; Crop rows corrected: saved crop presets and Delete Cropped Pixels off are done, #6562; marching ants in device pixels, #7489; Animated Zoom: holding the Zoom tool zooms continuously, #6210; shape Density and Feather, TOOL-214-12, #5846; Pen Auto Add/Delete on the path being drawn, #6140; Show Transform Controls frames every selected layer; guide keys and clicks; menu bar from the keyboard, #4988; Crop tool Content-Aware Fill; on-canvas corner radius widgets, TOOL-214-12; Curvature Pen edits the active path; Clip Thumbnails to Layer Bounds; Pen ⇧ 45°; last selected tool restored at launch; Layers panel filter-type dropdown with Kind, Name and Mode, #5048; Free Transform box and marching ants follow the selection, #5297; History: the trash deletes the selected snapshot, rows drag onto the trash, #5324; smart filter reordering by drag; smart object perspective row corrected to done, #426; Free Transform H/V skew fields; toolbar tool shortcuts can be reassigned; ⇧-dragged guides land on ruler ticks; layer and selection keys; tool keys; spring-loaded tool letters; type formatting keys; Pen Auto Add/Delete, #4144; smart filter rows; stale missing-tool rows corrected: Color Replacement, Red Eye and the Add/Delete Anchor Point pair are live toolbar tools, Frame landed; no percentage changed; selection-modifier and ⌥-wheel rows match their tests) · **Target:** Adobe Photoshop 2026
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-24 · **Change:** minor (the font menu opens on the current family, marked in the recent group when it is a recent one, #9160; Type options bar alignment and direction follow the target paragraph; a swatch click recolours selected type and shape layers with any tool, #9238; UI scale presets done: 105–120% steps, #3222; ⇧⌥ blend mode letters; painting tool Mode menus; ⌥ + an adjustment's shortcut reopens it at its last settings, ⌥⌘L / ⌥⌘M, #8900; Crop default mode: moving the image under the box snaps the frame's edges and centre, #8580; View › Extras hides the Move transform controls, #6699; adjustment clipping stays visible in compact Properties, #5231; Color panel modes from its panel menu, the same in every theme, UI-217-17, #6000; a picked colour recolours the selected type and shapes; Hand tool ⌘ / ⌥ are Zoom In / Zoom Out while held, #6434; the wheel steps value fields, #5473; a dragged guide shows its X or Y beside the pointer, #7680; Type options bar "T" icon scrubs the font size, #6437; Move tool: dragged selected pixels take their own outline as the selection, #7538; artboard backgrounds remain below child Free Transform previews; ⌫/Delete removes the selected smart filter, #4751; Object Finder foreground/background discrimination (#6548); rounded triangle, polygon and star corners; shape Fill/Stroke popovers accept hex RGB values, #6176; a guide let go over either ruler is removed, #6286; Crop rows corrected: saved crop presets and Delete Cropped Pixels off are done, #6562; marching ants in device pixels, #7489; Animated Zoom: holding the Zoom tool zooms continuously, #6210; shape Density and Feather, TOOL-214-12, #5846; Pen Auto Add/Delete on the path being drawn, #6140; Show Transform Controls frames every selected layer; guide keys and clicks; menu bar from the keyboard, #4988; Crop tool Content-Aware Fill; on-canvas corner radius widgets, TOOL-214-12; Curvature Pen edits the active path; Clip Thumbnails to Layer Bounds; Pen ⇧ 45°; last selected tool restored at launch; Layers panel filter-type dropdown with Kind, Name and Mode, #5048; Free Transform box and marching ants follow the selection, #5297; History: the trash deletes the selected snapshot, rows drag onto the trash, #5324; smart filter reordering by drag; smart object perspective row corrected to done, #426; Free Transform H/V skew fields; toolbar tool shortcuts can be reassigned; ⇧-dragged guides land on ruler ticks; layer and selection keys; tool keys; spring-loaded tool letters; type formatting keys; Pen Auto Add/Delete, #4144; smart filter rows; stale missing-tool rows corrected: Color Replacement, Red Eye and the Add/Delete Anchor Point pair are live toolbar tools, Frame landed; no percentage changed; selection-modifier and ⌥-wheel rows match their tests) · **Target:** Adobe Photoshop 2026
How PhotoCraft's direct manipulation compares with Photoshop 2026 (27.11.0): the toolbox, the
handles and modifier keys of each gesture, nudging, snapping, numeric precision, navigation,
@@ -248,6 +248,7 @@ Paragraph; the rest open as in-app floating windows.
| 2026-10-25 | minor | Art History Brush is in the History group of the Y flyout (partial, TOOL-213-20, #1610) |
| 2026-10-24 | minor | Swatches: a click recolours the selected type layers and shape fills whatever the tool, as Photoshop 2025 does (measured with the Move and Brush tools); the Color panel still recolours them only with a Type, shape or Pen tool (#9238). Scores unchanged. |
| 2026-10-24 | minor | Type options bar: the alignment and paragraph-direction buttons show the edited or selected type layer's paragraph instead of the tool defaults, as Photoshop's bar does. Scores unchanged. |
| 2026-10-24 | minor | Font menus (options bar, Character panel): the current family is marked in the recent group when it is a recent one, and the menu opens showing it, as Photoshop's does; the arrows walk on from the marked row (#9160). Scores unchanged. |
| 2026-10-22 | minor | Crop default mode: a drag inside an upright box snaps the frame's edges and centre to the document, layers, guides and grid, as a Classic Mode frame's move does (#8580); no percentage changed |
| 2026-10-21 | minor | Adjustment clipping moved above Properties editors to remain visible in compact docks (#5231); scope, undo/redo and 8/16/32-bit pixel regressions; readiness estimate unchanged |
| 2026-10-19 | minor | A guide being moved or dragged out of a ruler shows an `X:` / `Y:` position readout beside the pointer, from the zero point in the ruler unit (#7680) |