22
33/**
44 * "What's new" dialog, shown once per update to every signed-in user. The API serves the changes
5- * since the build the user last acknowledged, parsed from the commit messages into structured
6- * entries; dismissing it records the current build so it never reappears for that version.
5+ * since the build the user last acknowledged, parsed from the commit messages; dismissing it
6+ * records the current build so it never reappears for that version.
77 *
8- * Design: sober "release notes" — no decorative icon . Each entry shows an icon derived from the
9- * commit's conventional-commit type (feat/fix/…), a clean title, and its long-form body tucked
10- * behind a "Details" toggle (commit bodies are verbose, so they stay collapsed by default) .
8+ * Design: deliberately sober "release notes" — no icons, no decoration . Each line is just the
9+ * commit's SUBJECT (its `type(scope):` prefix stripped, capitalised). The long, technical commit
10+ * BODY is intentionally NOT shown: it is internal detail, not end-user copy .
1111 */
1212import { useEffect , useState } from 'react' ;
1313import { createPortal } from 'react-dom' ;
14- import Markdown from 'react-markdown' ;
15- import remarkGfm from 'remark-gfm' ;
16- import { Check , Wrench , Zap , BookOpen , ChevronDown , X , type LucideIcon } from 'lucide-react' ;
14+ import { X } from 'lucide-react' ;
1715import { api } from '@/lib/api' ;
1816import { useAuth } from '@/lib/auth' ;
1917import { useT } from '@/lib/i18n' ;
@@ -30,49 +28,6 @@ interface WhatsNew {
3028 count ?: number ;
3129}
3230
33- // Map a conventional-commit type to a small, meaningful icon + tint. Anything unrecognised gets a
34- // neutral dot, so the list stays calm rather than noisy.
35- const TYPE_STYLE : Record < string , { icon : LucideIcon ; cls : string } > = {
36- feat : { icon : Check , cls : 'bg-violet-500/15 text-violet-300' } ,
37- fix : { icon : Wrench , cls : 'bg-amber-500/15 text-amber-300' } ,
38- perf : { icon : Zap , cls : 'bg-sky-500/15 text-sky-300' } ,
39- docs : { icon : BookOpen , cls : 'bg-white/[0.06] text-zinc-300' } ,
40- } ;
41-
42- function EntryRow ( { e } : { e : ChangelogEntry } ) {
43- const { t } = useT ( ) ;
44- const [ open , setOpen ] = useState ( false ) ;
45- const style = e . type ? TYPE_STYLE [ e . type ] : undefined ;
46- const Icon = style ?. icon ;
47-
48- return (
49- < li className = "flex gap-3" >
50- < span className = { `mt-0.5 grid h-6 w-6 shrink-0 place-items-center rounded-md ${ style ?. cls ?? 'text-zinc-600' } ` } >
51- { Icon ? < Icon size = { 14 } /> : < span className = "h-1.5 w-1.5 rounded-full bg-zinc-600" /> }
52- </ span >
53- < div className = "min-w-0 flex-1" >
54- < div className = "flex items-start justify-between gap-2" >
55- < p className = "text-[13.5px] leading-snug text-zinc-100" > { e . title } </ p >
56- { e . body && (
57- < button
58- onClick = { ( ) => setOpen ( ( o ) => ! o ) }
59- className = "mt-0.5 flex shrink-0 items-center gap-0.5 text-[11px] text-zinc-500 transition hover:text-zinc-300"
60- >
61- { t ( 'whatsnew.details' ) }
62- < ChevronDown size = { 12 } className = { `transition ${ open ? 'rotate-180' : '' } ` } />
63- </ button >
64- ) }
65- </ div >
66- { open && e . body && (
67- < div className = "md-prose mt-2 border-l border-white/10 pl-3 text-xs text-zinc-400" >
68- < Markdown remarkPlugins = { [ remarkGfm ] } > { e . body } </ Markdown >
69- </ div >
70- ) }
71- </ div >
72- </ li >
73- ) ;
74- }
75-
7631export function WhatsNew ( ) {
7732 const { user } = useAuth ( ) ;
7833 const { t } = useT ( ) ;
@@ -129,11 +84,13 @@ export function WhatsNew() {
12984
13085 < div className = "mx-6 mt-4 border-t border-white/[0.07]" />
13186
132- < ul className = "space-y-3.5 overflow-y-auto px-6 py-4 " >
87+ < ul className = "overflow-y-auto px-6 py-2 " >
13388 { entries . map ( ( e , i ) => (
134- < EntryRow key = { i } e = { e } />
89+ < li key = { i } className = "border-t border-white/[0.05] py-2.5 first:border-t-0" >
90+ < p className = "text-[13.5px] leading-snug text-zinc-200" > { e . title } </ p >
91+ </ li >
13592 ) ) }
136- { extra > 0 && < li className = "pl-9 text-xs italic text-zinc-500" > { t ( 'whatsnew.more' , { count : extra } ) } </ li > }
93+ { extra > 0 && < li className = "border-t border-white/[0.05] py-2.5 text-xs italic text-zinc-500" > { t ( 'whatsnew.more' , { count : extra } ) } </ li > }
13794 </ ul >
13895
13996 < div className = "border-t border-white/[0.07] px-6 py-3.5 text-right" >
0 commit comments