Skip to content

chore: viewport icons #31069

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Apr 14, 2025
Merged

chore: viewport icons #31069

merged 16 commits into from
Apr 14, 2025

Conversation

veryayskiy
Copy link
Contributor

Make viewport in Heatmap a bit nicer

Before
Screenshot 2025-04-10 at 17 06 18

After
Screenshot 2025-04-10 at 17 05 26

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

This PR enhances the viewport selection UI in the Heatmaps feature with a more polished interface for selecting different device widths.

  • Added setWidthOverride action in frontend/src/scenes/heatmaps/heatmapsBrowserLogic.ts but uses setIframeWidth reducer to update state, creating potential confusion
  • Replaced custom viewport chooser with LemonSegmentedButton component in HeatmapsBrowser.tsx for a more polished UI
  • Added device-specific icons (phone, tablet, laptop) with pixel width labels for better visual representation
  • Added styling improvements including border styling to the iframe container and an id attribute for better identification
  • Centralized width override state management in heatmapsBrowserLogic instead of component-level state

2 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile

@@ -86,6 +86,7 @@ export const heatmapsBrowserLogic = kea<heatmapsBrowserLogicType>([
stopTrackingLoading: true,
setReplayIframeData: (replayIframeData: ReplayIframeData | null) => ({ replayIframeData }),
setReplayIframeDataURL: (url: string | null) => ({ url }),
setWidthOverride: (width: number | null) => ({ width }),
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: The action setWidthOverride is defined here but it's not used in any reducer case. Instead, the widthOverride state is updated by the setIframeWidth action.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

3 snapshot changes in total. 0 added, 3 modified, 0 deleted:

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

1 snapshot changes in total. 0 added, 1 modified, 0 deleted:

  • chromium: 0 added, 1 modified, 0 deleted (diff for shard 5)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

Copy link
Member

Choose a reason for hiding this comment

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

looks like it's unhappy in darkmode

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yep, fixed already

value={widthOverride ? widthOverride : undefined}
options={[
{
value: 320,
Copy link
Member

Choose a reason for hiding this comment

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

let's put a data-attr on these options so we can track when they're clicked (in a way i didn't with the previous version)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point! Added

Copy link
Member

@pauldambra pauldambra left a comment

Choose a reason for hiding this comment

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

👍 it's in alpha... ship it and see what people say

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

1 snapshot changes in total. 0 added, 1 modified, 0 deleted:

  • chromium: 0 added, 1 modified, 0 deleted (diff for shard 1)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

Copy link
Contributor

Size Change: +203 kB (+1.54%)

Total Size: 13.4 MB

Filename Size Change
frontend/dist/toolbar.js 13.4 MB +203 kB (+1.54%)

compressed-size-action

@veryayskiy veryayskiy enabled auto-merge (squash) April 11, 2025 15:26
@veryayskiy veryayskiy disabled auto-merge April 11, 2025 15:26
@veryayskiy veryayskiy merged commit 5493aed into master Apr 14, 2025
109 of 110 checks passed
@veryayskiy veryayskiy deleted the chore/heatmaps/viewport branch April 14, 2025 08:04
lricoy pushed a commit that referenced this pull request Apr 14, 2025
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
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.

4 participants