Skip to content

Conversation

erickzhao
Copy link
Member

@erickzhao erickzhao commented Sep 29, 2025

This PR adds a simple timezone switcher to the Sleuth toolbar UI. This allows you to switch between the System and User TZ in the log table view.

Note that the toggle is disabled if the User and System TZ are the same. I just disabled it in the UI in this case, but can hide it instead if it makes the toolbar a bit less cluttered (open to feedback).

Screen.Recording.2025-09-29.at.16.16.51.mov

The date-fns dependency also got two major version bumps here so we could integrate the new @date-fns/tz integration.

@erickzhao erickzhao marked this pull request as draft September 29, 2025 21:08
@erickzhao erickzhao marked this pull request as ready for review October 7, 2025 19:09
@erickzhao
Copy link
Member Author

After some feedback from @nocturnll, here are a few tweaks:

  • The Range Picker is now TZ-aware. It also is refactored to use date-fns instead of the default dayjs library to align with the rest of the codebase.
  • The TZ label is now inside the switch instead of on the side.
  • Fixed a bug where state files wouldn't clear on resetting the app (2703d90), leading to timezones to persist for mobile logs despite not having a log-context.json file.
  • That said, the switcher is hidden if log-context.json doesn't exist now.

@erickzhao erickzhao requested review from a team and nocturnll October 7, 2025 19:35
Copy link
Collaborator

@nocturnll nocturnll left a comment

Choose a reason for hiding this comment

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

lgtm

@nocturnll nocturnll merged commit 1598db8 into main Oct 9, 2025
6 checks passed
@nocturnll nocturnll deleted the tz branch October 9, 2025 20:01
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