Skip to content

fix: eliminate frontend's own static mock data and fake fallback behavior - #12

Merged
kowshikdev merged 1 commit into
mainfrom
fix/frontend-mock-data
Jul 23, 2026
Merged

fix: eliminate frontend's own static mock data and fake fallback behavior#12
kowshikdev merged 1 commit into
mainfrom
fix/frontend-mock-data

Conversation

@kowshikdev

Copy link
Copy Markdown
Owner

Summary

  • Removed mockEmails/mockTasks/mockMeetings from api.ts; failed/empty fetches now return []. Updated mail/tasks/calendar pages that depended on the old data.length > 0 ? data : mockX fallback.
  • Deleted frontend/public/data/ (fake inbox, meetings, MoM entries with mismatched meeting_ids, tasks, users, wellness config) — dead fixtures, nothing reads them.
  • Rewrote 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 via setTimeout without ever hitting a real endpoint. Now populates from real fetches (fetchTasks, fetchFollowups, fetchAgentEvents, fetchProactiveNotifications) and calls the real POST /agent/process-email (already existed in backend/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.
  • Added the two Next.js proxy routes activity/page.tsx needs, and processEmailNow/fetchAgentEvents/fetchMoodHistory/fetchBreakSuggestions/fetchEODReport/fetchWeeklyReport/fetchAuditLog/fetchLLMUsage/fetchPendingActions in api.ts (all calling real backend endpoints).

Test plan

  • npx tsc --noEmit — clean (also fixed 2 unrelated pre-existing type errors it surfaced: Meeting.subject.title on the dashboard, implicit-any on the wellness factors map)
  • npm run build — succeeds, all 23 routes compile
  • Manual grep sweep confirms no remaining references to the deleted mock constants or public/data

Closes #10

🤖 Generated with Claude Code

…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>
@kowshikdev
kowshikdev merged commit 33d5cea into main Jul 23, 2026
2 checks passed
@kowshikdev
kowshikdev deleted the fix/frontend-mock-data branch July 23, 2026 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Frontend has its own static mock data and fake fallback behavior, independent of the backend

1 participant