📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!
TypeScript chartsclickhousedockergdprgoogle-analyticsmetricsmonitoringmysqlnestjsprivacyredisself-hostedselfhostedstatisticstailwindcssweb-analyticswebanalyticswebsite
Show label next to the back button
Blue Mouse958db564ea8b
diff --git a/web/app/pages/Project/View/components/BackButton.tsx b/web/app/pages/Project/View/components/BackButton.tsxindex d3efb3fad..0344a1463 100644--- a/web/app/pages/Project/View/components/BackButton.tsx+++ b/web/app/pages/Project/View/components/BackButton.tsx@@ -8,35 +8,45 @@ interface BackButtonLinkProps {to: stringonClick?: neverclassName?: string+ label?: string}interface BackButtonCallbackProps {to?: neveronClick: () => voidclassName?: string+ label?: string}type BackButtonProps = BackButtonLinkProps | BackButtonCallbackProps-export const BackButton = ({ to, onClick, className }: BackButtonProps) => {+export const BackButton = ({ to, onClick, className, label }: BackButtonProps) => {const { t } = useTranslation('common')+ const backLabel = label || t('common.goBack')const buttonClasses = cn(- 'rounded-md border border-transparent p-2 hover:border-gray-300 hover:bg-white focus:z-10 focus:ring-1 focus:ring-indigo-500 focus:outline-hidden ring-inset hover:dark:border-slate-700/80 dark:hover:bg-slate-800 focus:dark:ring-gray-200',+ 'flex items-center gap-2 transition-colors rounded-md border border-transparent p-2 hover:border-gray-300 hover:bg-white focus:z-10 focus:ring-1 focus:ring-indigo-500 focus:outline-hidden ring-inset hover:dark:border-slate-700/80 dark:hover:bg-slate-800 focus:dark:ring-gray-200',className,)+ const content = (+ <>+ <ChevronLeftIcon className='h-5 w-5 text-gray-700 dark:text-gray-50' />+ <span className='text-sm font-medium text-gray-700 dark:text-gray-50'>{backLabel}</span>+ </>+ )+if (onClick) {return (- <button type='button' title={t('common.back')} onClick={onClick} className={buttonClasses}>- <ChevronLeftIcon className='h-5 w-5 text-gray-700 dark:text-gray-50' />+ <button type='button' title={backLabel} onClick={onClick} className={buttonClasses}>+ {content}</button>)}return (- <Link to={to!} title={t('common.back')} className={buttonClasses}>- <ChevronLeftIcon className='h-5 w-5 text-gray-700 dark:text-gray-50' />+ <Link to={to!} title={backLabel} className={buttonClasses}>+ {content}</Link>)}diff --git a/web/app/pages/Project/View/components/DashboardHeader.tsx b/web/app/pages/Project/View/components/DashboardHeader.tsxindex 746c78a7f..20da138f1 100644--- a/web/app/pages/Project/View/components/DashboardHeader.tsx+++ b/web/app/pages/Project/View/components/DashboardHeader.tsx@@ -29,6 +29,7 @@ interface DashboardHeaderProps {// Back button link (when provided, shows a back button on the far left)backLink?: string+ backButtonLabel?: stringonBack?: () => void// Left side content (displayed after back button, before live visitors)@@ -46,6 +47,7 @@ const DashboardHeader = ({hideTimeBucket = false,timeBucketSelectorItems: customTimeBucketSelectorItems,backLink,+ backButtonLabel,onBack,leftContent,rightContent,@@ -123,8 +125,8 @@ const DashboardHeader = ({return (<div className='relative top-0 z-20 -mt-2 flex flex-col items-center justify-between bg-gray-50/50 py-2 backdrop-blur-md lg:sticky lg:flex-row dark:bg-slate-900/50'><div className='flex flex-wrap items-center justify-center gap-2'>- {backLink ? <BackButton to={backLink} /> : null}- {onBack ? <BackButton onClick={onBack} /> : null}+ {backLink ? <BackButton to={backLink} label={backButtonLabel} /> : null}+ {onBack ? <BackButton onClick={onBack} label={backButtonLabel} /> : null}{leftContent}{showLiveVisitors ? <LiveVisitorsDropdown /> : null}</div>diff --git a/web/app/pages/Project/View/components/ProjectSidebar.tsx b/web/app/pages/Project/View/components/ProjectSidebar.tsxindex f3f9c17ed..45574174c 100644--- a/web/app/pages/Project/View/components/ProjectSidebar.tsx+++ b/web/app/pages/Project/View/components/ProjectSidebar.tsx@@ -174,6 +174,7 @@ const CollapsibleGroup: React.FC<{<TabIcon className={cn('size-5 shrink-0', iconColorClass)} strokeWidth={1.5} aria-hidden='true' /></Link>}+ disableHoverableContent/>)})}@@ -413,6 +414,7 @@ const ProjectSidebar: React.FC<ProjectSidebarProps> = ({</Text>)}+ disableHoverableContent/>) : (<Tooltip@@ -434,6 +436,7 @@ const ProjectSidebar: React.FC<ProjectSidebarProps> = ({</Text></div>}+ disableHoverableContent/>)}{isMobileOpen ? (@@ -490,6 +493,7 @@ const ProjectSidebar: React.FC<ProjectSidebarProps> = ({/></Link>}+ disableHoverableContent/>)}diff --git a/web/app/pages/Project/tabs/Funnels/FunnelsView.tsx b/web/app/pages/Project/tabs/Funnels/FunnelsView.tsxindex 3a25450c3..40dbd0f46 100644--- a/web/app/pages/Project/tabs/Funnels/FunnelsView.tsx+++ b/web/app/pages/Project/tabs/Funnels/FunnelsView.tsx@@ -253,6 +253,7 @@ const FunnelsView = () => {<><DashboardHeaderbackLink={`?${pureSearchParams}`}+ backButtonLabel={t('project.backToFunnels')}showLiveVisitors={false}showSearchButton={false}hideTimeBucketdiff --git a/web/app/pages/Project/tabs/Profiles/ProfilesView.tsx b/web/app/pages/Project/tabs/Profiles/ProfilesView.tsxindex 7879867b8..8cb91514e 100644--- a/web/app/pages/Project/tabs/Profiles/ProfilesView.tsx+++ b/web/app/pages/Project/tabs/Profiles/ProfilesView.tsx@@ -323,7 +323,11 @@ const ProfilesView = ({ tnMapping }: ProfilesViewProps) => {return (<>- <DashboardHeader backLink={`?${backSearchParams}`} showLiveVisitors={false} />+ <DashboardHeader+ backLink={`?${backSearchParams}`}+ backButtonLabel={t('project.backToUsers')}+ showLiveVisitors={false}+ />{profileLoading && !activeProfile ? (<Loader />) : (diff --git a/web/app/pages/Project/tabs/Sessions/SessionsView.tsx b/web/app/pages/Project/tabs/Sessions/SessionsView.tsxindex 39f05247a..f504aee78 100644--- a/web/app/pages/Project/tabs/Sessions/SessionsView.tsx+++ b/web/app/pages/Project/tabs/Sessions/SessionsView.tsx@@ -253,7 +253,11 @@ const SessionsView = ({ tnMapping, rotateXAxis }: SessionsViewProps) => {if (activePSID) {return (<>- <DashboardHeader backLink={`?${pureSearchParams}`} showLiveVisitors={false} />+ <DashboardHeader+ backLink={`?${pureSearchParams}`}+ backButtonLabel={t('project.backToSessions')}+ showLiveVisitors={false}+ /><SessionDetailViewactiveSession={activeSession}sessionLoading={sessionLoading}