diff --git a/generator/frontend/src/lib/renderWidgets.ts b/generator/frontend/src/lib/renderWidgets.ts index 5b6bbf8..5614493 100644 --- a/generator/frontend/src/lib/renderWidgets.ts +++ b/generator/frontend/src/lib/renderWidgets.ts @@ -36,6 +36,15 @@ export type PerWidgetSettings = { const esc = (s: string) => s.replace(/&/g,'&').replace(//g,'>').replace(/"/g,'"') const font = '-apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif' +const TAG_ACRONYMS = new Set(['ml','ai','ui','ux','api','cli','sql','css','html','js','ios']) +function formatTagLabel(tag: string): string { + return tag.split('-') + .map(w => TAG_ACRONYMS.has(w.toLowerCase()) + ? w.toUpperCase() + : w.charAt(0).toUpperCase() + w.slice(1)) + .join(' ') +} + function cardWrapper(inner: string, w: number, h: number, t: Theme, title: string, prefix = '') { const sid = `${prefix}shadow` return ` @@ -82,7 +91,7 @@ function renderGrade(data: GradeData, t: Theme, s?: { max_tags?: number }): stri let tagsSvg = '', tx = 0, ty = 0 for (const tag of tags) { const tc = TAG_COLORS[tag.tag] ?? t.accent - const label = tag.tag.replace(/-/g,' ').replace(/\b\w/g, c => c.toUpperCase()) + const label = formatTagLabel(tag.tag) const tw = Math.round(label.length * 6.6 + 18) const po = tag.source === 'earned' ? 0.9 : 0.55 if (tx + tw > 340) { tx = 0; ty += 30 } @@ -244,7 +253,7 @@ function achievementIconSvg(iconType: string, color: string): string { const icons: Record = { trophy: ``, medal: ``, - star: ``, + star: ``, hackathon: ``, } return icons[iconType] ?? icons.trophy diff --git a/generator/frontend/src/screens/WorkshopScreen.tsx b/generator/frontend/src/screens/WorkshopScreen.tsx index 9834e98..40d036b 100644 --- a/generator/frontend/src/screens/WorkshopScreen.tsx +++ b/generator/frontend/src/screens/WorkshopScreen.tsx @@ -19,47 +19,57 @@ const ALL_WIDGETS = [ { id: 'achievements', label: 'Achievements' }, ] -// Inline SVGs keep parity with the backend (generator/src/widgets/achievements.py) -// and render deterministically across platforms where emoji coverage varies. +// Lucide-style hollow glyphs: consistent stroke-weight + viewBox so the 4 +// buttons line up and read as one icon family. Kept as JSX so they inherit +// currentColor from the surrounding button's text color. +const ICON_SVG_PROPS = { + width: 16, + height: 16, + viewBox: '0 0 24 24', + fill: 'none', + stroke: 'currentColor', + strokeWidth: 1.75, + strokeLinecap: 'round' as const, + strokeLinejoin: 'round' as const, +} + const ICONS: { id: string; svg: ReactNode }[] = [ { id: 'trophy', svg: ( - - - - - - + + + + + + + ), }, { id: 'medal', svg: ( - - - - + + + ), }, { id: 'star', svg: ( - - + + ), }, { id: 'hackathon', svg: ( - - - - - + + + ), }, @@ -372,22 +382,24 @@ export function WorkshopScreen({ {settings.achievements.map((ach, idx) => (
- {ICONS.map(ic => ( - - ))} + + ) + })}