--- created: 2026-09-05 status: done requirements: - REQ-UI-TASK-PROMPT-TRANSCRIPT-VISIBILITY-001 system_design: - ../../specs/ui/system-design/task-prompt-transcript-visibility.md legacy_specs: [] --- # Implementation Plan: Suppress invalid task timestamps ## Overview Prevent the task transcript from displaying the browser's `Invalid Date` text when it renders the frontend-only task-description fallback. The fallback has content but no persisted message timestamp, so the timestamp action is omitted; the shared legacy relative formatter also returns an empty label for malformed input. The implementation is one sequential frontend slice with focused unit regressions. ## Root cause `useProcessedMessages` creates `TASK_DESCRIPTION_SYNTHETIC_ID` with `created_at: ""` when history is exhausted without a stored user prompt. `MessageActions` always renders `MessageTimestamp`, and the legacy `formatRelativeTime` helper treats the invalid `Date` as though its numeric comparisons were valid before falling through to `date.toLocaleDateString()`. The browser therefore supplies the visible string `Invalid Date`. ## Scope ### In scope - Validate a message timestamp before rendering the timestamp action and its absolute-time disclosure. - Make the shared legacy relative formatter return an empty string for empty or malformed input. - Add unit coverage for the observed synthetic fallback path and the shared formatter contract. ### Out of scope - Changing task-description fallback eligibility, message persistence, or API timestamp fields. - Adding a new mobile composition or changing action-row sizing, touch targets, navigation, or scrolling. - Reworking the separate locale-aware formatter in `lib/i18n/formats.ts`. ## Technical approach - `apps/web/lib/utils.ts`: return `""` immediately when the parsed date is invalid in `formatRelativeTime`, using the shared strict parser. - `apps/web/lib/utils/strict-timestamp.ts`: centralize strict RFC3339 calendar, clock, offset, and fractional-second validation for timestamp consumers. - `apps/web/components/task/chat/messages/message-actions.tsx`: validate - `createdAt` in `MessageTimestamp` with the shared parser before deriving the absolute label or mounting the `