Skip to content

Conversation

@brandon-pereira
Copy link
Member

Fixes hydration error if the sidebar is collapsed when you load the page

Screenshot 2025-10-24 at 11 13 35 AM

Fixeds HDX-2647

@changeset-bot
Copy link

changeset-bot bot commented Oct 24, 2025

🦋 Changeset detected

Latest commit: 1a57a2d

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

This PR includes changesets to release 2 packages
Name Type
@hyperdx/app Patch
@hyperdx/api Patch

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

@vercel
Copy link

vercel bot commented Oct 24, 2025

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

Project Deployment Preview Comments Updated (UTC)
hyperdx-v2-oss-app Ready Ready Preview Comment Oct 24, 2025 9:31am

@brandon-pereira brandon-pereira requested review from a team and pulpdrew and removed request for a team October 24, 2025 09:27
@claude
Copy link

claude bot commented Oct 24, 2025

PR Review

Critical Issue:

Incomplete migration → The PR migrates AppNav.tsx to use Mantine's useLocalStorage hook but leaves 7+ other files still using the custom useLocalStorage from utils.ts. This creates inconsistency and means the custom hook cannot be removed.

Two options to fix:

  1. Recommended: Migrate ALL files to use Mantine's useLocalStorage and remove the custom implementation from utils.ts

    • Files still using custom hook: searchFilters.tsx, SessionSubpanel.tsx, LogSidePanelElements.tsx, DBSearchPage.tsx, OnboardingChecklist.tsx, DBChartPage.tsx, DBSqlRowTableWithSidebar.tsx
    • Also update useQueryHistory in utils.ts:299 which depends on the custom hook
  2. Alternative: Keep using the custom useLocalStorage in AppNav.tsx but fix the hydration issue within the custom implementation itself

Why this matters: Mixed usage of two different useLocalStorage implementations (with different APIs) is confusing for maintainability and can lead to bugs. The custom hook uses positional args (key, initialValue) while Mantine uses object syntax ({ key, defaultValue }).

@github-actions
Copy link
Contributor

E2E Test Results

All tests passed • 26 passed • 3 skipped • 230s

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

View full report →

Copy link
Contributor

@pulpdrew pulpdrew left a comment

Choose a reason for hiding this comment

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

Fix LGTM and appears to fix the issue.

I do have a question similar to Claude's though - is there a reason that we should continue to use the existing useLocalStorage hook in some places but not others, or would a complete migration to the mantine hook be worthwhile at some point?

@brandon-pereira
Copy link
Member Author

Fix LGTM and appears to fix the issue.

I do have a question similar to Claude's though - is there a reason that we should continue to use the existing useLocalStorage hook in some places but not others, or would a complete migration to the mantine hook be worthwhile at some point?

We definitely should migrate towards the mantine hook over our own - the hooks to operate differently (ours does the logic on initial mount, but mantines does it in an effect after initial mount), this could introduce bugs so I'd be nervous to replace all of them without more testing

@brandon-pereira brandon-pereira merged commit ab7af41 into main Oct 25, 2025
10 checks passed
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.

2 participants