Repository navigation
π mobile-shots: phone-ergonomics probe measures pseudo-element hit areas - #17196
clubanderson wants to merge 2 commits into
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Changelog: this PR changes code but carries no changelog entry If it is user-visible β a feature, a fix an operator would notice, a This is a reminder, not a gate; it never blocks a merge. |
Generated by changelog-fragment-guard from the PR title (#5675). Edit the wording freely, or replace this file with the no-changelog label if the change is not user-visible. Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Signed-off-by: clubanderson <407614+clubanderson@users.noreply.github.com>
Open PR overlap checkBase branch:
Conflicts are checked with every PR merged onto the current tip of
|
|
Hive status β updated in place; edits do not notify. Full history is in the Activity Monitor. @clubanderson this PR is held at Why:
Next: the hive does not push to your branch. Push a new head (or reply here); CI and the review swarm re-run automatically and the PR returns to the normal path. hive/awaiting-ci: rebased onto v5 after #17195 landed its narrower π Hive Agent: β hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 Review findings from Style re-review at Previous finding ([intent-alignment] superseded by merged #17195): fixed by the rebase β New (in-scope): the same supersession has recurred with #17199, and the branch is now
Suggested resolution β rebase on v5 and fold the two together, keeping #17199's layout-size base and comment: - // A compact control may extend its hit area with an absolutely positioned
- // empty ::before (the progress pill, #17183): negative insets grow the tap
- // target past the painted box. Positive insets (the ?/β ring drawn inside
- // the --tap-target square) never shrink it. Layout size, not the client
- // rect, so a one-shot transform animation (.ham-pill-moved) cannot fail it.
- const hitRect = el => {
- const r = { width: el.offsetWidth || el.getBoundingClientRect().width, height: el.offsetHeight || el.getBoundingClientRect().height };
- const b = getComputedStyle(el, '::before');
- if (b.position !== 'absolute' || b.content !== '""' || getComputedStyle(el).position === 'static') return r;
- const grow = v => Math.max(0, -(parseFloat(v) || 0));
- return { width: r.width + grow(b.left) + grow(b.right), height: r.height + grow(b.top) + grow(b.bottom) };
- };
+ // A control may extend its hit area past its painted box with an
+ // absolutely positioned ::before/::after that has content and pointer
+ // events (the progress pill's `inset: calc((compact - tap) / 2) 0`):
+ // measure the union, since that is what the thumb hits. Negative insets
+ // grow it; positive insets (the ?/β ring inside the --tap-target square)
+ // never shrink it. Layout size, not the client rect, so a one-shot
+ // transform animation (.ham-pill-moved) cannot fail it (#17199).
+ const px = v => { const n = parseFloat(v); return Number.isFinite(n) ? n : 0; };
+ const grow = v => Math.max(0, -px(v));
+ const hitBox = el => {
+ const base = { width: el.offsetWidth || el.getBoundingClientRect().width, height: el.offsetHeight || el.getBoundingClientRect().height };
+ if (getComputedStyle(el).position === 'static') return base;
+ let { width, height } = base;
+ for (const pseudo of ['::before', '::after']) {
+ const cs = getComputedStyle(el, pseudo);
+ if (cs.content === 'none' || cs.position !== 'absolute' || cs.pointerEvents === 'none') continue;
+ width = Math.max(width, base.width + grow(cs.left) + grow(cs.right));
+ height = Math.max(height, base.height + grow(cs.top) + grow(cs.bottom));
+ }
+ return { width, height };
+ };Minor, non-blocking: Review findings from Intent-alignment (delta re-review at Previous note (probe superseded by merged #17195 on the same lines) β no longer applies as stated: the branch is now rebased onto #17195, and the diff replaces its What no longer matches the diff (low): the body still frames this as fixing a currently failing 390Γ844 gate ("β¦reported Open question, not a blocker: |
There was a problem hiding this comment.
Decision needed: @clubanderson should decide whether to close #17196 as superseded by the merged #17195, or rebase it onto v5 as a follow-up that generalises the hit-area probe (::after, pointer-events:none, union semantics).
This fixes the same failure as #17195, which has already merged into v5 (7b391e16). The branch is now dirty against v5 because both PRs rewrite the same lines of tracker-phone-ergonomics.js:33-45.
What I compared:
- Both diffs replace
el.getBoundingClientRect()in the under-44Γ44 loop with a helper that grows the measured rect by the progress pill's absolutely positioned::beforeinsets. Same trigger (#17183 + #17193 onv5), same failing assertion, same file, same loop. v5today carries #17195'shitRect(tracker-phone-ergonomics.js:36-42):::beforeonly, requirescontent === '""', and computeswidth - left - rightdirectly.- This PR's
hitBoxis a strict superset: it also checks::after, skips pseudo-elements withpointer-events: none, and takes the union of element and pseudo box, so positive insets can never shrink the result (the merged version would shrink the rect if a pseudo had positive insets). It also addschangelog.d/fixed-17196.md, which #17195 skipped withno-changelogβ for awebstatic/testdata/probe-only change theno-changelogroute looks like the repo convention.
So this is not a no-op against v5: merging it would replace hitRect with the more general hitBox. Whether that generality is wanted now, or should wait until a control actually uses ::after / pointer-events: none for its tap target, is the call. If you'd rather keep v5 as-is, this one can be closed; I have not closed anything.
β hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
The progress pill (#17183) keeps a compact painted box and widens its hit area to --tap-target with an absolutely positioned ::before. The tap-target probe only measured the painted box, so the 390Γ844 gate went red once both landed on v5. Measure the union of the element and its absolute ::before/::after instead. Signed-off-by: Andrew Anderson <andy@clubanderson.com>
Generated by changelog-fragment-guard from the PR title (#5675). Edit the wording freely, or replace this file with the no-changelog label if the change is not user-visible. Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Signed-off-by: clubanderson <407614+clubanderson@users.noreply.github.com>
d495684 to
28ceddc
Compare
|
@clubanderson this PR is back in your court (
Once the new head lands, CI and the review swarm re-run automatically and the PR returns to the normal path. Current head: |
There was a problem hiding this comment.
docs-currency (delta re-review, d495684 β 28ceddce)
Everything in the delta except two files is v5 catching up (#17195, #17181, v5.191.1); the PR-specific delta is the hitBox rewrite in src/pkg/dashboard/webstatic/testdata/tracker-phone-ergonomics.js:33-51 and a new changelog fragment. The probe's inline comment matches the CSS it describes (.ham-pill::before β¦ inset: calc((var(--control-compact-min-h) - var(--tap-target)) / 2) 0, static-src/css/tracker.css:954), and the body's "probe-only change" claim matches the diff vs base (two files).
Finding β changelog.d/fixed-17196.md:1 should not exist; label no-changelog instead.
This PR changes only webstatic/testdata/ β a probe operators never see. changelog.d/README.md ("What qualifies") says test-adjacent code like testdata/ wants no fragment and the no-changelog label, and src/scripts/check-changelog-fragment.sh:112 accepts exactly that. #17195, which touched the same file for the same reason, merged with no-changelog. As written the fragment (a) puts a dev-only probe tweak into the operator-facing CHANGELOG.md, (b) forces a patch release bump for a no-op to users, and (c) is the PR title verbatim rather than the narrative "what changed / why an operator cares" the README asks for.
Fix: delete changelog.d/fixed-17196.md and add the no-changelog label to the PR.
--- a/changelog.d/fixed-17196.md
+++ /dev/null
@@ -1 +0,0 @@
-- mobile-shots: phone-ergonomics probe measures pseudo-element hit areas (#17196)Prior intent-alignment note (superseded by #17195 on the same lines): still substantively present β the body's "17 control(s) under 44Γ44 β¦ button.ham-pill 257Γ21" is already fixed on v5 by #17195; what remains here is the incremental ::after / pointer-events: none / union handling. Worth stating that in the body so the record reflects the delta being landed.
β hive: agent=adjudicator-5 backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
Closing: superseded on π Hive Agent: β hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
Part of #17158. Follow-up to #17193.
What
The progress pill from #17183 keeps a compact (~22px) painted box and widens its hit area to
--tap-targetwith an absolutely positioned::before(inset: calc((compact β tap) / 2) 0) β a legitimate coarse-pointer pattern.tracker-phone-ergonomics.jsonly measuredgetBoundingClientRect()of the painted box, so once both PRs were onv5the 390Γ844 gate reported17 control(s) under 44Γ44 β¦ button.ham-pill 257Γ21(light + dark).The probe now measures the union of the element and any absolutely positioned
::before/::afterwith content and pointer events β what the thumb actually hits.Verification
Local run at 390Γ844 with the CI density fixture on current
v5:tracker-phone-ergonomics β ok, controls: 195,tracker-phone-chrome β ok. Probe-only change: no bundle, CSS orsrc/scriptsdiff.