Skip to content

fix(ui): set lang=ja and add Japanese fonts to sans stack#255

Open
maxx-masa wants to merge 6 commits into
TraderAlice:masterfrom
maxx-masa:feat/ui-ja-lang-font
Open

fix(ui): set lang=ja and add Japanese fonts to sans stack#255
maxx-masa wants to merge 6 commits into
TraderAlice:masterfrom
maxx-masa:feat/ui-ja-lang-font

Conversation

@maxx-masa
Copy link
Copy Markdown

Summary

  • <html lang>zh-CNja に変更。Chrome がページを中国語と誤判定して Google 翻訳のポップアップを出す問題を解消。
  • --font-sans の先頭に日本語フェイス(Hiragino / Yu Gothic / Meiryo / Noto Sans CJK JP)を追加。lang="ja" でも日本語グリフが解決され、欠字(豆腐文字)が出なくなる。簡体字フォントは互換のため末尾フォールバックに残置。

Test plan

  • チャット画面で豆腐文字が消えること、翻訳ポップアップが出ないことを目視確認
  • tsc / pnpm test(CSS・HTML のみの変更のため挙動への影響なし)

Boundary touch

なし(UI 表示のみ。trading / auth / broker / migrations には触れていない)

🤖 Generated with Claude Code

maxx-masa and others added 6 commits June 1, 2026 20:18
…racts

Quotes via aliceId failed with IBKR error 321 ("symbol must be entered")
for every IBKR contract, and returned all-zeros for delayed-data accounts.
Root cause + fixes:

- UnifiedTradingAccount._expandAliceIdIfNeeded: the override-copy loop only
  skipped ''/null/undefined, so `new Contract()`'s default conId=0 clobbered
  the conId resolved from the aliceId — the broker received an empty contract.
  Skip value===0 (all Contract numeric fields default to 0 == "unset").
- IbkrBroker.getContractDetails: only force the USD currency default when
  resolving by symbol; forcing it on conId lookups excluded JPY/TSE listings.
- IbkrBroker.getQuote: hydrate conId-only contracts via reqContractDetails
  before reqMktData; request delayed data (reqMarketDataType(3)) so accounts
  without a real-time subscription (free-trial/paper) still get prices; fall
  back last->close outside trading hours.
- request-bridge: map delayed tick types (DELAYED_BID..DELAYED_CLOSE) and
  CLOSE in tickPrice/tickSize, not just real-time BID/ASK/LAST/VOLUME.
- ibkr-types: add `close` to TickSnapshot.

Verified against a live IB Gateway paper session: 7203.T (TSEJ/JPY) and
AAPL both return correct quotes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…racts

Placing a JP-stock paper order and reading it back both failed after the
quote fixes:

- IbkrBroker.placeOrder: a conId-resolved contract could carry a stale
  display symbol and the default USD currency, which conflict with what the
  conId actually is (e.g. NRI/USD vs 4307/JPY) → IBKR error 478. Re-resolve
  the full contract from a clean conId-only reqContractDetails query before
  ordering so symbol/exchange/currency always agree.
- tool/trading.ts summarizeOrder: orders fetched over HTTP from the UTA
  service arrive as JSON with Decimal fields serialized to strings, so
  calling .equals()/.toFixed() on order.totalQuantity threw
  "totalQuantity.equals is not a function". Rehydrate each Decimal field
  via a toDec() coercion before formatting.

Verified end-to-end against IB Gateway paper: BUY 100 NRI (4307.T) LMT
@5200 submitted and reads back as status=Submitted.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ly intervals

getCalendarDays matched intervals with /^(\d+)([dwhm])$/, but the actual
interval enum uses uppercase 1W / 1M / 1Q. So 'W'/'M'/'Q' never matched and
fell through to the 365-day fallback — weekly and monthly history was
silently capped at ~1 year (and the intended "weekly = 5 years" branch on
lowercase 'w' was dead code, since the enum emits 1W). Lowercase 'm'
(minutes) also collided conceptually with months.

Match the real units (case-sensitive so minutes 'm' ≠ months 'M') and give
each a sensible span: days 5y, weeks 10y, months 20y, quarters 30y. Verified:
CLOSE('SPY','1M') now returns 240 monthly bars back to 2006 (was ~13).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
CurrencyHistoricalDataSchema had open/high/low/volume/vwap as nullable but
close as a bare z.number(). A single null close bar (common in FX monthly/
weekly series, e.g. USDJPY) made the whole response fail zod validation with
"Expected number, received null". Equity/index/commodity historical models
already mark close nullable; align currency to match. Null bars are dropped
downstream by the indicator data filter.

Verified: CLOSE('USDJPY','1M') now returns 240 monthly bars back to 2006
(previously threw on validation).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…2026-06-01)

Document the day's fixes (commits c143cd7, 215007d, 9975a44, 6fb6e6a):
JP-stock quote/order/read-back via IBKR paper, extended historical lookback
for W/M/Q intervals, and null-tolerant currency historical schema. Includes
root causes, verification, and the 5-year SPY/ACWI/NRI comparison artifact.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Switch <html lang> from zh-CN to ja so Chrome stops offering to
translate the page, and prepend Japanese faces (Hiragino/Yu
Gothic/Meiryo/Noto Sans CJK JP) to --font-sans so Japanese glyphs
resolve instead of rendering as missing-glyph tofu. SC fonts kept
as trailing fallback for compatibility.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 3, 2026

@maxx-masa is attempting to deploy a commit to the luokerenx4's Team Team on Vercel.

A member of the Team first needs to authorize it.

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