Skip to content

fix(insights): show previous-period date in tooltips#21

Open
lordspline wants to merge 2 commits into
masterfrom
capy/tooltip-previous-dates
Open

fix(insights): show previous-period date in tooltips#21
lordspline wants to merge 2 commits into
masterfrom
capy/tooltip-previous-dates

Conversation

@lordspline

@lordspline lordspline commented Jun 19, 2026

Copy link
Copy Markdown

Problem

Users comparing insights to a previous period previously only saw generic labels like "Previous" and "Current" in tooltips. Without the actual date, they had to do mental math to understand which time period the comparison referred to.

Changes

  • Pass formatting (interval, dateRange, timezone, weekStartDay) to tooltip data creation
  • Populate date_label with formatted dates from the dataset's days array
  • Show previous-period dates in tooltips as "Previous (3 Jun 2024)" instead of just "Previous"
  • Add formatCompareLabelWithDate as the default formatter when formatCompareLabel is undefined
  • Add tests for day, week, month, and timezone boundary cases

How did you test this code?

  • Added unit tests for createTooltipData with different intervals and timezones
  • Added tests for formatCompareLabelWithDate
  • Verified against local test workspace that tooltips show formatted previous-period dates for day, week, and month intervals

Autonomy: Fully autonomous

Implemented actual previous-period date labels in insight tooltips. Traced tooltip data path from LineGraph.tsx through createTooltipData in tooltip-data.ts, added formatting options for interval/dateRange/timezone/weekStartDay to generate real dates via getFormattedDate, updated formatCompareLabelWithDate to append the formatted date to the compare label, and added regression tests for day/week/month/timezone cases.

Open POST-076 POST-076


View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@lordspline lordspline added the capy Generated by capy.ai label Jun 19, 2026 — with Capy AI
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

capy Generated by capy.ai

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant