From bfc6e4fae0fe286154ae73447009a30f6c6f8d1a Mon Sep 17 00:00:00 2001 From: astar76 Date: Sat, 14 Nov 2026 07:11:54 -0600 Subject: [PATCH] S057: Customize sheet takes the wheel, colour picker copy glyph renders (WIP) Co-Authored-By: Claude Sonnet 5.5 --- Plans/08 WebKit engine/S057-small-ui-bugs.md | 7 ++++-- .../fonts/MaterialSymbolsOutlined-Nacre.ttf | Bin 73196 -> 75236 bytes src/ui/pages/customize.rs | 6 +++-- tests/smoke/colour-picker.txt | 11 +++++++++ tests/smoke/customize-scroll.txt | 22 ++++++++++++++++++ tools/icons.py | 9 +++++++ 6 files changed, 51 insertions(+), 4 deletions(-) create mode 100644 tests/smoke/colour-picker.txt create mode 100644 tests/smoke/customize-scroll.txt 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 cd9025d4566cd2b5b5904d602f756adb63e783ee..386e5f779458bb0d0341cf3b48df3acfe7de6030 100644 GIT binary patch delta 2352 zcmaE}o8`%AmI-3@6%QB~7_>aX9D^8y82lL+DtQfU#7*{YbFeC(r zIEJ);C|$(BP-(-!z;Gn7EU}1z{pD%~hAIXI1_qPl+{A(nAx94|FfeB@F!20KD@!c8 zGH2UU28JpV1_p+n^u*!<1_lNJ28N0o3=9k$={c2Y54y4+Fvv3qUSMEIzK~v)ShUNn zD2#!j>Hq`7YL$%C#1ymNy7?2g7%>SHOnf2dRl0zIfmxy;zqo{fnSqgkp<)LE1A{_A zQEEX3TTd$kgFprY0|PrqhJoq+zHhI5Qsen;zH%@z9{{=V$;;myAo{r+pWfsE##v1N z|8IW7SkEZQ%)r0^!ZHw389+1_0|P7H<{IYDEcKw!U||0M(#pWVu!4c%0T%=_6f!V8 zkcVJ~Squyh6d;&kCIiC*69{IQ&A{-$9D*69F)%!EU|@LQ$iTqR%fRr!8G;#l7#JS7 zFfcrDWnf^K&cN`%9fBF=Ffcsut_Kke3=HiI3=e!Em|+3~!vlW^W|+jl@E`z!8749? zJP3qf23-b*hprIJkjlXD&=-Ok)EO8a`av*5J_Ex;e+Xt!Wng$11i=i63=9vWA(){) zg@NHANFb4cfkA_T;b9U4Gk^?9V_f#IfvkVL%%#g;w@bnx6GXya(JUtJ=41o*`PcJ|)gBt_G)B1}H3{NjIFfh0> zFg(2k!3+ru3{NjJFg(4&z`)?a!0_}c1T%nqa)W{4DJX}BF)%#64Z#fI3=GehAef6y)tc75P4hDu7n<1D%oPpuRHV9^5Vqkc&1A-YAF)+M12f+;K3=A)BKrn+I z1H+3)5X`WSf#Jnd2xbUjV0iJIf#F5{a|Q+mI|haqUlz-cGcdg5g_6W^iC&sDC+|fdPaW*cljJZh&A04hDvon;@7WlY!yoE(m6bV_Y3?F(Rn1PRh;ll(7W{6~9_%I!U8HyPgKFoq(hA9jTA7(=^LlgtU zhkX#tP|wf6@ZmB9Gb~|X_{a;v4BQM1AI%|{VJ-v1$4CffXkcLY7z4qeroqP|1_lsj zXklRZSOUQejSLJQ%OIGcmVx2pS_o#yWnlPt8-f`)85lnPVPL2S5e%9P44=3mm|-yk z!`CMe%#g#t@SPWe84MX1z6(GwgAxP7cR2`Vh+$y(?hL^UY77iN>L8fGk%8gIHV9@A fWMKGl9D*69GBAEQ4aN)%>I}{K9NY6b7;8lV+SF|- delta 296 zcmaEIn&r)ImI-3@1uqyF7_>aX9D^8y82lL+3Pl(g81(&v^^F_@;{zEO7*{YbFeC(r zIEJ);C|$(BQ0T(Iz;Gn7EU}1z{pD%~h9V9I1_qPl+{6OAjsu+x49pn}46JNvWr;;s z=4^Y)z))nvz`)Rxo>*MKz`!8Dz)Mb7_X&$pMVBn0_4J l{D!ffQILs&fq|KUfk6afDuc-87Us_^&FKQ$(*+o7MFAaiQvCn` 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 = [