fix(web): label the Home activity summary as the last 24 hours (UF-056)
The summary always covers the last 24 hours, but it read "While you slept" and "A calm night" at any time of day.
This commit is contained in:
@@ -590,7 +590,7 @@ function composeOvernightStory(o: OvernightSummary): ReactNode {
|
||||
|
||||
return (
|
||||
<>
|
||||
Overnight, Waggle{' '}
|
||||
In the last 24 hours, Waggle{' '}
|
||||
{clauses.map((c, i) => (
|
||||
<span key={i}>
|
||||
{i > 0 && (i === clauses.length - 1 ? (clauses.length === 2 ? ' and ' : ', and ') : ', ')}
|
||||
@@ -826,13 +826,15 @@ const HomeCockpit = ({ onContinue, onOpenWorkspaceDesktop, onCreateWorkspace, us
|
||||
};
|
||||
|
||||
// Overnight hero copy: compose the story from real counts; degrade to a quiet
|
||||
// line when there's no activity (the test stubs overnight → null).
|
||||
// line when there's no activity (the test stubs overnight → null). The
|
||||
// summary covers the last 24 hours whatever the time of day, so the copy
|
||||
// says that instead of "overnight" (UF-056).
|
||||
const hasOvernight = overnightHasActivity(overnight);
|
||||
const overnightStatement = hasOvernight ? composeOvernightStory(overnight) : null;
|
||||
const runChips = hasOvernight ? buildRunChips(overnight) : [];
|
||||
const overnightEmpty = offline
|
||||
? 'Your overnight summary needs the local service.'
|
||||
: 'A calm night — nothing ran while you were away.';
|
||||
? 'Your daily summary needs the local service.'
|
||||
: 'Nothing ran in the last 24 hours.';
|
||||
|
||||
// Wave F (fix 2): factual hero deltas for a returning user — reuse the
|
||||
// briefing's own card data (most recent activity + attention debt), no fetch.
|
||||
|
||||
@@ -5,7 +5,7 @@ import { RunChip, type RunChipProps } from './RunChip';
|
||||
|
||||
interface OvernightHeroProps {
|
||||
eyebrow?: string;
|
||||
/** The "While you slept …" statement; embed honey spans for key numbers.
|
||||
/** The last-24-hours statement; embed honey spans for key numbers.
|
||||
* The caller owns the empty-night fallback line — the statement always
|
||||
* renders, whether or not chips accompany it (H2: single-clause stories
|
||||
* pass no chips, since a lone chip would just repeat the sentence). */
|
||||
@@ -20,7 +20,7 @@ interface OvernightHeroProps {
|
||||
* see PR3-BUILD-PLAN §5).
|
||||
*/
|
||||
export function OvernightHero({
|
||||
eyebrow = 'While you slept',
|
||||
eyebrow = 'Last 24 hours',
|
||||
statement,
|
||||
runs = [],
|
||||
className,
|
||||
|
||||
Reference in New Issue
Block a user