Repository navigation
feat(v2): 52px phone top bar and one-column body for feature pages (TASK-730) #3155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
6f64bc0
feat(v2): 52px phone top bar and one-column body for feature pages (T…
lilyshen0722 19f3a4c
fix(v2): phone top bar grows for an open hint; settings bar flush to …
lilyshen0722 e2ee065
test(v2): pin the phone title's one-line clip and the 760px scope (TA…
lilyshen0722 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| import fs from 'fs'; | ||
| import path from 'path'; | ||
|
|
||
| // TASK-730 (D223): the artboard's 390 frame is a 52px top bar over a single | ||
| // column. jsdom has no layout engine, so this pins the presence of the rules | ||
| // that carry it, the same way v2-layout-invariants.test.ts does. | ||
|
|
||
| const css = fs.readFileSync(path.join(__dirname, '../v2.css'), 'utf8'); | ||
| // The block is the tail of the sheet, from its marker comment to the end. | ||
| const phone = css.slice(css.indexOf('D223 (TASK-730 shell)')); | ||
|
|
||
| describe('D223 phone shell', () => { | ||
| test('feature pages get a 52px top bar with the display title', () => { | ||
| expect(phone).toMatch(/\.v2-feature__header\s*\{[^}]*min-height:\s*52px/); | ||
| expect(phone).toMatch(/\.v2-feature__header\s+\.v2-feature__title\s*\{[^}]*font:\s*800 21px\/1 var\(--v2-font-display\)/); | ||
| }); | ||
|
|
||
| test('the title clips to one line, and the whole block stays inside the 760px query', () => { | ||
| const title = phone.match(/\.v2-feature__header\s+\.v2-feature__title\s*\{([^}]*)\}/); | ||
| expect(title).not.toBeNull(); | ||
| expect(title![1]).toContain('white-space: nowrap'); | ||
| expect(title![1]).toContain('overflow: hidden'); | ||
| expect(title![1]).toContain('text-overflow: ellipsis'); | ||
| const mediaAt = phone.indexOf('@media (max-width: 760px)'); | ||
| expect(mediaAt).toBeGreaterThan(-1); | ||
| expect(phone.indexOf('.v2-feature__header {')).toBeGreaterThan(mediaAt); | ||
| expect(phone.indexOf('.v2-feature__header .v2-feature__title')).toBeGreaterThan(mediaAt); | ||
| }); | ||
|
|
||
| test('the page body is one tight column and settings leads with the same bar', () => { | ||
| expect(phone).toMatch(/\.v2-feature__body\s*\{[^}]*padding:\s*12px 12px 16px/); | ||
| expect(phone).toMatch(/\.v2-settings__title\s*\{[^}]*min-height:\s*52px/); | ||
| }); | ||
|
|
||
| test('the block comes last in the sheet, so it outranks the earlier phone rules', () => { | ||
| const at = css.indexOf('D223 (TASK-730 shell)'); | ||
| expect(at).toBeGreaterThan(css.indexOf('.v2-settings__title {')); | ||
| expect(css.indexOf('.v2-feature__body {')).toBeLessThan(at); | ||
| }); | ||
| }); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.