Skip to content

fix(#97): Advance details name AdMob for an AdMob advance, from the API's source - #108

Merged
Lexirieru merged 2 commits into
mainfrom
feat/admob-fe-details
Oct 30, 2026
Merged

Lexirieru merged 2 commits into
mainfrom
feat/admob-fe-details

Conversation

@Nabil-Aufa

Copy link
Copy Markdown
Collaborator

Follow-up to #104, from @Lexirieru's review there: Advance details on Repayment said "AdSense revenue, …" for every advance, which becomes wrong for the first AdMob one.

What changed

Commit What
5b6b328 #107 adds source to every /advances row, read from the request_advance call. AdvanceSummary gains source: "AdSense" | "AdMob". getAdvances keeps it, and reads a row without one (an API host still on the code from before #107) or with an unknown value as AdSense. The row reads "AdMob revenue, Jul to Sep 2026" for an AdMob advance.
ff05424 The label wrapped at 1440 with the year alone on the second line ("…Jul to Sep" / "2026"), on main too. The window is now kept whole, so a wrap reads "AdMob revenue," / "Jul to Sep 2026". Rows are keyed by a stable id now that a label is not a plain string.

Safe to merge before or after the upgrade and before or after #107 reaches the API host: without source, the card reads exactly as it does today.

Checked

  • Lint and typecheck are clean. 204 unit tests pass, three of them new: the client against a stubbed fetch, for AdMob, a missing source and an unknown one.
  • Playwright: 246 pass, 24 skipped, both builds. Two new e2e tests on Repayment: an AdMob row names AdMob and never AdSense, and a row without a source reads AdSense. Both skip mobile like their neighbours, since Advance details are the desktop layout's.
  • A strict review, PASS on the third round:
    • Against the 3a frame in docs/design/forepay.pen: padding, row gap, colours, weights, value alignment and the Verified chip match. The label's two lines and its 16px follow the board's section 08 rules (side column 360, "a long label wraps to a second line") and the type roles agreed on Front end: responsive layout from the section 08 rules (#70) #71.
    • Playwright in Chrome at 1440, 1280 and 1024, and in real Chrome, with a stub API for both cases. No console errors.

Not done here

Other AdSense-only copy (BeforeYouStart, the empty ledger, the landing page metadata, the wallet kit's description) is unchanged.

🤖 Generated with Claude Code

Nabil-Aufa and others added 2 commits October 30, 2026 20:38
…PI's source

#107 adds `source` to every /advances row, read from the request_advance
call. The client keeps it, and reads a row without one (an API from before
#107) or with an unknown one as AdSense. "AdSense revenue, …" on Repayment
becomes "AdMob revenue, …" for an AdMob advance.

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

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

vercel Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
forepay-vue5 Ready Ready Preview Oct 30, 2026 2:08pm UTC
1 Skipped Deployment
Project Deployment Actions Updated
forepay Skipped Skipped Oct 30, 2026 2:08pm UTC

@Nabil-Aufa
Nabil-Aufa requested a review from Lexirieru October 30, 2026 14:08

@Lexirieru Lexirieru 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.

Approving. You turned a line in a review into a merged fix inside the hour, and picked up something I had not mentioned.

The r.label → r.key change is the real catch here. The label stopped being a string the moment it became a <>…</>, so key={r.label} would have become React's object-as-key — which does not throw, it just quietly stops reconciling rows properly. You found it because you changed the type and followed it, not because anything failed.

Verified here

What Result
pnpm vitest run on your head 28 files, 204 tests, 204 pass
pnpm eslint . clean
pnpm typecheck clean, exit 0

A correction on my own method: I first ran tsc --noEmit directly and got two TS2304: Cannot find name 'LayoutProps' errors, which looked like your PR contradicting its own "typecheck is clean". It was my mistake — LayoutProps is generated by next typegen, which the typecheck script runs first and I had skipped. Your claim was right; I nearly reported a failure that was mine.

Keeping the window whole with whitespace-nowrap is the right fix for the wrap, and I note it was wrong on main too — a bug you could have left for someone else to file.

One pattern worth naming, not a change request

source: r.source === "AdMob" ? "AdMob" : "AdSense",

This is now the third place an unrecognised source silently becomes AdSense: here, requestArgs in #107, and advance_source's unwrap_or in #94. In two of those it is exactly right, and for different reasons:

  • advance_source is safe because the entry is persistent, so an archived entry forces a restore before the read and can never read as absent.
  • Your "a row without a source, from an API before #107" case is right because every advance written before #94 genuinely is AdSense.

What is conflated is absent and unrecognised. Absent means AdSense, provably. "YouTube" means something is wrong, and the card would then assert "YouTube revenue" as "AdSense revenue" — a confident wrong label on a real debt, which is worse than an honest vague one. A neutral revenue, Jul to Sep 2026 for an unknown value would cost one line.

I raised the same thing on #107 and said there it was not blocking either, with Source holding two variants. It is still not blocking. But three places is where a habit starts, and the day someone adds a third Source variant, all three default the wrong way at once and none of them complains. Worth a single shared helper when that day comes, rather than three independent ternaries.

Safe to merge now, and I checked why

With no source on the wire the card renders exactly as it does today, so this is correct against the API host before and after #107, and against the contract before and after tomorrow's upgrade. That matters because the upgrade is live tomorrow from 20:50 WIB and I did not want a Repayment change in flight during it.

main is f582fd2; v0.5.0 is proposed on both contracts, executable 2026-10-31 13:49:10 UTC. The runbook is on #102 — @Lin1er is reading it for errors, and you are welcome to as well, particularly step 4, which is @AncungAulia's rebuild.

@Lexirieru
Lexirieru merged commit 0138a4f into main Oct 30, 2026
9 checks passed
@Lexirieru
Lexirieru deleted the feat/admob-fe-details branch October 30, 2026 14:28
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.

2 participants