Skip to content

feat(sheet): a class drags down to its key facts, not the shared open stop - #496

Merged
Ardnived merged 10 commits into
mainfrom
feat/class-sheet-fits-content
Nov 26, 2026
Merged

Ardnived merged 10 commits into
mainfrom
feat/class-sheet-fits-content

Conversation

@Ardnived

@Ardnived Ardnived commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • On a phone, one drag down from an open class now stops at its key facts. Before, it went to the shared 356px stop, where the sticky footer cut the tags and time.
  • A class's ladder is peek → key facts → fit, so a short class has no blank band above its last row.

Change outline

Flow — the stop a phone sheet shows, and what the camera reserves

DrawerStack used to compare snap against stops inline. It now asks one resolver for the stop vaul shows, and the camera's cover reads that same stop.

 DrawerStack                                         src/views/DrawerStack/DrawerStack.tsx
   useFitSnap(enabled, path)                         src/views/DrawerStack/use-fit-snap.ts
-    → fit
+    → { fit, fold }                                 # one measure pass
+      fold = foldHeight(bottom of [data-sheet-fold] + 12px gap + footer)
+             clamped to [SHEET_OPEN_PX, 66% of frame]
+             under a 540px frame the share is already lower, and wins
+  fold = class ? heldFoldPx(snap) ?? measured fold : null   # a stop dragged to is held, never moved
+  sheetLadder({ classView, fit, fold })             src/views/DrawerStack/sheet-ladder.ts
+    class:  peek → fold → fit      (near full only when fit is 'full')
+            short class: peek → open
+    other:  unchanged (peek → open → [fit] → near full)
-  vaulSnap = snap === FIT_SNAP ? fit stop : snap
+  vaulSnap = resolveStop(ladder, snap)
+    FIT_SNAP → the fit rung
+    a stop the ladder dropped → near full ? top rung : rung above the peek
+  shownSnapPoints = capPoints(ladder.points, snapCap)   # the short-window cap, deduped
-  sheetCover = snap === FIT_SNAP ? fitPx : SHEET_OPEN_PX
+  sheetCover = vaulSnap px, else fold ?? SHEET_OPEN_PX  # near full frames for the fold
   snap reset effect, keyed on view kind
+    + the class path, so class B opens at its own fit after A was dragged

Files — where the ladder lives

 src/views/DrawerStack/
+├── sheet-ladder.ts      # PEEK/OPEN/FIT_SNAP, SNAP_POINTS, sheetLadder, resolveStop, capPoints, heldFoldPx (pure)
 ├── use-fit-snap.ts      # + foldHeight (pure), measures fit and fold together
 └── DrawerStack.tsx      # wires them; no inline ladder, stop or cap logic
 src/components/molecules/EventFacts/EventFacts.tsx   # default variant carries data-sheet-fold
 CHANGELOG.md                                        # Unreleased entry, and #369's corrected

Preview

Preview pending: no Cloudflare branch alias exists yet. Once it does, open these at phone size (375×667 or 390×844):

  • Balham class: /gb/south-east/london/balham-library/1392. Drag down once: the room and street sit above Register, and the pin shows above the sheet.
  • Dublin online class: /ie/dublin/1355. It opens at its content height, and dragging up leaves no blank band.

Test results

  • Lean gate: ✓ (lint, typecheck, test:run)
  • Targeted specs: 43 passed in src/views/DrawerStack/, plus EventFacts.test.tsx and attribution.test.ts
  • Build: N/A locally; CI runs it

Manual verification

  1. Run pnpm dev, open the Balham class at 375×667, and drag down once. Title, tags, time and full address sit above the footer, and the pin shows. Drag again to reach the peek.
  2. Do the same at 390×844. Then open the Dublin class: no blank band below its last row.
  3. Open /gb/south-east/london, tap a class, press Back. The list returns at 356px.
  4. At 1280×800 the side panel is unchanged.
  5. On a real iPhone (pnpm dev --host), run the Balham checks with the home indicator below the footer.

Notes for reviewer

  • Ticket vs main. The ticket says the peek shows the title. Main's peek is 104px and blank for a class, both before and after this change, and the ticket assigns that to the navigation proposal. Other parts of the ticket (opening at the fit, camera cover via useSheetCover) had already landed in fix(ui): iPhone panel, pin tap and phone framing fixes from the 6 Nov bug sweep #369. This PR adds only the key-facts stop and the class ladder.
  • Fixed review findings. The sheet and the camera could disagree during a load, a held stop could drop off the ladder, and the hook made a duplicate reset. All are fixed by resolveStop and by reading the cover off vaulSnap.
  • Dismissed review findings:
    • A second marked EventFacts in the class body. EventDetails renders exactly one; list cards use compact, Share and Registration use card, and neither is marked.
    • A marker leaking into Registration and Share. Same reason: card is unmarked, now pinned by a spec.
    • A jsx-sort-props detach. The comment sits outside the opening element.
    • A one-frame jump on body change. The reset and the new measure are set in the same synchronous callback, so React batches them.
  • Second review round (6 findings, all built). The fold clamp's winning bound is now stated and
    pinned at a 375px frame; SheetMeasure and UNMEASURED are gone, two primitive states letting
    React bail out on an unchanged measure; SHORT_CLASS and sheetCoverPx are inlined at their one
    use each; the short-window cap moved into sheet-ladder.ts as capPoints, with the class ladder
    under the cap now covered; and CHANGELOG.md carries the host-facing entry. One part of the
    first finding did not land: the floor is not dead code — foldHeight returns the open stop for a
    120px fold on an 844px frame, and a spec has pinned that since the first push.
  • Skipped /simplify suggestions:
    • A FOLD_SNAP token. A token would move a sheet the visitor dragged.
    • A shared constant for data-sheet-fold. It has one writer and one reader, like data-sheet-fit, and is pinned by a spec.
    • BootFallback reusing OPEN_SNAP. That is outside this diff.
Detail
  • The ticket's prototype ported useSheetFit, snappedFor and useClassSheet. Main already has useFitSnap and useSheetCover, so this PR builds on those.
  • The fold is not frozen at its first measurement. That fired before the footer published its height (it measured 293px, clamped to 356). Instead, the fold follows its measurement, and a sheet the visitor dragged onto it holds that px stop.
  • Chips are not marked: the facts row always sits below them, so it sets the fold alone.
  • attribution.test.ts now reads SNAP_POINTS from sheet-ladder.ts. sheet-ladder.test.ts adds a behavioural check that every ladder bottoms out at the peek.
  • Measured at 375×667: open 647px, key facts 440px (the 66% cap), peek 104px. At 390×844: key facts 418px.
  • A Cannot update a component while rendering console error from DrawerStack/ReadClient also appears on unmodified main.

🤖 Generated with Claude Code

Ardnived and others added 3 commits November 25, 2026 18:21
… stop

On a phone, one drag down from an open class landed on the shared 356px stop,
where the sticky footer cut the chips and the time line. The class now has its
own ladder: peek, a measured key-facts stop (chips and when/where above the
footer, capped at two thirds of the frame), then its fit. Only a class too long
to fit keeps the near-full stop, so a short class has no blank band above it.

A sheet dragged to the key-facts stop holds that px however the fold
remeasures, the camera frames for it, and class B tapped after class A opens
at B's own fit.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
One resolver (`resolveStop`) now names the stop vaul shows for any snap, and
the camera's cover reads that same stop, so the two can no longer disagree.
A stop the ladder dropped resolves to a named rung. The hook measures fit and
fold in one pass. Only the facts row carries the key-facts marker, pinned by
a spec.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ear full

Leaving a class held at its key facts for a list resolved the stale px stop to
the list's top rung for the one render before the reset effect ran, so the
sheet could jump to near full and back. Only a near-full stop now resolves to
the top.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@sydevs-dispatcher

sydevs-dispatcher Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

🤖 no session running
conflict held since 16:45Z, waiting for the base to settle

recent dispatches
  • 02:04Z address-review · attempt 1 · session · done
  • 02:04Z address-review · attempt 1 · session
  • 01:51Z review-pr · attempt 1 · session · done
  • 01:51Z review-pr · attempt 1 · session

Written by the sydevs dispatcher. Sessions never edit this comment.

@sydevs-dispatcher sydevs-dispatcher Bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 26, 2026
@sydevs-dispatcher sydevs-dispatcher Bot moved this from Pending to Working in SYDevelopers Technical Roadmap Nov 26, 2026

@sydevs-bot sydevs-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧐 Adversarial review

This PR is the size of its problem. A phone's drag down had no stop between the content height and the shared 356px, where the footer cut the facts; the fix is one pure module, one data attribute, and a second number from a measure pass the hook already made. Nothing is smuggled in, and the inline ladder it replaces was right to lift out.

No ticket is linked, so I judged it against its own body. Every claim in the outline matches the code except the fold's clamp, and the dismissals hold. Two things are missing rather than too much: the host-facing CHANGELOG, where #369's entry now states the opposite of this behaviour, and a test for the cap, the only other transform of this ladder. No contract surface is touched.

Findings

  • should-fix — use-fit-snap.ts:66 foldHeight's floor is dead under a 540px frame; its JSDoc and its spec claim otherwise
  • should-fix — DrawerStack.tsx:272 no CHANGELOG entry, and #369's is now false
  • should-fix — use-fit-snap.ts:69 Streamline: SheetMeasure and UNMEASURED hand-roll React's bail-out
  • consider — sheet-ladder.ts:19 Streamline: SHORT_CLASS has one use
  • consider — sheet-ladder.ts:105 Streamline: sheetCoverPx is one expression, one caller
  • consider — sheet-ladder.ts:93 the cap belongs beside the ladder it transforms

What was checked

Read whole on the branch: DrawerStack.tsx (738 lines), use-fit-snap.ts, sheet-ladder.ts, EventFacts.tsx, config/responsive.ts, the specs. Consumers followed: useSheetCover, BootFallback's capStop, attribution.test.ts against the moved SNAP_POINTS, and every <EventFacts> call site — one row carries the marker, as claimed.

Streamliner: 18 pieces covered, 13 kept, 4 raised, 1 dropped — merging the two class returns loses the SNAP_POINTS identity a spec pins. The diff adds no dependency.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

Comment thread src/views/DrawerStack/use-fit-snap.ts Resolved
Comment thread src/views/DrawerStack/DrawerStack.tsx Resolved
Comment thread src/views/DrawerStack/use-fit-snap.ts Resolved
Comment thread src/views/DrawerStack/sheet-ladder.ts Resolved
Comment thread src/views/DrawerStack/sheet-ladder.ts Resolved
Comment thread src/views/DrawerStack/sheet-ladder.ts Resolved
@sydevs-bot sydevs-bot removed the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 26, 2026
@sydevs-dispatcher sydevs-dispatcher Bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 26, 2026
Under a 540px frame the two-thirds share is already below the shared open
stop, so the clamp's upper bound wins and a landscape phone's key-facts
stop lands at 247px. That is the right answer there — the sheet has no
third of a map to spare, and `shortSheetCap` holds every stop lower still
— but nothing said so and no case covered it. The floor is live and stays:
`foldHeight` returns the open stop for a 120px fold on an 844px frame.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjW4DxAYgANiCBvJZpZ
`SheetMeasure` was exported and imported nowhere, and holding the measure
as one object meant `UNMEASURED` plus a manual field compare to stop a
re-render React already stops for itself. Two primitive states do that,
and the shape the hook returns is unchanged.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjW4DxAYgANiCBvJZpZ
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
sahajatlas-design a5654dd Nov 26 2026, 04:51 PM

`SHORT_CLASS` was a module const with one use, so its comment sat two
screens from the branch it explains.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjW4DxAYgANiCBvJZpZ
`sheetCoverPx` was one expression with one caller, and its export carried
a describe block of its own. The why stays, above the line in DrawerStack
that resolves the cover.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjW4DxAYgANiCBvJZpZ
The short-window cap was the one transform of this ladder left in
DrawerStack, and so the one with no test. `capPoints` puts it in
`sheet-ladder.ts`, which drops the inline `new Set` dedupe and covers what
the cap does to a class: a 375px-tall frame whose key facts and fit both
sit above its 300px cap climbs peek then cap, and one whose key facts fit
under it keeps all three stops.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjW4DxAYgANiCBvJZpZ
CHANGELOG.md is the host-facing twin of this change and still described
the old sheet: #369's entry said one drag down stops at the usual
third-height, which this PR replaces. Adds the Unreleased entry and puts
#369's sentence in the past.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjW4DxAYgANiCBvJZpZ
@sydevs-bot

Copy link
Copy Markdown
Contributor

Six critic threads, six commits, pushed to claude/relay-496-eec3cc9.

Lean gate green.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

@sydevs-bot sydevs-bot removed the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 26, 2026
@sydevs-dispatcher sydevs-dispatcher Bot moved this from Working to Pending in SYDevelopers Technical Roadmap Nov 26, 2026

@sydevs-dispatcher sydevs-dispatcher Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved for Ardnived, who wrote it: GitHub refuses an author's own approval. CI is green and the automated review has run. Enable auto-merge when you want it merged: the queue tests it against its base. 🤖 Written by the sydevs autonomous loop — see what this is

@sydevs-dispatcher sydevs-dispatcher Bot moved this from Pending to Awaiting in SYDevelopers Technical Roadmap Nov 26, 2026
@sydevs-dispatcher sydevs-dispatcher Bot moved this from Awaiting to Pending in SYDevelopers Technical Roadmap Nov 26, 2026
…-content

# Conflicts:
#	CHANGELOG.md
#	src/components/molecules/EventFacts/EventFacts.test.tsx
@sydevs-dispatcher sydevs-dispatcher Bot moved this from Pending to Awaiting in SYDevelopers Technical Roadmap Nov 26, 2026
@Ardnived
Ardnived enabled auto-merge November 26, 2026 16:49
@Ardnived
Ardnived added this pull request to the merge queue Nov 26, 2026
Merged via the queue into main with commit ad3f517 Nov 26, 2026
14 checks passed
@Ardnived
Ardnived deleted the feat/class-sheet-fits-content branch November 26, 2026 16:56
@sydevs-dispatcher sydevs-dispatcher Bot moved this from Awaiting to Done in SYDevelopers Technical Roadmap Nov 26, 2026
Ardnived added a commit that referenced this pull request Nov 26, 2026
Four more PRs: #496 (a class drags down to its key facts), #498 (the class
address ends with its postcode and copies on tap), and the contract
re-syncs #497 and #499.

- `CHANGELOG.md`: #496's and #498's entries above #490's, which keeps this
  branch's wording.
- `translations.en.json`: taken from production again with
  `pnpm sync:translations --write`. Since the last sync SahajCloud#1278
  dropped `common.errors.captcha_blocked`, and #498's `common.chrome.copied`
  replaced `share.copied`. `RETIRING_KEYS` loses its last entry, the key
  production no longer serves. `pnpm types:cms` wrote no change.

#496's ladder changes write only where the sheet can collapse, so the
inline column is untouched by them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

3 participants