mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-09-30 12:39:42 +02:00
test(mobile): follow the 600px phone cut on the Duo branch
Rebased over #390, which moved the phone tier's cutoff from 430px to 600px. The palette's compound fold rule now lives in the 600-768px band mobile.css pads, the cascade samples the palette inside that band, and the closed iPhone Duo (466pt) is a phone rather than a small tablet while the open one (626pt) stays a tablet. Comments in both stylesheets, the device registry, CLAUDE.md and architecture-invariants say 600. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
@@ -22,8 +22,8 @@
|
||||
* 3. The gutter an overlay ends up with is a CASCADE across two files and
|
||||
* several breakpoints, not one rule: a later @media block can zero it (the
|
||||
* phone path picker under 600px), mobile.css can replace it with a
|
||||
* shorthand (the palette between 430 and 768px) and, loading later, can
|
||||
* outrank a same-specificity rule (the response viewer under 430px). So the
|
||||
* shorthand (the palette between 600 and 768px) and, loading later, can
|
||||
* outrank a same-specificity rule (the response viewer under 600px). So the
|
||||
* cascade is simulated at every breakpoint, once with the fold rules and
|
||||
* once without, and the two results must differ by exactly the fold strip.
|
||||
* Each of the three shipped once with the top-level-only comparison green.
|
||||
@@ -325,15 +325,15 @@ describe('fold reserved region: every centred overlay is covered', () => {
|
||||
// Chromium (styles.css + mobile.css in index.html link order): the phone
|
||||
// path picker is flush under 600px and keeps its 16px gutter above it;
|
||||
// the palette carries mobile.css's 0.75rem side gutter only inside the
|
||||
// 430-768px band. A model that cannot reproduce these numbers proves
|
||||
// 600-768px band. A model that cannot reproduce these numbers proves
|
||||
// nothing about the fold rules built on top of them.
|
||||
const picker = ['path-picker-overlay'];
|
||||
expect(cascadedPadding(picker, 'right', 393, false)).toBe('0');
|
||||
expect(cascadedPadding(picker, 'right', 626, false)).toBe('16px');
|
||||
const palette = ELEMENTS.at(-1)!.classes;
|
||||
expect(cascadedPadding(palette, 'right', 393, false)).toBeNull();
|
||||
expect(cascadedPadding(palette, 'right', 500, false)).toBe('0.75rem');
|
||||
expect(cascadedPadding(palette, 'bottom', 500, false)).toBe('0');
|
||||
expect(cascadedPadding(palette, 'right', 626, false)).toBe('0.75rem');
|
||||
expect(cascadedPadding(palette, 'bottom', 626, false)).toBe('0');
|
||||
expect(cascadedPadding(palette, 'right', 900, false)).toBeNull();
|
||||
});
|
||||
|
||||
@@ -353,7 +353,7 @@ describe('fold reserved region: every centred overlay is covered', () => {
|
||||
|
||||
it('composes with the padding shorthand mobile.css gives the command palette, inside that band only', () => {
|
||||
// mobile.css loads after styles.css and sets a `padding` SHORTHAND on
|
||||
// .command-palette-modal between 430 and 768px, exactly where a folding
|
||||
// .command-palette-modal between 600 and 768px, exactly where a folding
|
||||
// phone lives, so a bare .command-palette-modal rule would lose to it and
|
||||
// the compound rule has to restate BOTH of that band's gutters. Scoped to
|
||||
// the same band: unscoped, it added 0.75rem where the palette has no side
|
||||
@@ -374,7 +374,7 @@ describe('fold reserved region: every centred overlay is covered', () => {
|
||||
|
||||
it('gives the response viewer cap a later twin in mobile.css', () => {
|
||||
// mobile.css sets `max-height` on .response-viewer at the same specificity
|
||||
// under 430px and loads later, so the styles.css cap alone loses on a
|
||||
// under 600px and loads later, so the styles.css cap alone loses on a
|
||||
// phone-width foldable. The twin must come after that rule and carry the
|
||||
// identical value.
|
||||
const capOf = (root: postcss.Root) =>
|
||||
@@ -441,11 +441,12 @@ describe('a fold never changes which settings the device is using', () => {
|
||||
expect(detectionFor(postures[2].ua, postures[2].w).getDeviceType()).toBe('mobile');
|
||||
});
|
||||
|
||||
it('gives both iPhone Duo displays the tablet layout', () => {
|
||||
// 466 and 626 both sit above the 430px phone cut and below 768. Deliberate
|
||||
// (see shouldUseMobileOverview), and pinned because a 5.4" phone landing in
|
||||
// the tablet band is the kind of thing that looks like a bug later.
|
||||
expect(detectionFor(postures[0].ua, postures[0].w).getDeviceType()).toBe('tablet');
|
||||
it('gives the closed iPhone Duo the phone layout and the open one the tablet layout', () => {
|
||||
// 466 sits under the 600px phone cut (#390 moved it up from 430) and 626
|
||||
// above it, below 768. Deliberate (see shouldUseMobileOverview), and pinned
|
||||
// because the tier flipping under a fold is the kind of thing that looks
|
||||
// like a bug later: closed, the Duo is a phone; open, it is a small tablet.
|
||||
expect(detectionFor(postures[0].ua, postures[0].w).getDeviceType()).toBe('mobile');
|
||||
expect(detectionFor(postures[1].ua, postures[1].w).getDeviceType()).toBe('tablet');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -292,11 +292,11 @@ const customEntries: DeviceEntry[] = [
|
||||
// in both axes. The registry's other foldable (Find N5) uses the full
|
||||
// viewport for the same reason.
|
||||
//
|
||||
// The PAIR is what earns its place here. Both postures land in the tablet
|
||||
// band (466 and 626 are each above the 430px phone cut and below 768), so a
|
||||
// 5.4" phone in someone's hand gets the roomier layout. Deliberate, per the
|
||||
// note on shouldUseMobileOverview(), and worth a profile precisely because it
|
||||
// is easy to regress into a phone-width assumption. What must NOT move with
|
||||
// The PAIR is what earns its place here. The postures straddle the 600px
|
||||
// phone cut (#390): closed, 466 is a phone; open, 626 is a small tablet, so
|
||||
// the layout tier flips with the fold. Deliberate, per the note on
|
||||
// shouldUseMobileOverview(), and worth a profile precisely because it is
|
||||
// easy to regress into a single-width assumption. What must NOT move with
|
||||
// the fold is the per-device settings identity, which is UA-based and
|
||||
// therefore identical across the two; test/mobile/settings.test.ts pins it.
|
||||
custom('iPhone Duo (outer)', 466, 678, 3, IOS_MOBILE_UA('26_0'), true),
|
||||
|
||||
Reference in New Issue
Block a user