Add WTO trade policy intelligence service with tariffs, flows, and barriers (#364)

* feat: add WTO trade policy service with 4 RPC endpoints and TradePolicyPanel

Adds a new `trade` RPC domain backed by the WTO API (apiportal.wto.org) for
trade policy intelligence: quantitative restrictions, tariff timeseries,
bilateral trade flows, and SPS/TBT barrier notifications.

New files: 6 protos, generated server/client, 4 server handlers + shared WTO
fetch utility, client service with circuit breakers, TradePolicyPanel (4 tabs),
and full API key infrastructure (Rust keychain, sidecar, runtime config).

Panel registered for FULL and FINANCE variants with data loader integration,
command palette entry, status panel tracking, data freshness monitoring, and
i18n across all 17 locale files.

https://claude.ai/code/session_01HZXyoQp6xK3TX8obDzv6Ye

* chore: update package-lock.json

https://claude.ai/code/session_01HZXyoQp6xK3TX8obDzv6Ye

* fix: move tab click listener to constructor to prevent leak

The delegated click handler was added inside render(), which runs
on every data update (4× per load cycle). Since the listener targets
this.content (a persistent container), each call stacked a duplicate
handler. Moving it to the constructor binds it exactly once.

https://claude.ai/code/session_01HZXyoQp6xK3TX8obDzv6Ye

---------

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Elie Habib
2026-02-25 10:50:12 +00:00
committed by GitHub
parent b238618e13
commit 07d0803014
79 changed files with 20275 additions and 26 deletions

8
.husky/pre-push Normal file
View File

@@ -0,0 +1,8 @@
echo "Running type check..."
npm run typecheck || exit 1
echo "Running Vite build (catches esbuild errors in server/)..."
npm run build:full || exit 1
echo "Running version sync check..."
npm run version:check || exit 1