Skip to content

Front end: responsive layout from the section 08 rules (#70) - #71

Merged
Nabil-Aufa merged 29 commits into
mainfrom
fix/70-responsive-layout
Oct 23, 2026
Merged

Nabil-Aufa merged 29 commits into
mainfrom
fix/70-responsive-layout

Conversation

@Nabil-Aufa

@Nabil-Aufa Nabil-Aufa commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #70. Stacked on #58 (#21), which is stacked on #57 and #56: review and merge those first; this PR's base then moves to main.

The responsive follow-up @AncungAulia asked for in the approving reviews of #56, #57 and #58, built from section 08 "Layout and responsive" and the tablet frames in docs/design/forepay.pen (#69).

What

Breakpoints (section 08)

Width Layout
Under 768 One column, gutter 16, tab bar
768 to 1023 Top nav, no tab bar, one column up to 640 centred, gutter 32, side cards under the main card
1024 and up Main column plus side column, content up to 1200 centred, gutter 40 (80 from 1280). The side column is 320, and 360 from a 1200 window.

Tablet frames at 834: built for 1b, 2a, 2b, 3a and 3b. Onboarding, 2c and 2d also take their desktop form from 768. From a tablet up, the wallet picker and the repayment approval are centred dialogs.

Overflows found in review, now gone:

  • 2a between 1024 and 1400;
  • two-button panels on phones;
  • 3a quick actions;
  • 3b figures on phones;
  • the "Full amount" chip;
  • transaction rows at 320;
  • onboarding notFound at 320.

The six wrapping rules, as built:

  • Buttons: under 768 two buttons stack, main first. Only "Try again" or "Prove again" with "Back" stay in a row, because both labels fit at 320.
  • Text: a row title wraps between words and is never cut. On a narrow phone the amount's unit moves under it instead.
  • Chips: the repay chips share one row equally; when Full amount has no room it moves to a second row at the same width.
  • Figure tiles: the History tiles keep at least 98 and wrap: 2 + 1 at 320, one row from 375.
  • Side columns: they give way below 1024.
  • Top nav: nothing in it shrinks. Below 834 the tabs take 10 of side padding instead of 20.

Repayment and History before the first advance, as drawn in "3a No advance yet" and "3b History, no advance yet" (desktop and mobile).

Type roles: text-hero 56/72/88, text-amount 48/56/64, text-page-title 28/36/44, text-card-title 20/22/24, text-figure 20/28/32, text-body 16 and text-small 13/13/14, in rem in tokens.css. They replace the unused single-size scale, and cn() treats them as font sizes. Every touched screen uses them (see below).

Small items from the same reviews

Decisions worth a look

  • Rules over frame pixels: section 08 says "build from these rules, not from the pixel widths of the 1440 and 390 frames". So at 1440 the content is 1200, not the 1280 the frames draw. The side column is 320/360, not 380/420/440. The page titles are 44 on desktop (drawn 40), the 3a balance 88 (drawn 72), and the 2a card title 24 (drawn 28).
  • Repay chips: each chip has 10 of side padding (drawn 16). The chips stretch to fill their row, so the padding only sets the minimum, and 10 keeps three in one row at 390 and in the 360 column.
  • 3b tiles on a phone: the unit sits under the figure, as frame 3b Mobile draws it.
  • 2a placeholder: while sizing() loads, the rule card shows bars over invisible words with no figure, "A part of the revenue you have proven, up to a cap". They render as wide as the usual sentence, so the card keeps its height at every width.

Since @AncungAulia's comments on this PR

  • Type sizes, "the roles win": every touched screen is set in the section 08 roles, and no pixel font size is left in fe/src.
    • Titles: card, panel, dialog and empty-state titles take Card title.
    • Body: sentences and rows take Body 16.
    • Small: labels, statuses, dates, chips, notes and links take Small.
    • Figure: the new Figure role (20 / 28 / 32, text-figure) sets the History tiles and the breakdown's "Your advance".
    • In-between sizes outside the table follow section 08's "Used for" column.
    • Open question: the repay amount input is on Figure for now; see my comment above.
  • Pointer cursor: your rule is in globals.css.
    • Disabled buttons no longer turn pointer events off, so they show not-allowed.
    • Hover and pressed colours apply only while a control can be used (not-disabled:), so a disabled button, quick action or chip keeps its look.
  • Amounts at 320: under 360, every row puts USDC under its figure, so the column stays even.
  • A date-dependent test from Front end: view repayment #21: it now looks for "Today" only in the new repayment's row. A fixture row is dated 20 Oct 2026.

New wording for the board (@AncungAulia)

Where Text
3a / 3b, a failed transaction Status "Failed, no USDC moved" ("Failed" on a phone), with "Receipt" like any row; replaces "Failed, not charged" / "No transaction"
2a, "How your advance is set" while sizing() loads Bars only (the invisible words are never read)

How it was checked

  • pnpm lint, typecheck, test (175 in fe) and build pass. Every one of the 21 commits typechecks and lints on its own.
  • Playwright: 203 pass, desktop and phone. The new fe/tests/e2e/layout.spec.ts checks every app screen at 320, 375, 768, 1024, 1280 and 1440:
    • Screens: onboarding, 2a, 2b, proving, sending, 2d, the panels, 3a, 3b, loading, and before the first advance.
    • Widths: the page is never wider than the window, nothing spills out of its box, and no label runs into its padding.
    • Measurements: content box widths, the side column at 1199 and 1200, the wordmark from 768, button stacking, equal chips and tiles, the balance circles, and uncut row titles.
  • A strict review against the pen file, section 08, the brief and this issue ran three rounds until it passed. Each round measured in Playwright and in real Chrome (each width in its own frame, because the window could not be resized) at 320, 375, 390, 768, 834, 1024, 1200, 1280 and 1440. Chrome showed no console errors.

🤖 Generated with Claude Code

@Nabil-Aufa Nabil-Aufa self-assigned this Oct 19, 2026
@vercel

vercel Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
forepay Skipped Skipped Oct 20, 2026 6:26pm UTC

@Nabil-Aufa Nabil-Aufa added this to the M3 — Relay and front end milestone Oct 19, 2026
@AncungAulia

Copy link
Copy Markdown
Collaborator

@Nabil-Aufa, I ran this locally: layout.spec.ts passes 13/13 here, and I checked 2a, 2b, 3a, 3b and the no-advance state by eye at 320, 834, 1024 and 1440. The overflows from the reviews are gone and the tablet layout matches the frames. Two things to add.

1. Everything clickable needs the pointer cursor

Tailwind 4's preflight sets cursor: default on <button> (Tailwind 3 used pointer), and globals.css has no cursor rule. So every button in the app shows the arrow: the main buttons, the repay chips, Max, the nav tabs, the quick actions and See all. Links still get the pointer, which makes it inconsistent.

One rule in fe/src/app/globals.css covers it, with no class per component:

@layer base {
  button:not(:disabled),
  [role="button"]:not([aria-disabled="true"]),
  [role="menuitem"],
  [role="tab"],
  label[for],
  summary,
  select {
    cursor: pointer;
  }
  button:disabled,
  [aria-disabled="true"] {
    cursor: not-allowed;
  }
}

Then drop cursor-default from the menu items in WalletChip.tsx (line 31), so the wallet menu follows the same rule. A disabled button such as "Enter an amount" then reads as not clickable yet.

2. Transaction amounts at 320 break differently in one list

On 3a and 3b at 320, "−20.00 USDC" breaks onto two lines while "−10.00 USDC" in the next row stays on one, so the amount column looks uneven. Under the width where the longest amount no longer fits (about 360), put the unit under the figure on every row, as the History tiles already do. Cosmetic only, nothing overflows.

The type scale question is still open on my side; I'll answer it separately.

@AncungAulia

Copy link
Copy Markdown
Collaborator

@Nabil-Aufa, on the type sizes question: the roles win. Convert the screens to the section 08 roles, and treat the drawn in-between sizes as the nearest role:

Text Drawn Use
Card titles ("Your wallet", "If you accept", "How we got this number", "Make a repayment", "Transactions", "Advance details") 18 text-card-title 20 / 22 / 24
Empty state title, error panel title 20, 19 text-card-title
Sentences in cards and panels 15, 14 text-body 16
Labels, statuses, dates, chips, figure labels 12, 13, 14 text-small 13 / 13 / 14
History figure tiles 20 / 32 text-figure, new
Breakdown "Your advance" 36 text-figure, new

The scale gets one new role for the two cases with no fit: Figure, 20 / 28 / 32 (phone / tablet / desktop), "Figures in tiles and breakdowns". It sits between Card title and Body in the section 08 table of docs/design/forepay.pen; that change goes in through a small design PR.

The frames keep their drawn pixel sizes; where they differ from this table, the table is right.

AncungAulia added a commit that referenced this pull request Oct 19, 2026
Section 08's type scale gets a Figure role, 20 / 28 / 32 (phone / tablet / desktop),
for figures in tiles and breakdowns: the History figure tiles and the offer
breakdown's "Your advance" had no role that fit. Answers the type size question
on #71: the roles win over the drawn in-between sizes.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@Nabil-Aufa

Copy link
Copy Markdown
Collaborator Author

@AncungAulia, thanks for both. The cursor rule, the amount units under 360, and the type roles from your table (with the new Figure role, 20 / 28 / 32) are in, and will be pushed after our strict review passes.

One size your table does not cover: the repay amount input on 3a ("0.00", in "Make a repayment"). It was drawn at 36. I mapped it to Figure, the nearest role over the three breakpoints, so it is now 20 / 28 / 32. On a phone it reads small: it is smaller than the 22 "USDC" beside the balance, and only a little larger than the Max chip.

Which role should it take?

  • Figure (20 / 28 / 32), as now.
  • Amount (48 / 56 / 64). This fits a phone, but in the 320 side column at 1024 it leaves little room beside the USDC and Max chips.
  • A size for inputs that you add to the scale.

🤖 Generated with Claude Code

Nabil-Aufa added a commit that referenced this pull request Oct 20, 2026
@AncungAulia's answer on #71: the roles win, and drawn in-between sizes take the nearest role.
Card, panel, dialog and empty-state titles take Card title (20, 22, 24); sentences and rows take
Body (16); labels, statuses, dates, chips, notes and links take Small (13, 13, 14). A new Figure
role (20, 28, 32) sets the History tiles, the breakdown's Your advance and the repay amount
input. A unit beside a figure keeps its own weight and drops to Small next to a Figure. No pixel
font size is left in the app. The checking skeleton follows the new body height.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Lexirieru
Lexirieru force-pushed the feat/21-repayment-view branch from 08691d5 to 66856ee Compare October 20, 2026 09:00
@Lexirieru
Lexirieru changed the base branch from feat/21-repayment-view to main October 20, 2026 09:05
Nabil-Aufa and others added 19 commits October 20, 2026 16:05
Tablet from 768: the top nav and no tab bar, a 32px gutter and one column up to 640.
Desktop from 1024: content up to 1200, centred, a 40px gutter (80 from 1280).
The onboarding top bar and its centred column start at 768 too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…hen they do not fit

text-hero, text-amount, text-page-title, text-card-title, text-body and text-small step at 768 and
1024, in rem. They replace the unused single-size scale. tailwind-merge learns they are font sizes.
An error panel's two buttons wrap to a second row when they do not fit, the main one on top.
When they must stack under 768 is settled in a later commit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…m 1024

Tablet: the desktop stepper, the Prove card as a row with a 200 illustration, the two lists one
under the other, and the wallet and rule cards side by side under it, as frame 2a Tablet draws.
Desktop: a 320 side column (the 360 from 1200 takes effect in a later fix), the lists side by side only when the text column has
room, and every list item free to wrap. The page and card titles use the type roles.

The rule's placeholder is now bars in the shape of the sentence, so the card keeps its height
however many lines the sentence takes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…row phone

Tablet: the desktop offer card and breakdown labels, with If you accept, the timer and both
buttons under them, as frame 2b Tablet draws. Desktop: the side column is 320 (360 from 1200 in a later fix).
The offer uses the hero amount role (56, 72, 88). A breakdown row with no room puts its value
under its label, so nothing spills at 320.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
From 768 the onboarding steps, Sign and Funds received use the centred column and sizes the
desktop has, the wallet chip shows its chevron, the wallet picker and the repayment approval
are centred dialogs rather than sheets. Step titles use the page title role (28, 36, 44) and
Funds received the amount role (48, 56, 64); the checking skeleton follows the title's height.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Tablet: the desktop balance card, quick action labels and View contract, with the repay form,
transactions, advance details and the ledger note in one column, as frame 3a Tablet draws.
Desktop: the side column is 320 (360 from 1200 in a later fix). The balance uses the hero amount role.
A transaction's date moves under its status on a narrow phone, a quick action label wraps
rather than being cut, and a repay chip with no room moves to a second row
(a later commit gives the chips equal widths).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Tablet: the desktop summary tiles, eyebrow and ledger note, as frame 3b Tablet draws. The
title uses the page title role. On a narrow phone the tiles no longer spill: a later commit
lets them keep their size and wrap, as section 08 asks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Onboarding (1a, 1b, no wallet, 1c), 2a, 2b, a two-button panel, 3a and 3b, each at 320, 375,
768, 1024, 1280 and 1440: the page is no wider than the window, nothing is wider than its own
box, and no label runs past its content box (centred text spills on both sides, which
scrollWidth does not count).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The No advance yet card is 400 wide with 24 padding, the full column on a phone, and sits 48
under the title from a tablet up, as the four No advance yet frames draw. The layout check
covers both pages in that state.

Until #16 answers, the fixture client takes forepay.mock.ledger: none, active (the default),
repaid or error, to try each ledger state by hand.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A failed transaction reached the ledger and failed there: the network fee was spent and no
USDC moved, so "not charged" and "No transaction" were wrong. The row now says "Failed, no
USDC moved" ("Failed" on a phone) and links its receipt like every other row.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Not the contract's claim template: it is the input of our own flow, what the #17 relay asks
AdSense for, as @Lexirieru explained in the #57 review.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The send's answer went to the screen the creator had left, which dropped it, so the screen they
came back to waited two minutes on a transaction that never reached a ledger. A refusal is now
remembered with the pending advance, and a screen already waiting on it is told: either way
"The transaction did not go through" shows at once, and Try again sends it.

The RPC stub no longer reports a request_advance still being sent, or refused, as landed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
min-[1200px]: sorted before lg: in the built CSS, so the column stayed 320 at every width. A
wide breakpoint (75rem) sorts after lg. The layout check now measures the content box at
768 to 1440 and the side column at 1199 and 1200.

In the 360 column the rule card's sentence takes three lines, so its loading bars now stand on
invisible words with no figure that render as wide as the usual sentence, keeping the card's
height at every width.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The row needs 745 for the wordmark, tabs and chips as the 834 frame draws them, and a 768
window leaves 704, so the wordmark shrank to 109. Nothing in the row shrinks now: below 834
the tabs take 10 of side padding instead of 20, from 834 they are as drawn, 12 apart.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…at 320

Wrapping by the current width put "Allow USDC" and "Not now", or "Get Freighter" and
"Back", side by side at 375. Section 08 decides per pair: under 768 they stack, main first,
and only "Try again" or "Prove again" with "Back", which fit at 320, keep one row.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…heir drawn place

The chips were sized by their labels (69, 70, 117). They now share one row equally where Full
amount fits three times over; otherwise Full amount moves to a second row at the same width,
as section 08 asks of chips. The balance card's circles are anchored 560 and 610 from the
left, as every 3a frame draws them, rather than from the right, which only matched an 824 card.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Side by side under the Prove card they stretched to the taller one; frame 2a Tablet draws the
rule card shorter than the wallet card.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
"Repayment" read "Repayme…" and "Advance received" read "Advance …": section 08 keeps
the ellipsis for a line that matters more than its words. The title column keeps at least its
longest word, so a title wraps between words; on a narrow phone the amount gives way instead,
its unit moving under the figure.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Nabil-Aufa and others added 7 commits October 20, 2026 16:05
Section 08: chips and figure tiles keep their size and move to a new line. The tiles share
equal grid columns at least 98 wide on a phone (the label on one line, the unit under the
figure as frame 3b Mobile draws it), so at 320 the third moves to a second row at the same
width; from 375 the three share one row.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… ledger too

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…hen disabled

Tailwind 4's preflight gives buttons the default cursor, so every button showed the arrow while
links showed the pointer. One base rule in globals.css, from @AncungAulia's review, covers
buttons, menu items, tabs and labels; the wallet menu items drop their cursor-default. Buttons
and quick actions no longer turn pointer events off when disabled (a disabled button ignores
clicks anyway), so the not-allowed cursor shows over them. The e2e reads the cursor of what is
really under the pointer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A fixture row is dated 20 Oct 2026, so on that day the list held two Todays and the check
failed in strict mode. It now looks in the row of the repayment just made.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…column stays even

At 320 "−20.00 USDC" broke onto two lines while "−10.00 USDC" in the next row did not
(@AncungAulia's review). An amount now carries its unit apart: under 360, where the longest
amount no longer fits, every row puts USDC under the figure; from 360 it sits beside it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@AncungAulia's answer on #71: the roles win, and drawn in-between sizes take the nearest role.
Card, panel, dialog and empty-state titles take Card title (20, 22, 24); sentences and rows take
Body (16); labels, statuses, dates, chips, notes and links take Small (13, 13, 14). A new Figure
role (20, 28, 32) sets the History tiles, the breakdown's Your advance and the repay amount
input. A unit beside a figure keeps its own weight and drops to Small next to a Figure. No pixel
font size is left in the app. The checking skeleton follows the new body height.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… and press

Since disabled buttons stopped turning pointer events off (so the not-allowed cursor shows), their
plain hover: and active: colours applied to them too: a disabled Repay tile or 25% chip turned
grey under the pointer. Hover and pressed colours now apply only while the control can be used
(not-disabled:, which links drawn as buttons match too). The e2e hovers and presses each disabled
control on a fully repaid advance and checks a link tile still answers a hover.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Lexirieru
Lexirieru force-pushed the fix/70-responsive-layout branch from 5ca40cd to deb0ee9 Compare October 20, 2026 09:05
@Lexirieru

Copy link
Copy Markdown
Collaborator

Rebased onto main and retargeted — I force-pushed fix/70-responsive-layout, so git fetch && git reset --hard origin/fix/70-responsive-layout before you touch it again.

Why it needed it: #56, #57 and #58 all landed on main as squash merges, which gives main one commit where your branch had the originals. I replayed only the 26 commits unique to this PR onto main. The diff is +1121/-350 across 54 files, byte-identical to what the PR showed before, so nothing of yours was dropped or rewritten.

Not merging this one. It is 54 files of layout against @AncungAulia's section 08 rules, and he is the only person who can say whether it matches them — approving it myself would be a rubber stamp on the one thing I cannot check. @AncungAulia, it is clean and green and waiting on you.


Separately, and it is a comment rather than code: fe/src/modules/advance/components/ProveRevenue.tsx:47 still says "the window comes from the contract's claim template". You did the right thing by not naming months, but that explanation is wrong and it will mislead whoever implements the window display later.

claim_template() holds only literal URL segments. The publisher id and the dates are values interleaved at verification time and never stored. Where the window actually comes from:

  • before the advance — from your own request. The creator picks it, the relay asks AdSense for exactly that, the attestor signs exactly that, and you pass exactly that to request_advance. Showing your own request parameters is not weaker than reading them from chain; the chain is about to verify them.
  • after the advance — from advance(nullifier), which does store window_start and window_end.

Also, as of #79 the template is now eight parts and seven values (pub_id, then each date as unpadded year/month/day), because AdSense takes dates as startDate.year=2026&startDate.month=7&startDate.day=1 and has no string date form at all. So the old comment is doubly stale.

Nice work on reading sizing() instead of hard-coding the rate and cap — that is exactly what #63 was for.

@Nabil-Aufa

Copy link
Copy Markdown
Collaborator Author

@Lexirieru, thanks for the rebase. My local branch now matches origin/fix/70-responsive-layout, and fe/ is identical to what I pushed.

That comment is already fixed on this branch, in 01a4f79 ("say where 2a's revenue window really comes from"). ProveRevenue.tsx:51-52 now reads:

Not named months (review S8): the window is not chain data before the advance. It is what the #17 relay asks AdSense for, so 2a can name it once the relay exists.

That matches what you describe. Before the advance, the window is our own request, carried through the relay into request_advance. After it, the window is read back: 3a's Advance details and History show the window of the stored advance, today from /advances (#16), which mirrors advance(nullifier). You may have been looking at the diff from before that commit.

Noted on #79 (eight parts, seven values, unpadded dates). The front end never builds the template, so nothing here changes; it matters for the #17 relay.

🤖 Generated with Claude Code

@AncungAulia

Copy link
Copy Markdown
Collaborator

@Nabil-Aufa, good catch. Neither fits, so the scale gets a role for it: Input amount, 32 / 36 / 36 (phone / tablet / desktop), "The amount typed in a field". It sits between Amount and Page title in the section 08 table.

  • On a phone, 32 reads larger than the 22 "USDC" beside the balance.
  • From a tablet up, it is the 36 the frames draw, which fits the 320 side column at 1024 beside the USDC and Max chips.

Use it for the 3a repay input (the Input/Amount component). The pen change goes in through a small design PR.

AncungAulia added a commit that referenced this pull request Oct 20, 2026
Section 08's type scale gets an Input amount role, 32 / 36 / 36 (phone / tablet /
desktop), for the amount typed in a field such as the 3a repay input. Figure read
too small on a phone and Amount was too large for the 320 side column. Answers
the question on #71.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Nabil-Aufa and others added 3 commits October 21, 2026 00:31
@AncungAulia's answer on #71, with the role added to section 08 in #84: the amount typed in a
field. On a phone it reads larger than the balance's unit, and from a tablet it is the 36 the
frames draw, which still fits the 320 side column beside the USDC and Max chips.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…wrap instead

With the Input amount role, "100.00" was cut to an ellipsis at 320 and in the 320 side column
from 1024 to 1199. The amount field is now as wide as what was typed, and when it and the USDC
and Max chips no longer share the row, the chips move under it. The full-width repay action wraps
a long label ("Repay 60.00 USDC instead") rather than run into its padding at 320.

So that an uncut amount can never outgrow its field, the field takes no zero before another digit
and a whole part of at most 99, or what is left to repay when that is more (60 left: up to 99, so
typing past it still shows "Only ... left"; 100 left: up to 100, never 101 or a wide 800), and with three digits six decimals at most. The
limit is on the value because digits differ in width ("1" narrowest, "0" widest in Geist). The
widest amounts it allows, "80.0000000" and "100.000000", fit the field at 320 and in the side
column. The e2e types them key by key and measures them against the field's border.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A dev server pointed at another build folder (NEXT_DIST_DIR) left one behind and failed lint.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Nabil-Aufa

Copy link
Copy Markdown
Collaborator Author

@AncungAulia, the Input amount role from your answer above is in (6eae97c): text-input-amount, 32 / 36 / 36, on the 3a repay field.

One thing to know for the board. At 36, the field cannot hold every typed amount on one row next to the USDC and Max chips:

  • at 320;
  • in the 320 side column from 1024 to 1199, where "100.00" no longer fits.

So, following section 08's wrap rules (fb91a0a):

  • The typed amount is never cut. The field is as wide as what was typed. When the amount and the chips no longer share the row, the USDC and Max chips move under it.
  • The amount is limited by its value, not its length. It is never larger than 99, or than what is left to repay when that is more. There is no zero before another digit, and a three-digit amount takes six decimals at most. Digits differ in width in Geist (a "1" is narrow, a "0" wide), so the limit is on the value. The widest amounts this allows, "80.0000000" and "100.000000", measure 195 / 219 and 188 / 211 px at 32 / 36, inside the 208 / 232 field. Typing past what is left still shows "Only … left".
  • The full-width action wraps a long label. "Repay 60.00 USDC instead" now wraps instead of running into its padding at 320.

If the contract's cap per advance is ever raised above 100 USDC, these widths need measuring again; the code comment says so.

The board might want the chips-under-the-amount state drawn for 320 and for the 1024 side column.

🤖 Generated with Claude Code

@AncungAulia AncungAulia left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Re-checked at 83a490e: layout.spec.ts and repayment.spec.ts pass here (49/49). Everything clickable on 3a shows the pointer, and the disabled repay button shows not-allowed. The repay input is 32 on a phone and 36 from a tablet up, and "59.99" sits beside the USDC and Max chips at 320. The type utilities match the section 08 table, Figure and Input amount included, and no one-off pixel sizes are left. Approving from the design side; merge stays with @Lexirieru.

@Nabil-Aufa
Nabil-Aufa merged commit 9b81d82 into main Oct 23, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Front end: responsive layout from the section 08 rules

3 participants