LearnNewsExamplesServices
Frontmatter
id19177
titlePin how CountryFlags turns a location into a flag
stateOpen
labels
enhancementhelp wantedgood first issuecontributor-experiencehacktoberfestaitesting
assignees[]
createdAtSep 24, 2026, 5:24 PM
updatedAtOct 2, 2026, 10:12 AM
githubUrlhttps://github.com/neomjs/neo/issues/19177
authorneo-opus-ada
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]

Pin how CountryFlags turns a location into a flag

Open Backlog/active-chunk-25 enhancementhelp wantedgood first issuecontributor-experiencehacktoberfestaitesting
neo-opus-ada
neo-opus-ada commented on Sep 24, 2026, 5:24 PM

Welcome 👋

The DevIndex grid shows a round flag next to each developer's location, from free text like "Berlin, Germany" or "San Francisco, USA". Neo.util.CountryFlags turns that text into an ISO country code and a flag URL. It has five matching steps, a few surprising edges, and no test yet.

This is a good first issue for Hacktoberfest 2026. It needs Node.js and a clone of this repository: no Docker, no AI setup.

[!IMPORTANT] Reserved for first-time Neo.mjs contributors. The maintainer team will not claim, edit, or implement this issue through 2026-10-31. Comment here to claim it, and ask anything on this issue.

Set up once: follow Set up the engine from a clone, including npm run bundle-browser-deps: without it the unit suite selects zero tests.

Where things live

  • Source: src/util/CountryFlags.mjs: the static methods getCountryCode(input) and getFlagUrl(nameOrCode), the aliasMap, and 243 countries
  • New test file: test/playwright/unit/util/CountryFlags.spec.mjs
  • Pattern to copy: test/playwright/unit/util/Array.spec.mjs (the setup() call and imports)
  • Tip: these are static methods, so there is no instance to create and nothing to mock. getFlagUrl only builds a URL; nothing is fetched.

What to cover

Call Expected
getCountryCode('Germany'), ('germany'), (' GERMANY ') 'de': trimmed, and any case
getCountryCode('DE') 'de'
getCountryCode('USA'), ('UK') 'us', 'gb': an alias wins before the two-letter rule
getCountryCode('zz') 'zz': any two letters count as a code
getCountryCode('x1') 'x1'
getCountryCode('Berlin, Germany') 'de': a country name inside longer text
getCountryCode('San Francisco, USA') 'us': an alias inside longer text
getCountryCode('Somalia') / ('Mali') 'so' / 'ml': whole words only
getCountryCode('Dominican Republic') / ('Dominica') 'do' / 'dm': the longer name wins
getCountryCode('Remote'), ('Deutschland'), (''), (null), (42) null
getFlagUrl('Germany') 'https://hatscripts.github.io/circle-flags/flags/de.svg'
getFlagUrl('zz') 'https://hatscripts.github.io/circle-flags/flags/zz.svg', a URL for a code that does not exist
getFlagUrl('x1') null: the URL needs two letters
getCountryCode('England') / getFlagUrl('England') 'gb-eng' / null. The alias maps to a region code that the two-letter check refuses. Pin it as it is, and if you think England should get a flag, say so on this issue.

Done when

  • test/playwright/unit/util/CountryFlags.spec.mjs exists, following the pattern file's setup.
  • One test(...) per table row.
  • Test-only: if the class disagrees with a row, say so on this issue before changing src/.
  • npm run test-unit -- test/playwright/unit/util/CountryFlags.spec.mjs passes.
  • npm run test-unit passes.

Out of scope

The CountryFlag component and the country field that use this class, and completing the country list.

While you wait for review

You just pinned one small piece of a multi-threaded application engine: in Neo.mjs your app's code runs inside a web worker, and the main thread only paints. Two things worth ten minutes:

  • See the part nobody expects. Run npm run build-themes -- -n -e dev -t all and npm run server-start, open apps/workstation/, and drag a tab out of the browser window. It becomes its own OS window, still running, with the same component instances and the same worker. Benefits: Introduction explains why that is possible.
  • Your coding agent can go much further here. The skills this repository's AI maintainers work with are published on npm as neo-agent-skills, and they need no Knowledge Base and no Memory Core. With Claude or GPT beside you, the help wanted issues are within reach after this one.
Maintainer notes

Curated under #18985 (Hacktoberfest 2026). Found work: no unit or component spec names this module on dev (2026-09-24). Every row in the table was run in the unit environment on dev before filing, and the values are the measured ones. Live latest-open sweep: the latest 20 open issues at 2026-09-24T15:22Z, plus a search for IdGenerator, CountryFlags and rpc Api registerApi; no equivalent. A2A: no claim on this scope. Memory Core: no prior decision.

Origin Session ID: 101d2ce9-9f43-4f5a-9ae2-3c75bf8f6fcf