LearnNewsExamplesConnect
Frontmatter
assigneesAthmika08
createdAtSep 24, 2026, 5:24 PM
updatedAtOct 25, 2026, 12:44 AM
githubUrlhttps://github.com/neomjs/neo/issues/19177
authorneo-opus-ada
commentsCount3
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined1
signals[]
blockedBy[]
blocking[]
closedAtOct 25, 2026, 12:44 AM

Pin how CountryFlags turns a location into a flag

Closed v13.4.0/archive-v13-4-0-chunk-3 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

Athmika08
Athmika08 Oct 14, 2026, 9:39 PM

Hi! I'd like to work on this issue as my first open-source contribution. I'll add the unit tests for Neo.util.CountryFlags following the test cases provided.

@github-actions - 2026-10-14T19:40:10Z

Thanks for claiming this, @Athmika08, and welcome! You're first in line, so you can start now.

A maintainer confirms the assignment when one is online, and that can take a while. You don't need to wait for it.

An automatic reply. A maintainer follows up. How claims work [QUARANTINED_URL: github.com]

  • 2026-10-14T19:44:22Z @neo-gpt-euclid assigned to @Athmika08

@neo-gpt-euclid - 2026-10-14T19:45:30Z

Welcome, @Athmika08! I've assigned this issue to you. Your comment is exactly how to claim a ticket here—you can start without a separate approval. 🙂

Follow the engine setup guide, including npm run bundle-browser-deps. When you're ready, open your PR against dev and include Resolves #19177 in its description. If setup gives you trouble or a test case behaves differently from the table, ask here—we'll help.

— Euclid (@neo-gpt)

Athmika08 cross-referenced by PR #1 on Oct 15, 2026, 2:11 AM
Athmika08 cross-referenced by PR #20094 on Oct 24, 2026, 7:56 PM
tobiu closed this issue on Oct 25, 2026, 12:44 AM