this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Wire up NEW project badge in day view UI

Parse isNew flags from brag summary JSON and pass to ProjectCard components.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

alice 293f2cdf 5f2fc2b6

+35 -6
+6 -2
src/web/app/components/BragSummary.tsx
··· 6 6 } 7 7 8 8 interface DailySummary { 9 - projects: { name: string; summary: string }[]; 9 + projects: { name: string; summary: string; isNew?: boolean }[]; 10 10 } 11 11 12 12 function parseSummary(summary: string): DailySummary | null { ··· 60 60 <ul className="space-y-1.5"> 61 61 {parsed.projects.map((project, i) => ( 62 62 <li key={i} className="text-sm"> 63 - <span className="font-semibold text-slate-800">{project.name}:</span>{' '} 63 + <span className="font-semibold text-slate-800">{project.name}</span> 64 + {project.isNew && ( 65 + <span className="ml-1.5 px-1.5 py-0.5 text-xs font-medium bg-green-100 text-green-700 rounded">NEW</span> 66 + )} 67 + <span className="text-slate-800">:</span>{' '} 64 68 <span className="text-slate-600">{project.summary}</span> 65 69 </li> 66 70 ))}
+23 -2
src/web/app/components/DayView.tsx
··· 1 - import React from 'react'; 1 + import React, { useMemo } from 'react'; 2 2 import { useParams, Link } from 'react-router-dom'; 3 3 import { ArrowLeft } from 'lucide-react'; 4 4 import { useDayDetail } from '../hooks/useWorklog'; 5 5 import BragSummary from './BragSummary'; 6 6 import ProjectCard from './ProjectCard'; 7 7 8 + // Parse brag summary to extract isNew flags by project name 9 + function parseNewProjects(bragSummary: string | undefined): Set<string> { 10 + if (!bragSummary) return new Set(); 11 + try { 12 + const parsed = JSON.parse(bragSummary); 13 + if (parsed.projects && Array.isArray(parsed.projects)) { 14 + return new Set( 15 + parsed.projects 16 + .filter((p: { isNew?: boolean }) => p.isNew) 17 + .map((p: { name: string }) => p.name) 18 + ); 19 + } 20 + } catch {} 21 + return new Set(); 22 + } 23 + 8 24 export default function DayView() { 9 25 const { date } = useParams<{ date: string }>(); 10 26 const { day, loading, error } = useDayDetail(date); 27 + 28 + const newProjects = useMemo( 29 + () => parseNewProjects(day?.bragSummary), 30 + [day?.bragSummary] 31 + ); 11 32 12 33 if (loading) return <div className="text-center py-20 text-slate-400">Loading day details...</div>; 13 34 if (error || !day) return <div className="text-center py-20 text-red-500">Error: {error || 'Day not found'}</div>; ··· 33 54 34 55 <div className="space-y-3"> 35 56 {day.projects.map((project) => ( 36 - <ProjectCard key={project.path} project={project} /> 57 + <ProjectCard key={project.path} project={project} isNew={newProjects.has(project.name)} /> 37 58 ))} 38 59 </div> 39 60 </div>
+6 -2
src/web/app/components/ProjectCard.tsx
··· 20 20 21 21 interface Props { 22 22 project: ProjectDetail; 23 + isNew?: boolean; 23 24 } 24 25 25 - export default function ProjectCard({ project }: Props) { 26 + export default function ProjectCard({ project, isNew }: Props) { 26 27 const [expanded, setExpanded] = useState(true); 27 28 28 29 return ( ··· 35 36 <div className="p-1.5 bg-blue-100 text-blue-600 rounded"> 36 37 <Folder size={16} /> 37 38 </div> 38 - <div> 39 + <div className="flex items-center gap-2"> 39 40 <h3 className="text-sm font-bold text-slate-800">{project.name}</h3> 41 + {isNew && ( 42 + <span className="px-1.5 py-0.5 text-xs font-medium bg-green-100 text-green-700 rounded">NEW</span> 43 + )} 40 44 </div> 41 45 </div> 42 46 <div className="flex items-center gap-3 text-slate-500">