S057: Customize sheet takes the wheel, colour picker copy glyph renders (WIP)
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This commit is contained in:
parent
2c7687693f
commit
bfc6e4fae0
6 changed files with 51 additions and 4 deletions
|
|
@ -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.
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -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));
|
||||
|
|
|
|||
11
tests/smoke/colour-picker.txt
Normal file
11
tests/smoke/colour-picker.txt
Normal file
|
|
@ -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
|
||||
22
tests/smoke/customize-scroll.txt
Normal file
22
tests/smoke/customize-scroll.txt
Normal file
|
|
@ -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
|
||||
|
|
@ -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 = [
|
||||
|
|
|
|||
Loading…
Reference in a new issue