Implement aligned trend findings and editable tags#217
Conversation
There was a problem hiding this comment.
Risk assessment: Medium-High. Code review is required, so I am not approving this PR.
Evidence from the diff: the PR changes multiple production user-facing analytics surfaces (trends, insights, editable entry tags), adds shared chart-axis behavior, and changes backend yearly timeseries output from monthly buckets to 365 daily points. That creates meaningful UI regression and payload/performance risk, but no auth, schema migration, deployment, or security-boundary change.
Reviewer assignment: I did not request reviewers because the changed-file history and repository collaborator list only show the PR author plus automation/bot accounts, and there is no CODEOWNERS file. Please request an eligible human reviewer with frontend analytics and backend stats context.
Sent by Cursor Automation: Assign PR reviewers
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b9d4cb33d0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| $: axisStart = | ||
| tagHeatmap?.start_date ?? symptomHeatmap?.start_date ?? points[0]?.period_start ?? ''; | ||
| $: axisEnd = | ||
| tagHeatmap?.end_date ?? | ||
| symptomHeatmap?.end_date ?? | ||
| points[points.length - 1]?.period_end ?? | ||
| points[points.length - 1]?.period_start ?? | ||
| ''; | ||
| $: axisDates = axisStart && axisEnd ? buildIsoDateRange(axisStart, axisEnd) : []; |
There was a problem hiding this comment.
Align timeseries to the same local date window
When the browser's local date differs from UTC (for example, US evening after 00:00 UTC), the heatmap window comes from dateWindow() using localIsoDate(new Date()), while fetchTimeseries(range) still uses the backend's UTC _today(). Because this new shared axis prefers tagHeatmap.start_date/end_date and buildDailyAxisLinePoints only plots points whose dates are on that axis, the latest UTC timeseries point is dropped and the first local heatmap day has no line point. Please derive both requests from the same as-of/end date, or make the axis include the union of the returned timeseries and heatmap dates.
Useful? React with 👍 / 👎.


Summary
Documentation
docs/FRONTEND.md: entry TagPicker create flow, Insights symptom toggle, Trends shared daily axis/layer persistence, component map.docs/frontend/SYMPTOM_VISUALIZATION.md: status changed to partially implemented, implemented subset and acceptance criteria updated.docs/features/symptom-analytics.md: implementation note for the frontend-only descriptive slice.docs/ARCHITECTURE.mdanddocs/DESIGN_DOCUMENT.md: clarify shipped UI context vs. pending inferential analytics.Testing
pnpm --dir apps/web test -- src/lib/utils/charts.test.ts src/lib/components/trends/MetricTimeseries.test.ts src/lib/components/insights/InsightFeed.test.ts src/lib/components/entries/TagPicker.test.tspnpm --dir apps/web lintbackend/.venv/bin/python -m pytest tests/test_stats_service.py --no-covbackend/.venv/bin/python -m ruff check app/services/stats_service.py tests/test_stats_service.pypnpm --dir apps/web exec prettier --write ../../docs/FRONTEND.md ../../docs/frontend/SYMPTOM_VISUALIZATION.md ../../docs/features/symptom-analytics.md ../../docs/ARCHITECTURE.md ../../docs/DESIGN_DOCUMENT.mdandgit diff --checkNote:
backend/.venv/bin/python -m pytest tests/test_stats_service.pypasses the selected tests but exits non-zero because the repository-wide coverage gate is enforced on a single-file run.