fix: don't echo unknown region codes as their name in the by-region table
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 72/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- typescript
- 領域
- frontend
調査の方向性
lib/utils.ts の countryName から始めてください。ここでは Intl.DisplayNames が fallback オプションなしで作成されています。また blocks/charts/region-map.tsx の REGION_ALIASES も確認してください。未知のコード(EL や XX など)が名前を表示しないように fallback: "none" を設定し、テーブルが対応付けられた国を検索できるよう、エイリアスマップを lib/regions.ts に移動してください。EL、XX、UK を宣言したフィクスチャが "greece"、名前なし、"united kingdom" を表示し、pnpm typecheck と pnpm lint が通れば完了です。この issue は #45 に依存しているため、まずその変更がマージ済みかを確認してください。
索引モデルが issue の本文から書いたものです。
説明
Spotted while building the world map (#45).
Problem
The by-region table shows each code's country name next to it, via countryName (lib/utils.ts after #45, before that in blocks/by-region.tsx). Intl.DisplayNames defaults to fallback: "code", so for a code it doesn't know it returns the code itself, which we lowercase:
| declared | shown |
|---|---|
EL |
EL el |
XX |
XX xx |
UK |
UK united kingdom (Intl knows this one) |
EL is the EU's code for Greece, and the map (#45) already draws it on GR through REGION_ALIASES, so the table and the map disagree.
Solution
- In
countryName, passfallback: "none"toIntl.DisplayNames. It then returnsundefinedfor an unknown code, so the existing?? ""shows no name:
Checked in Node:const regionNames = new Intl.DisplayNames(["en"], { type: "region", fallback: "none", })EL/XX→undefined,UK/GB→ "United Kingdom",GR→ "Greece". - Name an aliased code after the country the map draws it on. Move
REGION_ALIASESfromblocks/charts/region-map.tsxtolib/regions.ts, and have the table look upcountryName(REGION_ALIASES[code] ?? code), soELreads "greece". The code column still shows what was declared.
Out of scope: rewriting declared codes in the indexer (regionCode in worker/src/stats.ts), which would split history between the old and new code.
Verify
pnpm typecheck && pnpm lint, then with a local fixture (see CLAUDE.md) that declares EL, XX and UK, check that the table shows "greece", no name, and "united kingdom".
🤖 Generated with Claude Code
- 主要言語
- TypeScript
- スター
- 2
- フォーク
- 0
- 平均マージ
- 9時間 7分
- マージ済み PR(30日)
- 53
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
decdn/stats のほかの issue
-
feat: add a world map of nodes by region対応中かも @yigitdot が 22 日前に担当しました。 オープンenhancement
難易度 4/5 3〜5日 初心者へのやさしさ 22/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
Nimblesite/SharpLsp#468 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
Bundled uv is never updated and trusts the compromised eMudhra certificates対応中かも @FabienDanieau が今日担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
bg_wait's blocking mode (stopOnAttention: false) is under-documented and effectively undiscoverableオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
nicobailon/pi-subagents#3019 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
db-ux-design-system/core-web#8613 ·
メンテナーはふだん 1 日以内に返信