Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions tests/journey.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ def lean_open(page: Page) -> bool:

GRAPH_FIRST = """
try {
if (!localStorage.getItem('proof-reader-pane-3'))
localStorage.setItem('proof-reader-pane-3', JSON.stringify({graph: true, lean: false, share: 0, sideShare: 0}));
if (!localStorage.getItem('proof-reader-pane-4'))
localStorage.setItem('proof-reader-pane-4', JSON.stringify({graph: true, lean: false, share: 0, sideShare: 0}));
} catch { /* a frame with no storage, such as the PDF's: nothing to set there */ }
"""

Expand Down Expand Up @@ -151,7 +151,7 @@ def reopen_proof(page: Page, url: str) -> None:
print("Reopening the proof pane")
page.goto(f"{url}#/{SLUG}", wait_until="load")
page.locator(".proof").wait_for()
page.evaluate("""localStorage.setItem('proof-reader-pane-3', JSON.stringify({
page.evaluate("""localStorage.setItem('proof-reader-pane-4', JSON.stringify({
graph: false, lean: false, share: 0.3, sideShare: 0.4
}))""")
for slug in ("pcp-exposition", "pcp-specialist", "pcp-full-argument", "pcp-reading-guide", SLUG):
Expand All @@ -171,7 +171,7 @@ def reopen_proof(page: Page, url: str) -> None:
page.locator(".proof").wait_for()
check(True, "reloading opens the proof pane again")
check(page.evaluate("""() => {
const layout = JSON.parse(localStorage.getItem('proof-reader-pane-3'));
const layout = JSON.parse(localStorage.getItem('proof-reader-pane-4'));
return layout.share === 0.3 && layout.sideShare === 0.4 && layout.lean === false
&& !Object.hasOwn(layout, 'graph');
}"""), "mode and split sizes persist without a saved closed pane")
Expand Down
4 changes: 2 additions & 2 deletions web/src/proof/ProofPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import { ModeToggle, type PaneMode } from "./ModeToggle";
import { memo, useEffect, useLayoutEffect, useRef, useState, type ReactNode } from "react";

// The key changes when the opening layout does, so a layout saved under the old one does not hide the new.
const KEY = "proof-reader-pane-3";
const KEY = "proof-reader-pane-4";
/** Narrower than this, the graph sits above the Lean; from here they stand side by side. */
const SIDE_BY_SIDE = 1040;
/** What the graph has before the reader pulls the handle: the statement's place in the proof, above or beside its Lean. */
const OPENING = { share: 0.6, sideShare: 0.46 };
const OPENING = { share: 0.5, sideShare: 0.5 };
const MAX = 0.78;
/** A pull shorter than this leaves the Lean the whole page. */
const SHUT = 0.08;
Expand Down