Skip to content

feat: add currency exchange to Labs - #37

Merged
VelvetAbyss merged 1 commit into
mainfrom
codex/currency-exchange-release-20261027
Oct 27, 2026
Merged

VelvetAbyss merged 1 commit into
mainfrom
codex/currency-exchange-release-20261027

Conversation

@VelvetAbyss

Copy link
Copy Markdown
Owner

Summary

Add an opt-in currency exchange tool to Labs. After installation it opens as a standalone page with multi-currency conversions, Chinese and English currency names, and historical charts using Frankfurter daily reference rates.

Validation

  • Web production build and lint passed.
  • Full Web test run: 1,177 passed and 4 skipped; one translation offline suite failed because its WASM resource was outside the isolated checkout. After placing the dependency within the checkout, that suite passed separately (4 tests).
  • Currency tests cover installation gating, conversion, currency selection and historical range requests; Labs tests cover installation, removal and restoration.
  • Confirmed cross-origin access and five years of USD/CNY history from the provider.
  • Full browser interaction and authenticated production installation remain unverified.

@vercel

vercel Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
focus-go Ready Ready Preview Oct 27, 2026 9:22am UTC

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-27T09:22:49.880474Z a7298f0 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a7298f06c2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

<div className="currency-add"><select aria-label={zh ? '选择货币' : 'Choose currency'} value={add} onChange={e => setAdd(e.target.value)}><option value="">{zh ? '选择货币' : 'Choose currency'}</option>{available.map(code => <option key={code} value={code}>{code} · {currencyName(code)}</option>)}</select><button disabled={!available.includes(add)} onClick={() => { setTargets([...targets, add]); setAdd('') }}><Plus size={16} /> {zh ? '添加' : 'Add'}</button></div>
<p className="currency-note">{status === 'loading' ? (zh ? '正在获取汇率…' : 'Loading rates…') : status === 'error' ? (zh ? '汇率获取失败,请检查网络后重试。' : 'Could not load rates. Check your connection and retry.') : `${zh ? '数据日期' : 'Rate date'}: ${rates?.date}`} {status === 'error' && <button onClick={() => setRetry(value => value + 1)}>{zh ? '重试' : 'Retry'}</button>}</p>
</section><section className="currency-panel currency-trend"><div className="currency-trend-head"><h2>{base} / {selected} {zh ? '汇率走势' : 'exchange rate'}</h2><button onClick={() => changeBase(selected)}><ArrowLeftRight size={16} /> {zh ? '切换货币' : 'Swap'}</button></div>
<p className="currency-rate">1 {base} = <strong>{current ? format(current) : '—'}</strong> {selected}</p>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve significant digits in small exchange rates

For currency pairs with small positive rates, the default four-fraction-digit formatter can display a materially incorrect quote: 0.000044 becomes 0, while 0.000061 becomes 0.0001. The headline therefore reports a zero or substantially distorted exchange rate even though conversions use the unrounded value. Use significant-digit formatting or adaptive decimal precision for the per-unit rate so low-valued base currencies remain accurately represented.

Useful? React with 👍 / 👎.

@VelvetAbyss
VelvetAbyss merged commit 2b961b5 into main Oct 27, 2026
3 checks passed

This branch was successfully deployed

1 active deployment
Preview — a7298f06 Deployed Oct 27, 2026 by vercel[bot]
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.

1 participant