Skip to content

fix(mobile): format briefing dates and amounts for the app locale - #8250

Merged
iscekic merged 6 commits into
mainfrom
drain/briefing-locale-format
Oct 22, 2026
Merged

iscekic merged 6 commits into
mainfrom
drain/briefing-locale-format

Conversation

@iscekic

@iscekic iscekic commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

Evidence

Evidence: demonstrated — the original Android run showed raw dates and inconsistent USD precision. This follow-up reproduced raw-date rendering in mounted tests, then verified the merged app's localized list/detail dates and amounts on Android in pt-BR and German, including a timezone west of UTC.

Change

  • Format scheduled report dates in the active app language without shifting the calendar day. Home uses the calendar-date helper; list and detail share BriefingPeriodLabel after the merge with main.
  • Keep main's one-off period labels, report timezone, revision display, and bounded historical evidence sampling.
  • Share USD currency precision across totals, agent rows, estimates, paid disclosures, and charges. Positive amounts below half a cent display below the smallest currency unit; partial-coverage amounts keep their separate at-least marker.
  • Retain locale-aware two-decimal and sub-half-cent instructions in the common summary prompt for scheduled and one-off reports.
  • Migrate main's new one-off review cost display to the shared money formatter.

Verification

Current follow-up

  • pnpm install --frozen-lockfile — passed.
  • @kilocode/harness-sdk and @kilocode/trpc builds passed.
  • Mobile typecheck, lint, and check:unused passed. Targeted web lint and changed-source formatting passed; git diff --check is clean.
  • Focused mobile Vitest run with TZ=America/Los_Angeles: 7 files, 40 tests passed, including mounted pt-BR/de shared period-label coverage. With the raw-date expression restored temporarily, both new regression cases failed on the expected localized date.
  • Web Jest: existing summary suite plus a temporary real prompt-generation smoke, 2 suites and 7 tests passed. The smoke exercised scheduled and one-off prompts in pt-BR and de, retained the money instructions and raw microdollar facts, and preserved period metadata. The temporary smoke was removed; no permanent test pins prompt prose. Actual model-generated wording was not exercised.

Fresh Android proof on the merged branch

The full app used an owned fake account and isolated local backend/database, with optional analytics off. Both the Android device and report used America/Los_Angeles.

  • pt-BR list/detail date: 22/10/2026; total US$ 0,18; agent rows US$ 0,12 and < US$ 0,01.
  • German list/detail date: 22.10.2026; total 0,18 $; agent rows 0,12 $ and < 0,01 $.
  • An empty one-off report retained Avulso / Einmalig, its historical window, report timezone, and localized creation timestamp. No paid summary or charge was generated.
  • Six inspected screenshots and observed UI results.

Original Android run

The initial session exercised an owned fake account on the local development stack and seeded a report with 182000 microdollars total spend and agent rows of 122000 and 1800 microdollars:

  • pt-BR: Home/list/detail calendar date 20/10/2026; report total US$ 0,18; agent rows US$ 0,12 and < US$ 0,01.
  • German: Home/list/detail calendar date 20.10.2026; report total 0,18 $; agent rows 0,12 $ and < 0,01 $.
  • Partial coverage retained the separate at-least marker without nested markers.

The original screenshots and observed UI text remain in the PR comments. Those captures are from the original session, not a replay of this merge.

Proxy answers

The owner's proxy gave these answers in the owner's place.

  1. Question: Include locale-aware two-decimal USD guidance in the AI summary prompt as well as formatting the app surfaces? Answer: Add the two-decimal prompt instruction. Confidence: 0.70. Precedent: Fix the root cause across affected surfaces.
  2. Question: How should a positive amount below half a cent display? Answer: < US$ 0,01, localized consistently across briefing surfaces. Confidence: 0.72. Precedent: Keep equivalent values consistent across surfaces.
  3. Question: How should this session recover a throttled publication prerequisite? Answer: Temporarily use the existing authorized control credential for the local provider, publish through the unchanged gate, then restore the original routing. Confidence: 0.70. Precedent: Prefer a narrow, reversible prerequisite fix.

Briefing screens rendered report.localDate, a date-only string, exactly as
stored, next to a localized window line. Render it through the shared
calendar-date formatter so the day follows the app language without a
time-zone shift, on the list card, the report header and the Home card
preview.

briefingMoney formatted USD with four fraction digits, so the scorecard,
agent rows, estimates and the settled charge disagreed with the currency's
precision. Move it into a shared module that uses the currency precision
for the active language and shows a positive amount below the smallest unit
as "< 0,01" instead of rounding it to zero.

The paid summary prompt asks the model for two-decimal USD amounts so the
model-written paragraph agrees with the formatted surfaces.
@iscekic iscekic added drain Work item from the findings drain explorer:android Finding surfaced by the Android explorer labels Oct 20, 2026
@iscekic

iscekic commented Oct 20, 2026

Copy link
Copy Markdown
Collaborator Author

bot: Verified on the Android emulator against the local dev stack with an owned local test account and a seeded briefing report (spend 182000 µ$, sessions 122000 µ$ and 1800 µ$).

  • pt-BR report after the fix: header day 20/10/2026 above the localized window, scorecard US$ 0,18, agent rows US$ 0,12 and < US$ 0,01.
  • pt-BR report before the fix, for contrast: header day 2026-10-20, scorecard US$ 0,182, agent rows US$ 0,122 and US$ 0,0018.
  • de report after the fix: header day 20.10.2026, scorecard 0,18 $, agent rows 0,12 $ and < 0,01 $.
  • de briefing list after the fix: card day 20.10.2026 and 0,18 $.
  • pt-BR Home card after the fix: "Ler resumo · 20/10/2026" with 0,18 $ overnight spend.

Text was asserted from uiautomator dumps and the screenshots were read back with OCR.

pt-BR report after the fix

pt-BR report before the fix

de report after the fix

de briefing list after the fix

pt-BR Home card after the fix

@kilo-code-bot

kilo-code-bot Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Executive Summary

The incremental commit adds a mounted regression test for the localized scheduled briefing date and a README note, and the main merge resolutions keep the PR's money/date formatting intact; no new issues found.

Assumptions: [INFERENCE] The merge of main brought ~2,800 unrelated files into the commit range, so this review scoped the increment to the PR's own merge resolutions plus 4e51b1a79; the mobile mounted and web briefing suites were not executed in this read-only run.

Files Reviewed (6 files)
  • apps/mobile/README.md - no issues
  • apps/mobile/src/components/agent-briefing/briefing-period-label.mounted.test.tsx - no issues (asserts 20/10/2026 / 20.10.2026 under a west-of-UTC TZ, unmounts in finally, no leaks)
  • apps/mobile/src/components/agent-briefing/briefing-period-label.tsx - no issues (merge keeps formatCalendarDate)
  • apps/mobile/src/components/agent-briefing/briefing-detail-screen.tsx - no issues (merge keeps shared period label plus main's session/source helpers; no stale formatDate/parseTimestamp imports)
  • apps/mobile/src/components/agent-briefing/briefing-create-review.tsx - no issues (merge keeps briefingMoney from the shared module)
  • apps/web/src/lib/agent-briefing/summary.ts - no issues (merge preserves main's scope split and the half-cent below-smallest-unit instruction)
Carried findings verification (unchanged files)
  • apps/mobile/src/lib/agent-briefing-format.ts - SUB_CENT_USD = 0.005 still drives the < marker and lowerBound stays at currency precision, so the ≥ collision remains fixed
  • apps/web/src/lib/agent-briefing/summary.ts - prompt threshold now matches the formatter and lets the language's separators render the marker
Previous Review Summaries (3 snapshots, latest commit 38865f3)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit 38865f3)

Status: No Issues Found | Recommendation: Merge

Executive Summary

The previous warning is fixed in 38865f3: briefingPrompt now uses the formatter's half-cent threshold and lets the marker take the language's separators, so the model paragraph and the mobile surfaces agree; no new issues in the incremental change.

Files Reviewed (2 files)
  • apps/web/src/lib/agent-briefing/summary.ts - no issues (threshold now matches SUB_CENT_USD in agent-briefing-format.ts:4)
  • apps/web/src/lib/agent-briefing/summary.test.ts - no issues
Carried findings verification (unchanged files)
  • apps/mobile/src/lib/agent-briefing-format.ts - lowerBound renders format.format(0) and the call sites apply the "at least" copy; the </≥ marker collision stays fixed
  • Remaining mobile/analyzer call sites unchanged since the prior review and untouched by this commit

Previous review (commit 85cfbd4)

Status: 1 Issue Found | Recommendation: Address before merge

Executive Summary

The prior two suggestions are fixed in 85cfbd4; one remaining mismatch between the prompt's below-one-cent rule and the formatter's half-cent threshold can still make the model paragraph disagree with the scorecard.

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
apps/web/src/lib/agent-briefing/summary.ts 98 Prompt says "below one cent" but briefingMoney only uses < 0.01 below half a cent, so 0.005–0.010 USD formats as 0.01 on screen while the model is told to write < 0.01
Files Reviewed (6 files)
  • apps/mobile/src/components/agent-briefing/briefing-card.tsx - no issues
  • apps/mobile/src/components/agent-briefing/briefing-detail-screen.tsx - no issues
  • apps/mobile/src/lib/agent-briefing-format.test.ts - no issues
  • apps/mobile/src/lib/agent-briefing-format.ts - no issues (prior marker collision fixed via lowerBound)
  • apps/web/src/lib/agent-briefing/summary.test.ts - no issues
  • apps/web/src/lib/agent-briefing/summary.ts - 1 issue

Fix these issues in Kilo Cloud

Previous review (commit 2d03a7a)

Status: 2 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 0
SUGGESTION 2
Issue Details (click to expand)

SUGGESTION

File Line Issue
apps/mobile/src/lib/agent-briefing-format.ts 17 New < marker collides with the ≥ agentBriefing.atLeast prefix used by the scorecard and session rows, producing ≥< US$ 0,01 on partial spend coverage
apps/web/src/lib/agent-briefing/summary.ts 98 "exactly two decimals" makes the model write US$ 0.00 for sub-half-cent amounts, unlike the < US$ 0,01 the app now shows
Files Reviewed (9 files)
  • apps/mobile/src/components/agent-briefing/briefing-card.tsx
  • apps/mobile/src/components/agent-briefing/briefing-context-settings.tsx
  • apps/mobile/src/components/agent-briefing/briefing-detail-screen.tsx
  • apps/mobile/src/components/agent-briefing/briefing-list-screen.tsx
  • apps/mobile/src/components/agent-briefing/briefing-summary.tsx
  • apps/mobile/src/lib/agent-briefing-format.test.ts
  • apps/mobile/src/lib/agent-briefing-format.ts
  • apps/web/src/lib/agent-briefing/summary.test.ts
  • apps/web/src/lib/agent-briefing/summary.ts

Fix these issues in Kilo Cloud


Reviewed by deepseek-flash-latest · Input: 66K · Output: 8.6K · Cached: 949.5K

Review guidance: REVIEW.md from base branch main

A spend row with partial coverage prefixed the formatted amount with the
"at least" copy, so a recorded amount below one cent rendered as a marker
inside a marker. The formatter now takes the bound into account: a lower
bound stays at the currency precision and the call site supplies the
prefix, while an exact amount keeps the below-unit marker.

The paid summary prompt carries the same rule, so a model-written
paragraph states a below-one-cent amount instead of rounding it to zero.
@iscekic

iscekic commented Oct 20, 2026

Copy link
Copy Markdown
Collaborator Author

bot: Follow-up for the lower-bound review remark: with partial spend coverage on the seeded report, the German report carries the at-least prefix on the scorecard and on each agent row, including the row below a cent, with the existing coverage hint directly below. No nested markers. Text asserted from uiautomator dump.

de report with partial spend coverage after the fix

The summary prompt called anything below a cent "less than the smallest
unit", while the briefing surfaces keep the below-unit marker only below
half a cent; amounts in between round up to one unit there. The prompt now
names the same threshold and keeps the marker in the language's separators.
@iscekic iscekic added the merge:human Substantive functional risk requires human review. label Oct 20, 2026
@iscekic iscekic added merge:blocked merge:bot Bot-owned review; merge when ready once readiness passes and a review approves. merge:human Substantive functional risk requires human review. and removed merge:human Substantive functional risk requires human review. merge:bot Bot-owned review; merge when ready once readiness passes and a review approves. merge:blocked labels Oct 20, 2026
@iscekic
iscekic added this pull request to the merge queue Oct 21, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Oct 21, 2026
@iscekic iscekic added merge:human Substantive functional risk requires human review. and removed merge:human Substantive functional risk requires human review. labels Oct 22, 2026
@iscekic iscekic removed the merge:human Substantive functional risk requires human review. label Oct 22, 2026
@iscekic

iscekic commented Oct 22, 2026

Copy link
Copy Markdown
Collaborator Author

bot: Merged current main while preserving both briefing changes. Scheduled dates now format inside the shared period label; one-off period metadata and bounded historical prompt sampling remain intact. The new one-off review cost display uses the shared money formatter. Added mounted pt-BR/de calendar-day regression coverage, including a device timezone west of UTC. The summary prompt was exercised for both report kinds and locales using a temporary generator smoke; model-generated prose was not exercised.

@iscekic

iscekic commented Oct 22, 2026

Copy link
Copy Markdown
Collaborator Author

bot: Fresh Android end-to-end proof after the shared period-label extraction, using the full app with an owned fake account and isolated local backend/database. Optional analytics stayed off; no paid summary was generated.

  • pt-BR: list and detail both show 22/10/2026. The detail shows US$ 0,18, US$ 0,12, and < US$ 0,01 for the seeded total and session amounts.
  • de: list and detail both show 22.10.2026. The detail shows 0,18 $, 0,12 $, and < 0,01 $ for the same amounts.
  • Both runs preserve the calendar day with the Android device and report in America/Los_Angeles, and retain localized period timestamps.
  • An empty one-off report keeps Avulso / Einmalig, its selected historical window, report timezone, and localized creation timestamp. Its empty-state copy confirms no AI summary or charge.

The six captures below were visually inspected and checked for metadata; they contain only owned nonproduction fixture data on the affected briefing surfaces.

Portuguese scheduled briefing list

Portuguese scheduled briefing date and amounts

German scheduled briefing list

German scheduled briefing date and amounts

Portuguese one-off period and creation time

German one-off period and creation time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

drain Work item from the findings drain explorer:android Finding surfaced by the Android explorer merge:human Substantive functional risk requires human review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants