OpenStock icon indicating copy to clipboard operation
OpenStock copied to clipboard

Override Taiwan country label

Open keshav-005 opened this issue 7 months ago • 3 comments

Summary

  • override the signup country label for TW to display Taiwan
  • keep the existing country list library and only adjust the rendered label for that entry

Test plan

  • npx eslint components/forms/CountrySelectField.tsx

Fixes Open-Dev-Society/OpenStock#34

Summary by CodeRabbit

  • Bug Fixes
    • Fixed country label display so overridden names (e.g., Taiwan) show correctly and consistently in both the dropdown and the selected value.

keshav-005 avatar Apr 22 '26 15:04 keshav-005

@keshav-005 is attempting to deploy a commit to the ravixalgorithm's projects Team on Vercel.

A member of the Team first needs to authorize it.

vercel[bot] avatar Apr 22 '26 15:04 vercel[bot]

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 0cb2fbb0-9c45-4c4c-ae68-cbaac2ec7d95

📥 Commits

Reviewing files that changed from the base of the PR and between b51768973f80549172f53139edfe831893614fa2 and 2a339c6d711dbddd78dd5c192d125d3e4b221cba.

📒 Files selected for processing (1)
  • components/forms/CountrySelectField.tsx

📝 Walkthrough

Walkthrough

Reworked the country select to apply a label-overrides map (e.g., TW → Taiwan) by building a precomputed COUNTRY_OPTIONS array from countryList().getData() and using it for both the dropdown and selected label lookup; removed the previous local countries variable.

Changes

Cohort / File(s) Summary
Label override & options generation
components/forms/CountrySelectField.tsx
Added COUNTRY_LABEL_OVERRIDES and COUNTRY_OPTIONS derived from countryList().getData(); apply overridden labels when building option labels and when resolving the selected-country label; removed local countries variable.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 I hopped in with a careful tweak,
A label fixed for the island meek.
Now Taiwan’s name stands calm and clear,
A tiny flourish, full of cheer. 🎋

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Override Taiwan country label' directly and clearly describes the main change of overriding the Taiwan country label in the CountrySelectField component.
Linked Issues check ✅ Passed The PR implements the objective from issue #34 by introducing a country label override for Taiwan (TW → Taiwan) to correct its representation and ensure it is not shown as a province of China.
Out of Scope Changes check ✅ Passed All changes in the PR are scoped to the CountrySelectField component and directly address the Taiwan label override requirement; no unrelated or out-of-scope modifications are present.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • [ ] Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

coderabbitai[bot] avatar Apr 22 '26 15:04 coderabbitai[bot]

Updated with a small follow-up: the static country list is now hoisted so the label override data isn’t rebuilt on each render.

keshav-005 avatar Apr 22 '26 15:04 keshav-005