Skip to content
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

fix(3000): Look reasonable on mobile #19262

Merged
merged 3 commits into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions frontend/src/layout/navigation-3000/Navigation.scss
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,17 @@
flex: 1;
flex-direction: column;
justify-content: space-between;
padding: 0 0.375rem;
overflow-y: auto;
background: var(--accent-3000);

.LemonButton__chrome {
--lemon-button-padding-horizontal: 0.25rem !important;
}

> * {
padding: 0 0.375rem;
}

ul {
padding: 0.5rem 0;
}
Expand All @@ -91,6 +94,10 @@
}
}

.Navbar3000__top {
overflow: auto;
}

.Navbar3000__overlay {
position: fixed;
z-index: var(--z-mobile-nav-overlay);
Expand All @@ -99,12 +106,12 @@
background-color: var(--modal-backdrop-color);
backdrop-filter: blur(var(--modal-backdrop-blur));
opacity: 1;
transition: background-color 100ms ease-out, backdrop-filter 100ms ease-out;
transition: opacity 100ms ease-out, backdrop-filter 100ms ease-out;

&.Navbar3000--hidden {
pointer-events: none;
background-color: transparent;
backdrop-filter: blur(0);
opacity: 0;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { useActions, useValues } from 'kea'
import { useFeatureFlag } from 'lib/hooks/useFeatureFlag'
import { LemonButton, LemonButtonProps } from 'lib/lemon-ui/LemonButton'
import { Tooltip } from 'lib/lemon-ui/Tooltip'
import { isMobile } from 'lib/utils'
import React, { FunctionComponent, ReactElement, useState } from 'react'
import { sceneLogic } from 'scenes/sceneLogic'

Expand Down Expand Up @@ -68,7 +69,9 @@ export const NavbarButton: FunctionComponent<NavbarButtonProps> = React.forwardR
'data-attr': `menu-item-${sideAction.identifier.toLowerCase()}`,
}
buttonProps.sideIcon = null
} else if (keyboardShortcut) {
} else if (keyboardShortcut && !isMobile()) {
// If the user agent says we're on mobile, then it's unlikely - but not impossible -
// that there's a physical keyboard. Hence in that case we don't show the keyboard shortcut
buttonProps.sideIcon = (
<span className="text-xs">
<KeyboardShortcut {...keyboardShortcut} />
Expand Down
1 change: 1 addition & 0 deletions frontend/src/layout/navigation-3000/components/TopBar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
flex-grow: 1;
flex-shrink: 1;
min-width: 0;
overflow: hidden;
}

.TopBar3000__trail {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export function PropertyDefinitionsTable(): JSX.Element {
Click here!
</Link>
</LemonBanner>
<div className="flex justify-between mb-4">
<div className="flex justify-between mb-4 gap-2 flex-wrap">
<LemonInput
type="search"
placeholder="Search for properties"
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/scenes/experiments/Experiments.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ export function Experiments(): JSX.Element {
))}
{!shouldShowEmptyState && (
<>
<div className="flex justify-between mb-4">
<div className="flex justify-between mb-4 gap-2 flex-wrap">
<LemonInput
type="search"
placeholder="Search experiments"
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/scenes/feature-flags/FeatureFlags.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ export function OverViewTab({
{!shouldShowEmptyState && (
<>
<div>
<div className="flex justify-between mb-4">
<div className="flex justify-between mb-4 gap-2 flex-wrap">
<LemonInput
className="w-60"
type="search"
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/scenes/persons/RelatedFeatureFlags.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export function RelatedFeatureFlags({ distinctId, groups }: Props): JSX.Element

return (
<>
<div className="flex justify-between mb-4">
<div className="flex justify-between mb-4 gap-2 flex-wrap">
<LemonInput
type="search"
placeholder="Search for feature flags"
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/scenes/saved-insights/SavedInsights.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,7 @@ export function SavedInsights(): JSX.Element {
<>
<SavedInsightsFilters />
<LemonDivider className="my-4" />
<div className="flex justify-between mb-4 mt-2 items-center">
<div className="flex justify-between mb-4 gap-2 flex-wrap mt-2 items-center">
<span className="text-muted-alt">
{count
? `${startCount}${endCount - startCount > 1 ? '-' + endCount : ''} of ${count} insight${
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/scenes/surveys/Surveys.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ export function Surveys(): JSX.Element {
{!shouldShowEmptyState && (
<>
<div>
<div className="flex justify-between mb-4">
<div className="flex justify-between mb-4 gap-2 flex-wrap">
<LemonInput
type="search"
placeholder="Search for surveys"
Expand Down
Loading