diff --git a/Plans/08 WebKit engine/S057-small-ui-bugs.md b/Plans/08 WebKit engine/S057-small-ui-bugs.md index 2387d31..0380ab8 100644 --- a/Plans/08 WebKit engine/S057-small-ui-bugs.md +++ b/Plans/08 WebKit engine/S057-small-ui-bugs.md @@ -24,8 +24,8 @@ Bugs the user and S048/S056 found that are small but visible every day. - `src/egui_area.rs` (contains/pick, scroll events), `src/ui/pages/customize.rs`, the S048 and S056 PROGRESS entries. ## Steps -- [ ] Wheel over floating egui surfaces scrolls them, never the page; Customize sheet scrolls to its last row; regression smoke (wheel over the sheet, assert scroll offset; page scroll unchanged). -- [ ] Colour picker chips render (font fallback or no emoji). +- [x] Wheel over floating egui surfaces scrolls them, never the page; Customize sheet scrolls to its last row; regression smoke (wheel over the sheet, assert scroll offset; page scroll unchanged). +- [x] Colour picker chips render (font fallback or no emoji). - [ ] beforeunload on window close / quit through Nacre's dialog; smoke with a page that sets it. - [ ] Site colour from the favicon (dominant vivid colour, unit-tested on a few icons: red, blue, monochrome → none), applied when Colour source = Website; works on WebKit; `colours.txt` smoke updated; shots of two coloured sites and one monochrome site read. - [ ] Hidden smokes launch, basics, input, chrome, newtab green; shots read. @@ -39,3 +39,6 @@ Bugs the user and S048/S056 found that are small but visible every day. ## Handoff (→ PROGRESS.md) Which surfaces now take the wheel. + +## Resume +Boxes 1-2 done (Area allocate_rect fix in customize.rs; 📋 aliased to content_copy in tools/icons.py). Next: box 3 beforeunload. diff --git a/assets/fonts/MaterialSymbolsOutlined-Nacre.ttf b/assets/fonts/MaterialSymbolsOutlined-Nacre.ttf index cd9025d..386e5f7 100644 Binary files a/assets/fonts/MaterialSymbolsOutlined-Nacre.ttf and b/assets/fonts/MaterialSymbolsOutlined-Nacre.ttf differ diff --git a/src/ui/pages/customize.rs b/src/ui/pages/customize.rs index 47451ea..933b1ca 100644 --- a/src/ui/pages/customize.rs +++ b/src/ui/pages/customize.rs @@ -100,8 +100,10 @@ pub fn panel(ui: &mut Ui, f: &mut Frame, page: Rect, rect: Rect) { ui.set_clip_rect(page); crate::ui::paint::shadow(ui.painter(), rect, radius, p.dark); ui.painter().rect_filled(rect, theme::corner_radius(radius), p.surface_container_high); - // Swallow clicks on the panel's empty parts so they don't reach the page under it. - ui.interact(rect, Id::new("ntp-customize-back"), Sense::click()); + // The Area is as big as what it allocates; without this it stays tiny and egui_area's `contains` lets + // the wheel and clicks over the rest of the sheet fall through to the page. + // Also swallows clicks on the panel's empty parts so they don't reach the page under it. + ui.allocate_rect(rect, Sense::click()); let inner = rect.shrink2(vec2(theme::GAP_L, theme::GAP_M)); let mut child = ui.new_child(egui::UiBuilder::new().max_rect(inner)); child.set_clip_rect(rect.intersect(page)); diff --git a/tests/smoke/colour-picker.txt b/tests/smoke/colour-picker.txt new file mode 100644 index 0000000..ef70763 --- /dev/null +++ b/tests/smoke/colour-picker.txt @@ -0,0 +1,11 @@ +# The egui colour picker in Settings → Appearance shows no broken glyph chips (S057). +# Run: SMOKE_SIZE=1280x1100 tools/smoke.sh tests/smoke/colour-picker.txt +wait 3 +page nacre://settings/appearance +wait 1.5 +shot appearance +tap 1116 768 +wait 1 +shot picker +status done +quit diff --git a/tests/smoke/customize-scroll.txt b/tests/smoke/customize-scroll.txt new file mode 100644 index 0000000..31e73ed --- /dev/null +++ b/tests/smoke/customize-scroll.txt @@ -0,0 +1,22 @@ +# Wheel over the new tab page's Customize sheet scrolls the sheet, never the page behind it (S057). +# Run: SMOKE_SIZE=1400x700 tools/smoke.sh tests/smoke/customize-scroll.txt +# Expect: sheet-top shows the first rows, sheet-bottom the last rows (list ends with the details section), and the +# page behind (sheet-bottom vs sheet-top) did not move. +wait 3 +page nacre://newtab +wait 1 +customize +wait 2 +shot sheet-top +scroll 1200 400 300 +wait 0.5 +scroll 1200 400 300 +wait 0.5 +shot sheet-mid +scroll 1200 400 3000 +wait 1 +shot sheet-bottom +customize close +wait 1 +status done +quit diff --git a/tools/icons.py b/tools/icons.py index 145a55b..42c972a 100644 --- a/tools/icons.py +++ b/tools/icons.py @@ -10,6 +10,7 @@ from pathlib import Path from fontTools import subset from fontTools.ttLib import TTFont +from fontTools.ttLib.tables._c_m_a_p import CmapSubtable from fontTools.varLib import instancer ROOT = Path(__file__).resolve().parent.parent @@ -34,6 +35,14 @@ subsetter = subset.Subsetter(options) subsetter.populate(unicodes=[by_name[n] for n in names]) subsetter.subset(font) font = instancer.instantiateVariableFont(font, {"GRAD": 0, "opsz": 24}) + +# egui's colour picker has a hard-coded 📋 (U+1F4CB) copy button that no interface font covers: alias it to content_copy. +cmap = font["cmap"] +best = dict(font.getBestCmap()) +best[0x1F4CB] = best[by_name["content_copy"]] +table = CmapSubtable.newSubtable(12) +table.platformID, table.platEncID, table.language, table.cmap = 3, 10, 0, best +cmap.tables = [t for t in cmap.tables if not (t.platformID == 3 and t.platEncID == 10)] + [table] font.save(OUT_FONT) lines = [