fix: eliminate frontend's own static mock data and fake fallback behavior - #12
Merged
Conversation
…vior
The frontend had a whole separate layer of fabricated data, untouched
by the backend Graph API migration:
- api.ts hardcoded mockEmails/mockTasks/mockMeetings and fell back to
them on any empty fetch result, indistinguishable from real data.
Failed/empty fetches now return [] instead.
- frontend/public/data/*.json -- a tree of static fixtures (fake
inbox, fake meetings, MoM entries whose meeting_ids matched no real
meeting, fake tasks/users/wellness config) -- deleted; nothing reads
it anymore.
- activity/page.tsx ("AI Agent Activity") was the worst offender: its
entire event feed, agent-created tasks/followups, and proactive
alerts were hardcoded fake initial state, and "process email" faked
a "thinking -> action -> observation -> completed" narrative via
chained setTimeout calls without ever calling a real endpoint. Real
infrastructure for this already existed
(backend/routes_agent.py's /agent/process-email + /agent/events)
and was simply never called. Rewritten so all state starts empty and
loads from real fetches, and "process email" calls the real
processEmailNow()/fetchAgentEvents().
- wellness/page.tsx fell back to a fabricated score (72) and a
fabricated factor breakdown when the API didn't return one; now
renders an honest "no data yet" state instead.
Added the two Next.js proxy routes activity/page.tsx needs
(api/agent/process-email, api/agent/events) and the corresponding
api.ts functions (processEmailNow, fetchAgentEvents, plus
fetchMoodHistory/fetchBreakSuggestions/fetchEODReport/fetchWeeklyReport/
fetchAuditLog/fetchLLMUsage/fetchPendingActions calling real backend
endpoints instead of static files).
Verified with `tsc --noEmit` (clean) and `next build` (succeeds, all
23 routes compile).
Closes #10
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
mockEmails/mockTasks/mockMeetingsfromapi.ts; failed/empty fetches now return[]. Updatedmail/tasks/calendarpages that depended on the olddata.length > 0 ? data : mockXfallback.frontend/public/data/(fake inbox, meetings, MoM entries with mismatchedmeeting_ids, tasks, users, wellness config) — dead fixtures, nothing reads them.activity/page.tsx: this was the worst offender — its whole event feed, agent-created tasks/followups, and alerts were hardcoded fake data, and "process email" faked a multi-step narrative viasetTimeoutwithout ever hitting a real endpoint. Now populates from real fetches (fetchTasks,fetchFollowups,fetchAgentEvents,fetchProactiveNotifications) and calls the realPOST /agent/process-email(already existed inbackend/routes_agent.py, just never wired up).wellness/page.tsx: fabricated score (72) and fabricated factor-breakdown fallback replaced with an honest "no data yet" state.activity/page.tsxneeds, andprocessEmailNow/fetchAgentEvents/fetchMoodHistory/fetchBreakSuggestions/fetchEODReport/fetchWeeklyReport/fetchAuditLog/fetchLLMUsage/fetchPendingActionsinapi.ts(all calling real backend endpoints).Test plan
npx tsc --noEmit— clean (also fixed 2 unrelated pre-existing type errors it surfaced:Meeting.subject→.titleon the dashboard, implicit-any on the wellness factors map)npm run build— succeeds, all 23 routes compilepublic/dataCloses #10
🤖 Generated with Claude Code