Skip to content

feat: override the time zone on the search and dashboard pages - #3495

Merged
kodiakhq[bot] merged 7 commits into
mainfrom
claude/hdx-5741-timezone-override
Nov 4, 2026
Merged

kodiakhq[bot] merged 7 commits into
mainfrom
claude/hdx-5741-timezone-override

Conversation

@karl-power

@karl-power karl-power commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds a time zone selector to the time picker on the search and dashboard pages. It overrides the User Preferences time zone for that page only and is kept in the tz URL param.

  • TimeZoneOverrideProvider reads tz; useDisplayTimeZone prefers it over the user setting, so everything on the page switches together. Unknown values are ignored.
  • The picker input shows the zone in use (e.g. UTC-7), highlighted when it isn't the browser's. The popover ends with the selector plus "Default", "UTC" and "Local" buttons; User Preferences gets "UTC" and "Local".
  • Short zone labels are UTC offsets instead of abbreviations (UTC-7, not PDT). The selector shows the offset on each option and the selected value, and searches by it.
  • Links from charts and tables to Search and other dashboards carry tz. External links don't.

The override isn't saved with saved searches or dashboards.

Screenshots or video

Screenshot 2026-10-30 at 10 39 50 Screenshot 2026-10-30 at 10 40 02

How to test on Vercel preview

Preview routes: /search, /dashboards

Steps:

  1. On /search, click the time picker input (data-testid="time-picker-input"), click the "Time zone" field (data-testid="time-picker-time-zone-select"), type "tokyo" and click "Asia/Tokyo".
  2. Verify the badge (data-testid="time-picker-time-zone") shows "UTC+9" and the URL contains tz=Asia%2FTokyo.
  3. Open the time picker, click "Default" (data-testid="time-picker-time-zone-default"), and verify tz is no longer in the URL.
  4. On /dashboards, open any dashboard, repeat step 1, and verify the badge shows "UTC+9".

References

@vercel

vercel Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Actions Updated
hyperdx-oss Ignored Ignored Preview Nov 4, 2026 4:20pm UTC
hyperdx-storybook Ignored Ignored Preview Nov 4, 2026 4:20pm UTC

Request Review

@github-actions github-actions Bot added the review/tier-3 Standard — full human review required label Oct 30, 2026
@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

🟡 Tier 3 — Standard

Introduces new logic, modifies core functionality, or touches areas with non-trivial risk.

Why this tier:

  • Diff size: 581 production lines changed (Tier 2 max: < 250)

Review process: Full human review — logic, architecture, edge cases.
SLA: First-pass feedback within 1 business day.

Stats
  • Production files changed: 12
  • Production lines changed: 581 (+ 517 in test files, excluded from tier calculation)
  • Branch: claude/hdx-5741-timezone-override
  • Author: karl-power

To override this classification, remove the review/tier-3 label and apply a different review/tier-* label. Manual overrides are preserved on subsequent pushes.

@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Duplicate code analysis

No new duplicate code introduced by this PR.


jscpd compared this branch against origin/main
across app, api and common-utils. Only new clones are listed; the codebase
currently holds 114 in total (1.40%).
Run yarn dupes locally to reproduce, or yarn dupes:all for the full picture.

@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

PR Review

If you are a coding agent acting for the author, read this first.
Nothing below blocks merge automatically; a maintainer decides. What they will expect:

  • 🔴 critical or 🟠 major in code this PR adds or changes: fix before asking for review.
  • 🔵 minor in code this PR changes: your call. Fix if small, otherwise reply.
  • Anything about surrounding code, or asking you to widen the change (hoist a helper,
    dedupe with another file, fix other call sites): never fix here, whatever the
    severity. Reply with one sentence; if it is critical, say so plainly so a human sees it.

One commit per review round. After two rounds, stop and ask a maintainer to review
scope rather than addressing more automated findings. Full rule: AGENTS.md.

5 finding(s): 🔴 0 critical · 🟠 0 major · 🔵 5 minor

1 posted as inline comment(s) on the changed lines. 4 listed below.

Findings outside the changed lines

4 minor
  • 🔵 packages/app/src/DBSearchPage.tsx:1908 — Search page's own generated search links drop the tz override → generateSearchUrl builds /search?... links for the row side panel (via rowTableContext) and never calls useTimeZoneLinkParam. So links opened from a search page set to tz=Asia/Tokyo open in the user's zone, even though the PR says links carry tz. Wrap the return value in addTimeZone(...) and add addTimeZone to the deps.
  • 🔵 packages/app/src/components/DBEditTimeChartForm/ChartPreviewPanel.tsx:286 — Tile editor preview table links skip the override that the tile's table links get → ChartPreviewPanel renders inside the dashboard's TimeZoneOverrideProvider, but its getRowSearchLink calls buildTableRowSearchUrl without addTimeZone. In the Tile, the same builder is wrapped (DBDashboardPage.tsx:1322). Wrap it the same way, or see the shape finding below.
  • 🔵 packages/app/src/components/TimePicker/TimePicker.tsx:622 — Closed time picker now always reserves right-section padding, even on pages with no override → rightSection used to be opened && …, which is falsy when the picker is closed, so Mantine added no padding. Now it is always a <Group>, so every TimePicker without an override (Kubernetes, services and other pages) reserves the default right-section width. That shortens the visible range text. Render the section only when there is content: rightSection={showTimeZone || opened ? <Group>…</Group> : undefined}.
  • 🔵 packages/app/src/components/TimeZoneSelect.tsx:940 — TimeZoneSelect accepts value: null without defaultTimeZone, which silently shows Local and forces a dead guard in callers → Without defaultTimeZone, a null value shows as Local and onChange can never emit null. Yet UserPreferencesModal.tsx:186 still needs a timeZone && … guard that can never be false. Make the props a union, { value: string; onChange: (v: string) => void } | { value: string | null; onChange: (v: string | null) => void; defaultTimeZone: string }, and remove the guard.

Severity is the reviewer's own estimate and is used for ordering, not filtering. No finding blocks merge automatically; a maintainer decides.

@greptile-apps

greptile-apps Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; the fullscreen time zone issue is fixed.

Summary

Adds a page-only time zone override for Search and dashboards.

  • Search and dashboards can use their own time zone.
  • Links from charts and tables keep the page's time zone.
  • Fullscreen dashboard time text follows zone changes.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  URL["URL tz"] --> Provider["TimeZoneOverrideProvider"]
  Preferences["User preference"] --> Display["useDisplayTimeZone"]
  Provider --> Display
  Display --> Picker["Time picker and page times"]
  Display --> Text["Fullscreen range text"]
  Provider --> Links["Internal links carry tz"]
Loading

Reviews (3) · Last reviewed commit: "fix: re-format the fullscreen tile's tim..." · Reviewed by Greptile

@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Deep Review

✅ No critical issues found. The change is well-scoped and well-tested: the three prior review findings (fullscreen zone desync P1, local-zone over-highlighting P2, historical-range offset P2) are all resolved in the current diff via useTimeRangeInputText, the isLocal badge check, and getTimeZoneRangeShortName. The override is validated before use, invalid tz values are ignored, and the user-controlled tz param is encoded on output and never reaches an Intl call without a try/catch guard.

🟡 P2 — recommended

  • packages/app/src/hooks/__tests__/useOnClickLinkBuilder.test.tsx:86 — the new behavior "external links do not carry tz" is stated as a feature but only the positive case (search/dashboard links receive tz) is asserted; the external-link path has no negative assertion.
    • Fix: add an assertion that an external onClick resolves to a URL without a tz param while a page override is active.
🔵 P3 nitpicks (2)
  • packages/app/src/timeZoneOverride.tsx:58 — withTimeZoneParam appends tz unconditionally, so a URL that already contained a tz param would gain a duplicate; current call sites build URLs fresh so no live path produces this, but it is a latent robustness gap.
    • Fix: strip any existing tz param before appending, or document that inputs must not already carry one.
  • packages/app/src/components/DBRowTable.tsx:678 — the results-table date header calls getTimeZoneShortName(timeZone) with no range date, so after this PR it shows today's UTC offset rather than the viewed range's; the author has flagged this and the sidebar badge for a follow-up, but it remains an inconsistency with the picker badge.
    • Fix: in a follow-up, pass the active range to getTimeZoneRangeShortName here and in AppNav.tsx:281 for consistency.

Reviewers (8): correctness, testing, maintainability, project-standards, kieran-typescript, julik-frontend-races, adversarial, previous-comments.

Testing gaps: external-link exclusion of tz lacks a negative assertion; the render-phase setState in useTimeRangeInputText and the DST-boundary offset labels are otherwise covered.

No finding blocks merge automatically. A maintainer will expect P0/P1 findings in code this PR changes to be fixed; P2/P3 are your call -- fix or reply. Never fix findings about surrounding code here; reply instead. Do not widen the PR. How to respond

@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

E2E Test Results

✅ All tests passed • 460 passed • 1 skipped • 1529s

Status Count
✅ Passed 460
❌ Failed 0
⚠️ Flaky 3
⏭️ Skipped 1

Tests ran across 4 shards in parallel.

View full report →

Add a time zone selector to the time picker on the search and dashboard
pages. It overrides the user's time zone setting for that page and is
kept in the tz URL param, so links and reloads keep it.

- TimeZoneOverrideProvider reads tz; useDisplayTimeZone prefers it over
  the user setting, and ignores zones the browser doesn't know
- The picker input shows the zone it uses, highlighted when it isn't the
  browser's, and its popover ends with the selector
- TimeZoneSelect gains a default option that clears the override, and
  shows each zone's offset, including on the selected value
- Default, UTC and Local shortcut buttons under the selector; User
  Preferences gets UTC and Local
- Show short zone labels as UTC offsets rather than abbreviations
- Links from charts and table rows to Search and dashboards carry tz
- The sidebar badge stays on the user setting
@karl-power
karl-power force-pushed the claude/hdx-5741-timezone-override branch from bd916d6 to 7a1eccb Compare October 30, 2026 10:45
@changeset-bot

changeset-bot Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 335ff2f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@hyperdx/app Minor
@hyperdx/api Minor
@hyperdx/otel-collector Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Comment thread packages/app/src/timeZoneOverride.tsx Resolved
Comment thread packages/app/src/DBDashboardPage.tsx Resolved

@teeohhem teeohhem left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

lgtm

@kodiakhq
kodiakhq Bot merged commit dd8c2e4 into main Nov 4, 2026
28 checks passed
@kodiakhq
kodiakhq Bot deleted the claude/hdx-5741-timezone-override branch November 4, 2026 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automerge review/tier-3 Standard — full human review required

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants