-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
chore: viewport icons #31069
Conversation
There was a problem hiding this 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 infrontend/src/scenes/heatmaps/heatmapsBrowserLogic.ts
but usessetIframeWidth
reducer to update state, creating potential confusion - Replaced custom viewport chooser with
LemonSegmentedButton
component inHeatmapsBrowser.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 }), |
There was a problem hiding this comment.
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.
📸 UI snapshots have been updated3 snapshot changes in total. 0 added, 3 modified, 0 deleted:
Triggered by this commit. |
📸 UI snapshots have been updated1 snapshot changes in total. 0 added, 1 modified, 0 deleted:
Triggered by this commit. |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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, |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point! Added
…posthog into chore/heatmaps/viewport
There was a problem hiding this 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
📸 UI snapshots have been updated1 snapshot changes in total. 0 added, 1 modified, 0 deleted:
Triggered by this commit. |
Size Change: +203 kB (+1.54%) Total Size: 13.4 MB
|
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Make viewport in Heatmap a bit nicer
Before

After
