From beb869ff661a314e026d3c0ac6fe459f02814259 Mon Sep 17 00:00:00 2001 From: Sanne de Vries Date: Thu, 18 Dec 2025 11:39:52 +0100 Subject: [PATCH 01/23] Improve reports layout - Create new `ReportLayout` and `ReportHeader` components to ensure consistent layout across reports - Remove title from report header, and place tabs in the top left corner - Move the details button to the top right corner, rather than the bottom of the report, to reduce vertical space and improve readability. Reduce it to a simple icon with a 'View details' tooltip. - Update the Search terms report to use the new `ReportLayout` and `ReportHeader` components. - Update dashboard to use a simple grid layout, simplifying the html markup and css. - Change 'Screen sizes' title to 'Devices' in the devices report. - Change 'Top pages' title to 'Conversion pages' in the pages report, whenever a conversion goal filter is applied. - Add 'last 30min' pill to the behaviour report when on realtime dashboard, rather than displaying this in the title. - Remove the Combobox input from the custom properties report, and use the same tab dropdown pattern as used for funnels and UTM campaigns. --- assets/css/app.css | 4 + assets/js/dashboard/components/pill.tsx | 20 ++ assets/js/dashboard/components/popover.tsx | 3 +- assets/js/dashboard/components/tabs.tsx | 78 ++++--- assets/js/dashboard/extra/funnel.js | 6 +- .../js/dashboard/hooks/use-more-link-data.tsx | 31 +++ assets/js/dashboard/index.tsx | 40 +--- assets/js/dashboard/nav-menu/top-bar.tsx | 6 +- assets/js/dashboard/site-switcher.tsx | 4 +- .../dashboard/stats/behaviours/conversions.js | 7 +- .../stats/behaviours/goal-conversions.js | 11 +- assets/js/dashboard/stats/behaviours/index.js | 208 ++++++++++++++++-- assets/js/dashboard/stats/behaviours/props.js | 130 ++--------- assets/js/dashboard/stats/current-visitors.js | 2 +- assets/js/dashboard/stats/devices/index.js | 158 ++++++++++--- assets/js/dashboard/stats/graph/graph-util.js | 30 +-- assets/js/dashboard/stats/graph/top-stats.js | 2 +- .../js/dashboard/stats/graph/visitor-graph.js | 2 +- assets/js/dashboard/stats/locations/index.js | 124 ++++++++--- .../dashboard/stats/locations/map-tooltip.tsx | 7 +- assets/js/dashboard/stats/locations/map.tsx | 53 +++-- .../stats/modals/devices/screen-sizes.js | 4 +- .../stats/modals/google-keywords.tsx | 2 +- assets/js/dashboard/stats/more-link.js | 50 +++-- assets/js/dashboard/stats/pages/index.js | 103 +++++---- assets/js/dashboard/stats/reports/list.tsx | 38 ++-- .../dashboard/stats/reports/report-header.js | 9 + .../dashboard/stats/reports/report-layout.js | 15 ++ .../dashboard/stats/sources/search-terms.tsx | 38 ++-- .../js/dashboard/stats/sources/source-list.js | 135 +++++++----- 30 files changed, 846 insertions(+), 474 deletions(-) create mode 100644 assets/js/dashboard/components/pill.tsx create mode 100644 assets/js/dashboard/hooks/use-more-link-data.tsx create mode 100644 assets/js/dashboard/stats/reports/report-header.js create mode 100644 assets/js/dashboard/stats/reports/report-layout.js diff --git a/assets/css/app.css b/assets/css/app.css index 71879d553ed0..064bc1523c90 100644 --- a/assets/css/app.css +++ b/assets/css/app.css @@ -31,6 +31,10 @@ *:focus-visible { @apply ring-2 ring-indigo-500 ring-offset-2 dark:ring-offset-gray-900 outline-none; } + + :focus:not(:focus-visible) { + @apply outline-none; + } } @layer components { diff --git a/assets/js/dashboard/components/pill.tsx b/assets/js/dashboard/components/pill.tsx new file mode 100644 index 000000000000..15bb1d124c1e --- /dev/null +++ b/assets/js/dashboard/components/pill.tsx @@ -0,0 +1,20 @@ +import React, { ReactNode } from 'react' +import classNames from 'classnames' + +export type PillProps = { + className?: string + children: ReactNode +} + +export function Pill({ className, children }: PillProps) { + return ( +
+ {children} +
+ ) +} diff --git a/assets/js/dashboard/components/popover.tsx b/assets/js/dashboard/components/popover.tsx index 56662badb541..66ca3fc91c2f 100644 --- a/assets/js/dashboard/components/popover.tsx +++ b/assets/js/dashboard/components/popover.tsx @@ -55,8 +55,7 @@ const items = { 'data-[selected=true]:bg-gray-100', 'data-[selected=true]:dark:bg-gray-700', 'data-[selected=true]:text-gray-900', - 'data-[selected=true]:dark:text-gray-100', - 'data-[selected=true]:font-semibold' + 'data-[selected=true]:dark:text-gray-100' ), hoverLink: classNames( 'hover:bg-gray-100', diff --git a/assets/js/dashboard/components/tabs.tsx b/assets/js/dashboard/components/tabs.tsx index cc33f7290ca0..5d5670c2bea5 100644 --- a/assets/js/dashboard/components/tabs.tsx +++ b/assets/js/dashboard/components/tabs.tsx @@ -1,6 +1,6 @@ import { Popover, Transition } from '@headlessui/react' import classNames from 'classnames' -import React, { ReactNode, useRef } from 'react' +import React, { ReactNode, useRef, useEffect } from 'react' import { ChevronDownIcon } from '@heroicons/react/20/solid' import { popover, BlurMenuButtonOnEscape } from './popover' import { useSearchableItems } from '../hooks/use-searchable-items' @@ -16,7 +16,7 @@ export const TabWrapper = ({ }) => (
@@ -32,12 +32,15 @@ const TabButtonText = ({ active: boolean }) => ( {children} @@ -54,7 +57,10 @@ export const TabButton = ({ onClick: () => void active: boolean }) => ( - ) @@ -84,11 +90,8 @@ export const DropdownTabButton = ({ > {children} -