From f549a022ae8abb49196bf17a22a4aaef38e025d6 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Fri, 6 Nov 2026 14:50:42 +0000 Subject: [PATCH] show a Home icon and label on hover over the sidebar brand row (#12277) Co-authored-by: Claude Opus 5.5 --- .../lib/components/sidebar/MenuLink.svelte | 34 ++++++++++++++++--- .../src/routes/(root)/(logged)/+layout.svelte | 5 ++- 2 files changed, 33 insertions(+), 6 deletions(-) diff --git a/frontend/src/lib/components/sidebar/MenuLink.svelte b/frontend/src/lib/components/sidebar/MenuLink.svelte index 46a7022b82..566ef712fb 100644 --- a/frontend/src/lib/components/sidebar/MenuLink.svelte +++ b/frontend/src/lib/components/sidebar/MenuLink.svelte @@ -17,6 +17,10 @@ href: string icon?: any | undefined iconProps?: Record + // Shown in place of the icon and label while the row is hovered or focused, for a row + // whose resting look (a brand mark) does not say what it does. + hoverIcon?: any | undefined + hoverLabel?: string | undefined isCollapsed: boolean disabled?: boolean lightMode?: boolean @@ -33,6 +37,8 @@ href, icon = undefined, iconProps = {}, + hoverIcon = undefined, + hoverLabel = undefined, isCollapsed, disabled = false, lightMode = false, @@ -50,6 +56,15 @@ isSelected = $page.url.pathname.startsWith(href) } }) + + let iconClass = $derived( + twMerge( + 'flex-shrink-0 transition-all', + isSelected ? sidebarClasses.selectedText : sidebarClasses.iconText + ) + ) + const restingClass = 'group-hover:hidden group-focus-visible:hidden' + const hoverClass = 'hidden group-hover:block group-focus-visible:block' {#if !disabled} @@ -96,20 +111,29 @@ {/if} + {#if hoverIcon} + {@const HoverComponent = hoverIcon} + + {/if} {#if !isCollapsed} {label} + {#if hoverLabel} + + {hoverLabel} + + {/if} {/if} {#snippet text()} diff --git a/frontend/src/routes/(root)/(logged)/+layout.svelte b/frontend/src/routes/(root)/(logged)/+layout.svelte index f67c7723d9..ba66d10c3d 100644 --- a/frontend/src/routes/(root)/(logged)/+layout.svelte +++ b/frontend/src/routes/(root)/(logged)/+layout.svelte @@ -91,7 +91,8 @@ Search, ArrowLeft, Star, - MessagesSquare + MessagesSquare, + House } from 'lucide-svelte' import { homeRowLearned, sidebarPrefs } from '$lib/components/sidebar/sidebarPrefs.svelte' import { Button } from '$lib/components/common' @@ -1425,6 +1426,8 @@ outside this layout, and their shortcut must reopen the URL that is their creden }} icon={WindmillIcon} iconProps={{ white: darkMode, width: '16px', height: '16px' }} + hoverIcon={House} + hoverLabel="Home" isCollapsed={collapsed} aiId="sidebar-menu-link-home" aiDescription="Button to navigate to home which contains all the user's scripts, flows and apps"