At the moment, the code.quarkus.io UI shows categories which can't be found in the platform's list of categories (such as "artificial-intelligence", rather than "ai" or "Artificial Intelligence"). This is happening because it's exposing the name in the UI, but doing some transformations to make it suitable for use in query strings. It should show the name ("Artificial Intelligence") in the UI, and then use the id in the query string/slug.
This is the pattern extensions.quarkus.io uses*, so it would be good to be consistent. I also think it's most user-friendly. It avoids showing hyphens in the UI, which @cescoffier thought looked a bit awkward. It also ensures everything in the query string maps to a category that we'd want extension authors to be putting into their extension yaml.
- sort of – extensions.quarkus.io does it's own prettifying mapping, so that also needs to be fixed.
Here's the details of the current behaviour, from Claude:
- Extensions like LangChain4j/Bedrock reference "categories": ["ai"] — that's the short id.
- Backend Java (QuarkusExtensionUtils.java:62) resolves the id to the full Category object and uses cat.getName(): .category(cat.getName()) // "Artificial Intelligence"
- So the REST API sends "category": "Artificial Intelligence" (the human-readable name) to the frontend.
- Frontend (extensions-utils.ts:283-285) converts that display name into a URL-friendly slug via catToId():
function catToId(category?: string): string { return category?.toLowerCase().replace(' ', '-').replace(/\s+.+$/i, ''); }
- "Artificial Intelligence" → lowercase → "artificial intelligence" → first space to hyphen → "artificial-intelligence" → regex removes nothing (no remaining whitespace) → "artificial-intelligence"
- Search/filter (extensions-utils.ts:28) matches URL queries like category:artificial-intelligence against the catToId-transformed value: {keys: ['category', 'cat'], valueSupplier: e => catToId(e.category)},
At the moment, the code.quarkus.io UI shows categories which can't be found in the platform's list of categories (such as "artificial-intelligence", rather than "ai" or "Artificial Intelligence"). This is happening because it's exposing the name in the UI, but doing some transformations to make it suitable for use in query strings. It should show the name ("Artificial Intelligence") in the UI, and then use the id in the query string/slug.
This is the pattern extensions.quarkus.io uses*, so it would be good to be consistent. I also think it's most user-friendly. It avoids showing hyphens in the UI, which @cescoffier thought looked a bit awkward. It also ensures everything in the query string maps to a category that we'd want extension authors to be putting into their extension yaml.
Here's the details of the current behaviour, from Claude:
function catToId(category?: string): string { return category?.toLowerCase().replace(' ', '-').replace(/\s+.+$/i, ''); }