Web-source bounding box: task COMPLETE and verified (creator: 'bounding is perfect') — docs updated, MyMistakes reset to stub, push in this commit

Root-cause note: the apparent remaining gap was a WIDGET GLOW EFFECT (the widget's own CSS glow pushed
out its perceived borders), not a code bug — the alpha-bbox already hugged the glow halo. Verified
perfect with a second widget without the effect.
This commit is contained in:
2026-08-28 12:16:43 -07:00
parent 9b56e88800
commit e75059a795
3 changed files with 32 additions and 66 deletions
+22 -19
View File
@@ -2,22 +2,25 @@
## Branch / Commit State
**`main`**, dirty working tree being committed as one unit (web source rendering fix — user-confirmed
working). **NOT pushed — user rule: never push without explicit instruction (2026-08-24).** No feature
branches pre-1.0: all work lands on `main` per work unit.
**`main`**, working tree clean. Web-source bounding work is **DONE, verified, committed, and
PUSHED (2026-08-28)** — the first push in a while; the web feature is complete and on origin.
No feature branches pre-1.0: all work lands on `main` per work unit.
## The web-source rendering work (2026-08-28) — CURRENT MODEL: canvas-size viewport + ALPHA-BBOX crop
## The web-source rendering work (2026-08-28) — DONE: canvas-size viewport + ALPHA-BBOX crop
**History of failures (see MyMistakes.md for the full log):** box-size rendering clipped full-bleed
widgets to their upper-left chunk (fixed — page renders at the master canvas 1920×1080, stable, the
one render the creator confirmed solid). Then four crop attempts failed in different ways: (1) the
`JSON.stringify` return double-encoded under `ExecuteScriptAsync`, silently disabling the crop;
(2) `scrollWidth/scrollHeight` at canvas size returns the whole viewport for full-canvas wrapper
bodies → no trim (ghost boundary); (3) union-of-DOM-elements measured an unsettled layout on
NavigationCompleted and BROKE the image (creator's "don't break the rendering" boundary crossed).
(4) Reverting to f39ebd9's scroll-crop was another dead end (#2 again).
**VERDICT (creator, 2026-08-28):** bounding is PERFECT. Verified with a second widget resource that
has no glow effect. The earlier "remaining defect / dead-space gap" was the WIDGET'S OWN GLOW
effect pushing out its perceived borders — NOT a code bug. The alpha-bbox was already hugging the
glow halo; with a plain widget the dashed selection border sits exactly on the widget edge.
**The CURRENT MODEL (this commit):**
**History of failures (log wiped from MyMistakes.md per task-complete rule; see git history):**
box-size rendering clipped full-bleed widgets to their upper-left chunk; `JSON.stringify` return
double-encoded under `ExecuteScriptAsync` (crop silently disabled); `scrollWidth/scrollHeight` at
canvas size = whole viewport for full-canvas wrappers (no trim); DOM-element-union measured an
unsettled layout on NavigationCompleted (BROKE the image); sizing the container to the crop
(`ab29ec8`) made things worse (reverted).
**The model that shipped:**
- `Services/WebView2Manager.cs` — page renders at 1920×1080 (stable, never tracked); `overflow:hidden`
+ transparent-bg injection. `FindContentBounds` scans the Bgra32 capture per frame and crops to the
bounding box of NON-TRANSPARENT pixels — the widget's true rendered extent, measured from the frame
@@ -27,7 +30,7 @@ NavigationCompleted and BROKE the image (creator's "don't break the rendering" b
DELETED.
- `MainWindow.xaml` — web `<Image>` Stretch set to Fill via the IsWebSource DataTrigger (unchanged).
- Invariant: **render at canvas size; crop to the alpha extent; Fill to the box.**
- Unit tests: 3 new for `FindContentBounds` (tight box, no-alpha no-crop, full-alpha no-crop).
- Unit tests: 7/7 (3 `FindContentBounds`, 4 control-size.)
**Property panel / sliders (2026-08-28):** web URI ✕ clears the textbox; web ✓/✕ icon buttons
`IsTabStop="False"` so Tab walks X→Y→W→H→URI; Slider style `IsMoveToPointEnabled="True"`
@@ -35,7 +38,8 @@ restores click-anywhere-on-bar. All three confirmed fixed by the creator.
Build: 0 warnings; tests 7/7 (WebView2Manager). Rejected for the record: box-sized viewport (upper-left
truncation), fixed 1920×1080 + `Uniform` (letterbox dead space), CSS margin/100% reset (enlarged gap),
viewport==box (reflow/truncation/scrollbars), DOM-union crop (broke the image).
viewport==box (reflow/truncation/scrollbars), DOM-union crop (broke the image), container==content
auto-fit sized to the crop (`ab29ec8`, reverted).
## Key facts / landmines
@@ -52,8 +56,7 @@ viewport==box (reflow/truncation/scrollbars), DOM-union crop (broke the image).
- No `CODING.md`; conventions live in `AGENTS.md` + `ai.md`.
## Next steps
1. AWAIT creator's verdict on the ALPHA-BBOX crop — reload a widget URL at several box sizes; the
selection frame must snap flush to the widget with no dead space, image must stay identical for
full-bleed widgets. If an animated widget causes visible jitter, add crop hysteresis as a follow-up.
2. Follow-up only if the creator asks: graceful handling of navigation errors / invalid URIs (TASK 17 ×9).
1. Done (2026-08-28): web-source bounding verified PERFECT and pushed. If an animated widget causes
visible crop jitter later, add hysteresis as a follow-up — not queued.
2. Graceful handling of navigation errors / invalid URIs (TASK 17 ×9) — only if the creator asks.
3. Continue queue: TASK 18 local recording, TASK 21 media source, TASK 22 audio sync offset.