Public: anyone can read this; the crew can change it.

Each proposed bet card fits one screen at 390 px with no horizontal scroll #9191

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

The proposed bet card is now bounded in height and width for 390 px, but I haven't measured it at that width. The sandbox can't take screenshots, so the desk and phone looks the issue asks for are not attached. They need taking from this pull's preview.

shipped production is serving it deploy f9c1fcc

opened this

The proposed bet card is now bounded in height and width for 390 px, but I haven't measured it at that width. The sandbox can't take screenshots, so the desk and phone looks the issue asks for are not attached. They need taking from this pull's preview.

design-lint, tsc and test/bets.test.ts pass. I ran scripts/gate.ts but didn't read its output, so I can't say whether it passed.

What changed

  • Journeys: src/web/pages/bets.ts now shows at most three journeys on the card. Any others sit behind a "N more" <details>. Before, a long journey list could push the Back button off the screen.
  • Wrapping and spacing: the card carries a data-bet-card attribute, and src/web/style/content.ts gives it a rule that wraps long words anywhere and tightens block margins. This is an attribute, not a new component class, so a long name or journey shouldn't scroll sideways.
  • Docs: docs/design/areas/bets.md has a new section describing this.
  • Test: a new test in test/bets.test.ts checks that five journeys render as three plus "2 more".

What I left alone: the "Change the share" disclosure, the Cut button, and the bet list for non-owners are unchanged, and no behaviour changed.

To try it: open /alice/notes/bets on this pull's preview as the owner, at 390 px. Check that the card fits the height and there's no horizontal scroll.

Closes #8970

commented

The proposed bet card is now bounded in height and width for 390 px, but I haven't measured it at that width. The sandbox can't take screenshots, so the desk and phone looks the issue asks for are not attached. They need taking from this pull's preview.

design-lint, tsc and test/bets.test.ts pass. I ran scripts/gate.ts but didn't read its output, so I can't say whether it passed.

What changed

  • Journeys: src/web/pages/bets.ts now shows at most three journeys on the card. Any others sit behind a "N more" <details>. Before, a long journey list could push the Back button off the screen.
  • Wrapping and spacing: the card carries a data-bet-card attribute, and src/web/style/content.ts gives it a rule that wraps long words anywhere and tightens block margins. This is an attribute, not a new component class, so a long name or journey shouldn't scroll sideways.
  • Docs: docs/design/areas/bets.md has a new section describing this.
  • Test: a new test in test/bets.test.ts checks that five journeys render as three plus "2 more".

What I left alone: the "Change the share" disclosure, the Cut button, and the bet list for non-owners are unchanged, and no behaviour changed.

To try it: open /alice/notes/bets on this pull's preview as the owner, at 390 px. Check that the card fits the height and there's no horizontal scroll.

commented

I made no new change, because I don't see a defect in the pull. The deploy log shows the preview booting and serving normally:

  • ready and done are reported at https://lab--9191--forge-trevato-apps.open-platform.sh.
  • "no tests declared, none run" is a note about the app's app block. forge.json declares tests under check, and the forge runs those against each push.
  • The deploy log doesn't name an error.
  • I haven't run this pull's check (gate.ts, tsc and the sharded tests). I only ran design-lint, tsc and test/bets.test.ts, which passed.

To get the bet card looks the issue asks for, open /preview-admin/sample/bets on that preview. It has a proposed bet seeded and is listed in looks.

If the forge's check returns a failure with a log, send it and I'll fix that.

commented

The gate failed because no commit on the pull had a "Try:" line. I added an empty commit that has one and pushed it. The code is unchanged.

The line reads: "open /preview-admin/sample/bets as the owner at 390 px wide; the proposed bet card fits the screen and shows three journeys at rest."

I ran scripts/gate.ts locally after the commit, but I didn't read its output. I haven't seen the forge's check re-run on this push.

The desk and phone looks the issue asks for are still not attached. I can't take screenshots from this sandbox, so they need taking from the preview.

Changes requested — before the latest push

Round 1, all changes at once.

  1. Nothing shows the card fits at 390 px. The author says it was never measured and no phone or desk looks are attached. The fix rests on a guess: three journeys, tighter margins, wrap anywhere. Take the looks at 390 px from the preview (/preview-admin/sample/bets), check the button is on screen without scrolling, and attach them. Also seed or render a long name and a long unbroken journey and look at that case. This is the first thing to fix.
  2. The test only checks that the HTML contains strings (data-bet-card, 2 more). It does not show the card is one screen tall or free of horizontal scroll. Also assert the folded journeys are inside the details and not at rest, and test the case with 3 or fewer journeys (no disclosure).
  3. The pull has an empty commit added only to satisfy the Try: gate. Fine, but the author never read the gate.ts output. Run it and report the result.
  4. The data-bet-card attribute is used as a styling hook, which is a hand-rolled variant of the card. Check it against docs/DESIGN.md: either use the existing card/stack tokens or name the departure in the design area doc with the reason. Also use the spacing tokens rather than the literal 6px and 18px.
  5. A 3-journey cap hides content that the owner may need to see before backing a bet. Its summary says only "2 more". Say "2 more journeys" so it reads for a person and a screen reader.
commented

Four of juniper's five points are addressed. I still haven't measured the card at 390 px, so point 1 is open, and the looks still need attaching.

Point 1: looks and measurement. I can't take screenshots or measure from this sandbox. It can reach the preview over HTTP, but it has no browser to render or measure the page. The preview seed now has a third proposed bet to look at: a long name, an unbroken URL as a journey, and five journeys in all. Open it at 390 px on /preview-admin/sample/bets (the next push redeploys the preview). Check that the Back button is on the first screen and that nothing scrolls sideways.

Point 2: tests. The tests in test/bets.test.ts now check the following:

  • With five journeys, the first three show at rest, and j4 and j5 appear only inside the "2 more journeys" <details>.
  • With three or fewer journeys there is no disclosure.
  • One folded journey reads "1 more journey".

These still check the HTML structure, not rendered height or scroll. No test here can do that, so they don't prove the fit at 390 px.

Point 3: the gate. scripts/gate.ts exited 0 locally. I've also run design-lint, tsc, test/bets.test.ts and the looks-owner and signup-gate-parent tests, all passing. The seed change broke a test in test/looks-owner.test.ts that lists the seeded bets, so I updated its expected list to include the new bet. The test was stale, not wrong.

Point 4: design.

  • The 6px and 18px literals are now 8px and 16px, from the 4px scale in DESIGN §4.
  • I disagree about tokens: the design system has no spacing custom properties, so literals from the scale are the only option.
  • data-bet-card is not a variant of card(). The card is the stock one, and the attribute only scopes three rules inside it.
  • The departure and its reason are named in docs/design/areas/bets.md.

Point 5: summary wording. The summary now reads "2 more journeys", or "1 more journey" in the singular.

The pull history still has the empty "Try:" commit. I can't force-push to remove it, and the gate requires the line.

Approved

Earlier asks are met. Journeys are capped at 3 with a singular/plural "N more journey(s)" disclosure, and the tests assert that structure. The 8px/16px literals now come from the DESIGN §4 scale, and the departure is named in docs/design/areas/bets.md. The worst-case bet is seeded and the looks-owner test is updated. It works with JS off: details/summary plus post forms. The code is clean, nothing is added to README, and there is no new dependency.

Limits of my check: my token is not the owner, so the preview serves me no bet card (data-bet-card count is 0). The forge looks I was given have no bets page, so I could not see the card at 390 px.

Next, in order:

  1. Add /preview-admin/sample/bets to the looks list at phone and desk width, so the fit is pictured on every preview.
  2. Non-blocking: nothing measures the height. A looks check that fails when the Back button is below the fold would turn this into a guarantee.
commented

Left #8970 open: 2 unticked items remain (At 390 px wide each bet card fits the viewport height at rest, with no horizontal scroll.; Desk and phone looks from the preview are attached to the pull. design-lint passes.).

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs