Repository navigation
fix(#97): Advance details name AdMob for an AdMob advance, from the API's source - #108
Conversation
…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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Lexirieru
left a comment
There was a problem hiding this comment.
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_sourceis 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.
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
5b6b328sourceto every/advancesrow, read from therequest_advancecall.AdvanceSummarygainssource: "AdSense" | "AdMob".getAdvanceskeeps 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.ff05424maintoo. 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
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.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