Skip to content

Open source, privacy-first web analytics. Lightweight, cookie-free Google Analytics alternative. Self-hosted or cloud.

Make minor improvements to the dashboard (#5979)

Sanne de Vries6dfcfbcee975
diff --git a/CHANGELOG.md b/CHANGELOG.md
index d8c61efdf1..f52001d57b 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -14,6 +14,7 @@ All notable changes to this project will be documented in this file.
### Changed
- Segment filters are visible to anyone who can view the dashboard with that segment applied, including personal segments on public dashboards
+- Keybind hints are hidden on smaller screens
### Fixed
diff --git a/assets/js/dashboard/components/search-input.tsx b/assets/js/dashboard/components/search-input.tsx
index a9a739ade1..648918b472 100644
--- a/assets/js/dashboard/components/search-input.tsx
+++ b/assets/js/dashboard/components/search-input.tsx
@@ -12,14 +12,14 @@ export const SearchInput = ({
searchRef,
onSearch,
className,
- placeholderFocused = 'Search',
- placeholderUnfocused = 'Press / to search'
+ placeholderFocusedOrMobile = 'Search',
+ placeholderUnfocusedOnlyDesktop = 'Press / to search'
}: {
searchRef: RefObject<HTMLInputElement>
onSearch: (value: string) => void
className?: string
- placeholderFocused?: string
- placeholderUnfocused?: string
+ placeholderFocusedOrMobile?: string
+ placeholderUnfocusedOnlyDesktop?: string
}) => {
const [isFocused, setIsFocused] = useState(false)
@@ -59,18 +59,23 @@ export const SearchInput = ({
shouldIgnoreWhen={[isModifierPressed, () => isFocused]}
targetRef="document"
/>
- <input
- onBlur={() => setIsFocused(false)}
- onFocus={() => setIsFocused(true)}
- ref={searchRef}
- type="text"
- placeholder={isFocused ? placeholderFocused : placeholderUnfocused}
- className={classNames(
- 'text-sm dark:text-gray-100 block border-gray-300 dark:border-gray-750 rounded-md dark:bg-gray-750 max-w-64 w-full dark:placeholder:text-gray-400 focus:outline-none focus:ring-3 focus:ring-indigo-500/20 dark:focus:ring-indigo-500/25 focus:border-indigo-500',
- className
- )}
- onChange={debouncedOnSearchInputChange}
- />
+ <div className={classNames('relative max-w-64 w-full', className)}>
+ <input
+ onBlur={() => setIsFocused(false)}
+ onFocus={() => setIsFocused(true)}
+ ref={searchRef}
+ type="text"
+ placeholder=" "
+ className="peer w-full text-sm dark:text-gray-100 block border-gray-300 dark:border-gray-750 rounded-md dark:bg-gray-750 dark:placeholder:text-gray-400 focus:outline-none focus:ring-3 focus:ring-indigo-500/20 dark:focus:ring-indigo-500/25 focus:border-indigo-500"
+ onChange={debouncedOnSearchInputChange}
+ />
+ <span className="pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-sm text-gray-400 dark:text-gray-400 peer-[:not(:placeholder-shown)]:hidden md:peer-[:not(:focus)]:hidden">
+ {placeholderFocusedOrMobile}
+ </span>
+ <span className="pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-sm text-gray-400 dark:text-gray-400 peer-[:not(:placeholder-shown)]:hidden hidden md:peer-[:not(:focus)]:block peer-focus:hidden">
+ {placeholderUnfocusedOnlyDesktop}
+ </span>
+ </div>
</>
)
}
diff --git a/assets/js/dashboard/components/tabs.tsx b/assets/js/dashboard/components/tabs.tsx
index 1ed9ec022b..6cc9d75ef7 100644
--- a/assets/js/dashboard/components/tabs.tsx
+++ b/assets/js/dashboard/components/tabs.tsx
@@ -174,8 +174,7 @@ const Items = ({ options, searchable, closeDropdown }: ItemsProps) => {
<div className="flex items-center p-1">
<SearchInput
searchRef={searchRef}
- placeholderUnfocused="Press / to search"
- className="w-full !max-w-none"
+ className="!max-w-none"
onSearch={handleSearchInput}
/>
</div>
diff --git a/assets/js/dashboard/keybinding.tsx b/assets/js/dashboard/keybinding.tsx
index f738c8395d..646b35bd20 100644
--- a/assets/js/dashboard/keybinding.tsx
+++ b/assets/js/dashboard/keybinding.tsx
@@ -145,7 +145,7 @@ export function KeybindHint({
return (
<kbd
className={classNames(
- 'rounded bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-600 px-1.5 font-medium text-xs text-gray-400',
+ 'hidden md:block rounded bg-white dark:bg-gray-800 border border-gray-200 dark:border-gray-600 px-1.5 font-medium text-xs text-gray-400',
className
)}
>
diff --git a/assets/js/dashboard/nav-menu/segments/searchable-segments-section.tsx b/assets/js/dashboard/nav-menu/segments/searchable-segments-section.tsx
index 5695a23190..bf40d00a8b 100644
--- a/assets/js/dashboard/nav-menu/segments/searchable-segments-section.tsx
+++ b/assets/js/dashboard/nav-menu/segments/searchable-segments-section.tsx
@@ -81,8 +81,7 @@ export const SearchableSegmentsSection = ({
{showSearch && (
<SearchInput
searchRef={searchRef}
- placeholderUnfocused="Press / to search"
- className="ml-auto w-full py-1"
+ className="ml-auto py-1"
onSearch={handleSearchInput}
/>
)}
diff --git a/assets/js/dashboard/stats/behaviours/index.js b/assets/js/dashboard/stats/behaviours/index.js
index d5e88f2635..f76670733c 100644
--- a/assets/js/dashboard/stats/behaviours/index.js
+++ b/assets/js/dashboard/stats/behaviours/index.js
@@ -572,7 +572,9 @@ export default function Behaviours({ importedDataInView }) {
{isRealtime() && <Pill className="-mt-1">last 30min</Pill>}
{renderImportedQueryUnsupportedWarning()}
</div>
- <MoreLink state={moreLinkState} linkProps={moreLinkProps()} />
+ {mode !== FUNNELS && (
+ <MoreLink state={moreLinkState} linkProps={moreLinkProps()} />
+ )}
</ReportHeader>
{renderContent()}
</ReportLayout>
diff --git a/assets/js/dashboard/stats/modals/breakdown-table.tsx b/assets/js/dashboard/stats/modals/breakdown-table.tsx
index 80a7e7d50f..9248d8438e 100644
--- a/assets/js/dashboard/stats/modals/breakdown-table.tsx
+++ b/assets/js/dashboard/stats/modals/breakdown-table.tsx
@@ -56,7 +56,9 @@ export const BreakdownTable = <TListItem extends { name: string }>({
searchRef={searchRef}
onSearch={onSearch}
className={
- displayError && status === 'error' ? 'pointer-events-none' : ''
+ displayError && status === 'error'
+ ? '[&_input]:pointer-events-none'
+ : ''
}
/>
)}