Skip to content

fix(web-studio): drop client-side heatmap tz rebucket (post-#2178/#2190 double-shift)#2194

Merged
t0saki merged 1 commit into
mainfrom
fix/heatmap-double-shift-after-tz-pr
May 22, 2026
Merged

fix(web-studio): drop client-side heatmap tz rebucket (post-#2178/#2190 double-shift)#2194
t0saki merged 1 commit into
mainfrom
fix/heatmap-double-shift-after-tz-pr

Conversation

@ZaynJarvis
Copy link
Copy Markdown
Collaborator

Summary

Hotfix: remove the client-side `shiftBucketToLocal` helper added in PR #2178.

PR #2190 (merge 0d63f0e) introduced server-side UTC→viewer-tz re-bucketing for the commit heatmap. The earlier PR #2178 (merge 4e94734) already shipped a client-side equivalent. With both in place every row gets shifted twice — today's bucket lands under tomorrow's local date for UTC+ viewers.

The revert was prepared on PR #2178's branch (commit 37e0450) but pushed after the PR had merged, so it never made it onto main. This PR applies the same revert directly to main.

Plan

`web-studio/src/routes/home/-lib/normalize.ts`:

Test plan

  • `pnpm build` clean
  • @ZaynJarvis to verify heatmap labels match local date after deploy

…er-side

PR #2178 (4e94734) shipped a `shiftBucketToLocal` helper that re-bucketed
the commit heatmap from UTC to viewer-local. PR #2190 (0d63f0e) landed
right after and added the equivalent shift server-side: backend now
accepts ?timezone= and returns rows already bucketed in the requested tz.
Keeping the client-side shift double-shifts every row by the viewer's tz
offset (e.g. UTC+8 ends up at UTC+16), so today's bucket displays under
the wrong local date.

This was supposed to be reverted on the #2178 branch before merge but the
revert commit (37e0450) was pushed after the PR had already been merged,
so it never reached main. Apply the same revert directly here.

normalizeCommitHeatmapData now keys the aggregation map by item.date as
the server returns it (already in viewer tz post-#2190).
@github-actions
Copy link
Copy Markdown

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 1 🔵⚪⚪⚪⚪
🏅 Score: 90
🧪 No relevant tests
🔒 No security concerns identified
✅ No TODO sections
🔀 No multiple PR themes
⚡ No major issues detected

@github-actions
Copy link
Copy Markdown

PR Code Suggestions ✨

No code suggestions found for the PR.

@ZaynJarvis
Copy link
Copy Markdown
Collaborator Author

Production verification for the reported post-#2190 issue:

  • ov.zaynjarvis.com/api/v1/console/context-commits for default/default with timezone=Asia/Shanghai returns the non-zero row on 2026-05-22 hour=16 (session_commit=5 at time of check), not 2026-05-23.
  • The current origin/main frontend still runs shiftBucketToLocal(item.date, item.hour), so in UTC+8 that API row is interpreted as UTC 2026-05-22 16:00 and displayed as 2026-05-23 00:00.
  • This PR removes the client-side rebucket and keeps the server-returned item.date, which matches the fix(observability): persist usage/audit in UTC and bucket per request tz #2190 backend contract.

Local validation from my side: pnpm --dir web-studio build passes.

Copy link
Copy Markdown
Collaborator

@t0saki t0saki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@t0saki t0saki merged commit a29a098 into main May 22, 2026
5 checks passed
@t0saki t0saki deleted the fix/heatmap-double-shift-after-tz-pr branch May 22, 2026 09:58
@github-project-automation github-project-automation Bot moved this from Backlog to Done in OpenViking project May 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants