55 SettingsIcon ,
66} from "lucide-react" ;
77import { memo , useCallback } from "react" ;
8- import { Link , useCanGoBack , useLocation , useNavigate } from "@tanstack/react-router" ;
8+ import { Link , useLocation , useNavigate } from "@tanstack/react-router" ;
99
1010import { useEnvironmentIdentificationMode } from "../../hooks/useSettings" ;
1111import { cn } from "../../lib/utils" ;
@@ -27,8 +27,9 @@ import {
2727 SidebarTrigger ,
2828 useSidebar ,
2929} from "../ui/sidebar" ;
30+ import { Tooltip , TooltipPopup , TooltipTrigger } from "../ui/tooltip" ;
3031import { SidebarProviderUpdatePill } from "./SidebarProviderUpdatePill" ;
31- import { SidebarUpdatePill } from "./SidebarUpdatePill" ;
32+ import { SidebarUpdateArchitectureWarning , SidebarUpdatePill } from "./SidebarUpdatePill" ;
3233
3334export const SidebarChromeHeader = memo ( function SidebarChromeHeader ( {
3435 isElectron,
@@ -119,7 +120,6 @@ function T3Wordmark() {
119120export const SidebarChromeFooter = memo ( function SidebarChromeFooter ( ) {
120121 const navigate = useNavigate ( ) ;
121122 const { isMobile, setOpenMobile } = useSidebar ( ) ;
122- const canGoBack = useCanGoBack ( ) ;
123123 const currentFooterPage = useLocation ( {
124124 select : ( location ) =>
125125 location . pathname === "/usage"
@@ -154,54 +154,72 @@ export const SidebarChromeFooter = memo(function SidebarChromeFooter() {
154154
155155 const handleBackClick = useCallback ( ( ) => {
156156 closeMobileSidebar ( ) ;
157- if ( canGoBack ) {
158- window . history . back ( ) ;
159- return ;
160- }
161157 void navigate ( { to : "/" } ) ;
162- } , [ canGoBack , closeMobileSidebar , navigate ] ) ;
158+ } , [ closeMobileSidebar , navigate ] ) ;
163159
164160 return (
165161 < SidebarFooter className = "p-[var(--sidebar-content-inset)]" >
166162 < SidebarProviderUpdatePill />
167- < SidebarUpdatePill />
168- < SidebarMenu >
169- { currentFooterPage === "pull-requests" ? (
170- < SidebarMenuItem >
171- < SidebarMenuButton onClick = { handleBackClick } >
172- < ArrowLeftIcon />
173- < span > Back</ span >
174- </ SidebarMenuButton >
175- </ SidebarMenuItem >
176- ) : pullRequestsSupported ? (
177- < SidebarMenuItem >
178- < SidebarMenuButton onClick = { handlePullRequestsClick } >
179- < GitPullRequestIcon />
180- < span > Pull Requests</ span >
181- </ SidebarMenuButton >
182- </ SidebarMenuItem >
183- ) : null }
184- { currentFooterPage === "usage" ? (
185- < SidebarMenuItem >
163+ < SidebarUpdateArchitectureWarning />
164+ < SidebarMenu className = "flex-row items-center" >
165+ { currentFooterPage ? (
166+ < SidebarMenuItem className = "min-w-0 flex-1" >
186167 < SidebarMenuButton onClick = { handleBackClick } >
187168 < ArrowLeftIcon />
188169 < span > Back</ span >
189170 </ SidebarMenuButton >
190171 </ SidebarMenuItem >
191172 ) : (
192- < SidebarMenuItem >
193- < SidebarMenuButton onClick = { handleUsageClick } >
194- < ChartNoAxesColumnIcon />
195- < span > Usage</ span >
196- </ SidebarMenuButton >
197- </ SidebarMenuItem >
173+ < >
174+ < SidebarMenuItem className = "shrink-0" >
175+ < Tooltip >
176+ < TooltipTrigger
177+ render = {
178+ < SidebarMenuButton
179+ aria-label = "Settings"
180+ onClick = { handleSettingsClick }
181+ size = "icon"
182+ >
183+ < SettingsIcon />
184+ </ SidebarMenuButton >
185+ }
186+ />
187+ < TooltipPopup side = "top" > Settings</ TooltipPopup >
188+ </ Tooltip >
189+ </ SidebarMenuItem >
190+ { pullRequestsSupported ? (
191+ < SidebarMenuItem className = "shrink-0" >
192+ < Tooltip >
193+ < TooltipTrigger
194+ render = {
195+ < SidebarMenuButton
196+ aria-label = "Pull Requests"
197+ onClick = { handlePullRequestsClick }
198+ size = "icon"
199+ >
200+ < GitPullRequestIcon />
201+ </ SidebarMenuButton >
202+ }
203+ />
204+ < TooltipPopup side = "top" > Pull Requests</ TooltipPopup >
205+ </ Tooltip >
206+ </ SidebarMenuItem >
207+ ) : null }
208+ < SidebarMenuItem className = "shrink-0" >
209+ < Tooltip >
210+ < TooltipTrigger
211+ render = {
212+ < SidebarMenuButton aria-label = "Usage" onClick = { handleUsageClick } size = "icon" >
213+ < ChartNoAxesColumnIcon />
214+ </ SidebarMenuButton >
215+ }
216+ />
217+ < TooltipPopup side = "top" > Usage</ TooltipPopup >
218+ </ Tooltip >
219+ </ SidebarMenuItem >
220+ </ >
198221 ) }
199- < SidebarMenuItem >
200- < SidebarMenuButton onClick = { handleSettingsClick } >
201- < SettingsIcon />
202- < span > Settings</ span >
203- </ SidebarMenuButton >
204- </ SidebarMenuItem >
222+ < SidebarUpdatePill />
205223 </ SidebarMenu >
206224 </ SidebarFooter >
207225 ) ;
0 commit comments