Skip to content

SessionPicker shows ¥ for USD wallets #312

@esengine

Description

@esengine

Follow-up to #272 / #278.

src/cli/ui/SessionPicker.tsx:143-146 still hardcodes ¥ and unconditionally multiplies session cost by USD_TO_CNY, so a USD-wallet user sees ¥X.XX in the session-list picker even after #272 landed:

const costCny =
  info.meta.totalCostUsd !== undefined
    ? ${(info.meta.totalCostUsd * USD_TO_CNY).toFixed(2)}`
    : "";

This is the same bug shape as StatusRow / UsageCard, just in a different file. The fix is to swap the literal ¥ + manual conversion for formatCost(info.meta.totalCostUsd, walletCurrency) (the consolidated helper from #272) and thread walletCurrency into the picker — note info.meta only stores totalCostUsd, so the live wallet currency has to come from props/context, not from the session metadata file.

Also need a render test in a new tests/ui-session-picker.test.tsx covering the USD case (assert \$0.05 for totalCostUsd = 0.05 with balanceCurrency = "USD").

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions