phoneTapTargets: each Spread class owns its margin, ::after declaration set is exact, no phone rule moves position, import must not be aliased
All checks were successful
Build pull request / Build pull request (pull_request) Successful in 4m1s

Soul re-gate of 446306b1: swapped Spread24/26 definitions, display:none or overflow on the ::after, position:static on a
Spread rule and an aliased import all passed; all killed now.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Void 2026-11-13 05:50:10 +00:00
commit 0c8474231e
2 changed files with 22 additions and 5 deletions

View file

@ -141,8 +141,20 @@ describe('phone icon-button hit areas', () => {
.map((l) => l.trim().split(':')[0])
.filter(Boolean)
);
expect(afterDecls).not.toContain('pointer-events');
expect(afterDecls).not.toContain('z-index');
expect([...afterDecls].sort()).toEqual([
'content',
'height',
'left',
'position',
'top',
'transform',
'width',
]);
// nothing on a phone moves a button off its own anchor: only relative (the button) and absolute (the box)
expect([...css.matchAll(/position: (\w+);/g)].map((m) => m[1]).sort()).toEqual([
'absolute',
'relative',
]);
expect(stripPhone(css).trim()).toBe('');
});
@ -152,7 +164,9 @@ describe('phone icon-button hit areas', () => {
rulesFor(css, selector, PHONE).map((d) => d['margin-inline']);
// 32 px composer buttons, 40 px header buttons, 26 px message-option buttons (which also open vertically,
// the menu around them clips a hit area drawn outside its box)
expect(margins(/PhoneHit_spread__/)).toEqual(expect.arrayContaining([10, 9, 6, 2]));
// each class owns its own margin: (44 - drawn size) / 2
const own = (size: number) => margins(new RegExp(`PhoneHit_PhoneHitSpread${size}__`));
expect([own(24), own(26), own(32), own(40)]).toEqual([[10], [9], [6], [2]]);
expect(rulesFor(css, /PhoneHit_PhoneHitRoom26__/, PHONE)).toEqual([{ 'margin-block': 9 }]);
});
@ -229,7 +243,7 @@ describe('icon buttons in the room view', () => {
[...new Set(want)].forEach((name) =>
expect(src).toMatch(
new RegExp(
`import \\{[^}]*\\b${name}\\b(?!\\s+as\\b)[^}]*\\} from '(\\.\\./)+styles/PhoneHit\\.css'`
`import \\{(?:[^}]*,)?\\s*${name}\\s*(?:,[^}]*)?\\} from '(\\.\\./)+styles/PhoneHit\\.css'`
)
)
);

View file

@ -31,7 +31,10 @@ export const PhoneHit = style({
/** An icon button in a row, `visual` px wide: the row opens up so its 44 px hit area meets its neighbours'. */
const spread = (visual: number) =>
style([PhoneHit, { '@media': { [PHONE]: { marginInline: (PHONE_TAP - visual) / 2 } } }]);
style(
[PhoneHit, { '@media': { [PHONE]: { marginInline: (PHONE_TAP - visual) / 2 } } }],
`PhoneHitSpread${visual}`
);
export const PhoneHitSpread24 = spread(24);
export const PhoneHitSpread26 = spread(26);