-
Notifications
You must be signed in to change notification settings - Fork 0
fix(privacy): keep the back control clear of the notch on phones #1621
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
14 commits
Select commit
Hold shift + click to select a range
fec8ae1
fix(privacy): keep the back control clear of the notch on phones
claude ee70f4c
Merge branch 'main' into claude/privacy-notch-safe-area
BigSimmo 3eb8f16
Merge branch 'main' into claude/privacy-notch-safe-area
BigSimmo b642a88
Merge branch 'main' into claude/privacy-notch-safe-area
cursoragent fa6d627
fix(ui): share standalone shell with safe-area top pad
cursoragent efc2955
Merge branch 'main' into claude/privacy-notch-safe-area
cursoragent 23a4b8f
docs(ledger): record PR #1621 babysit closeout
cursoragent 5c8b586
Merge branch 'main' into claude/privacy-notch-safe-area
cursoragent 190184c
Merge remote-tracking branch 'origin/main' into claude/privacy-notch-…
cursoragent dba8c9f
Merge branch 'main' into claude/privacy-notch-safe-area
cursoragent a3967f8
chore(ledger): supersede unresolvable PR #1621 review HEAD
cursoragent fe352ad
chore(ledger): point PR #1621 babysit supersede at pushed tip
cursoragent f9a72c3
chore(ledger): refresh PR #1621 Run PR sweep tip
cursoragent e98e064
Merge branch 'main' into claude/privacy-notch-safe-area
BigSimmo 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
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
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
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
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,62 @@ | ||
| import { readFileSync } from "node:fs"; | ||
| import { createElement } from "react"; | ||
| import { renderToStaticMarkup } from "react-dom/server"; | ||
| import { describe, expect, it, vi } from "vitest"; | ||
|
|
||
| import PrivacyPage from "@/app/privacy/page"; | ||
| import ColourCodingReferencePage from "@/app/reference/colour-coding/page"; | ||
| import { searchPageShell, searchPageShellStandalone } from "@/components/ui-primitives"; | ||
|
|
||
| vi.mock("next/navigation", () => ({ | ||
| useSearchParams: () => new URLSearchParams(), | ||
| useRouter: () => ({ | ||
| back: vi.fn(), | ||
| push: vi.fn(), | ||
| }), | ||
| })); | ||
|
|
||
| const read = (relativePath: string) => readFileSync(new URL(`../${relativePath}`, import.meta.url), "utf8"); | ||
|
|
||
| const STANDALONE_PAGES = ["src/app/privacy/page.tsx", "src/app/reference/colour-coding/page.tsx"] as const; | ||
|
|
||
| describe("searchPageShellStandalone contract", () => { | ||
| it("owns the OS top inset without axis py-* that would fight side-specific pt-*", () => { | ||
| expect(searchPageShellStandalone).toContain("pt-[max(0.75rem,var(--safe-area-top))]"); | ||
| expect(searchPageShellStandalone).toContain("sm:pt-[max(1.25rem,var(--safe-area-top))]"); | ||
| expect(searchPageShellStandalone).toContain("pb-4"); | ||
| expect(searchPageShellStandalone).toContain("sm:pb-8"); | ||
| // Axis padding would reintroduce the Tailwind sort-order dependency that | ||
| // made per-page pt-* overrides fragile when cn() does not de-dupe utilities. | ||
| expect(searchPageShellStandalone).not.toMatch(/(?:^|\s)py-\S+/); | ||
| expect(searchPageShellStandalone).not.toMatch(/(?:^|\s)sm:py-\S+/); | ||
| // Shell pages keep the ordinary py rhythm; standalone is the only owner of | ||
| // max(safe-area-top) so future routes do not re-derive the values. | ||
| expect(searchPageShell).toMatch(/(?:^|\s)py-3(?:\s|$)/); | ||
| expect(searchPageShell).not.toContain("var(--safe-area-top)"); | ||
| }); | ||
|
|
||
| it("is the shell used by every production standalone search-page route", () => { | ||
| for (const relativePath of STANDALONE_PAGES) { | ||
| const source = read(relativePath); | ||
| expect(source, relativePath).toContain("searchPageShellStandalone"); | ||
| expect(source, relativePath).not.toMatch(/\bsearchPageShell\b(?!Standalone)/); | ||
| } | ||
| }); | ||
|
|
||
| it("renders the safe-area top pad and tap-token back row on /privacy", () => { | ||
| const markup = renderToStaticMarkup(createElement(PrivacyPage)); | ||
| expect(markup).toContain(searchPageShellStandalone); | ||
| expect(markup).toContain("pt-[max(0.75rem,var(--safe-area-top))]"); | ||
| expect(markup).toContain("sm:pt-[max(1.25rem,var(--safe-area-top))]"); | ||
| expect(markup).toContain("min-h-tap"); | ||
| expect(markup).not.toContain("min-h-12"); | ||
| }); | ||
|
|
||
| it("renders the same safe-area pad and tap-token back row on /reference/colour-coding", () => { | ||
| const markup = renderToStaticMarkup(createElement(ColourCodingReferencePage)); | ||
| expect(markup).toContain(searchPageShellStandalone); | ||
| expect(markup).toContain("pt-[max(0.75rem,var(--safe-area-top))]"); | ||
| expect(markup).toContain("sm:pt-[max(1.25rem,var(--safe-area-top))]"); | ||
| expect(markup).toContain("min-h-tap"); | ||
| }); | ||
| }); |
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.