@@ -21,9 +21,10 @@ const ARROWS: Record<string, string> = { Left: "←", Right: "→", Up: "↑", D
2121/** How long a hint stays before its one-shot fade. */
2222const HINT_VISIBLE_MS = 2400 ;
2323const HINT_FADE_MS = 200 ;
24- /** Room between the hint and the composer (or the pane's bottom) under it. */
24+ /** Room between the hint and the composer under it. */
2525const HINT_GAP_PX = 12 ;
2626const HINT_EDGE_PX = 16 ;
27+ const HINT_BOTTOM_PX = 108 ;
2728
2829/** Fades the hint after a beat, then clears it. */
2930function useHintLifetime ( id : number ) : boolean {
@@ -44,9 +45,9 @@ function useHintLifetime(id: number): boolean {
4445}
4546
4647/**
47- * Centers a hint on the focused pane, a gap above its composer stack (banners,
48- * request cards and tray included), or above the pane's bottom when it has no
49- * composer . Follows the strip while it scrolls to the landed pane.
48+ * Centers a hint on the focused pane at the same height on every pane, lifted
49+ * a gap above its composer stack (banners, request cards and tray included)
50+ * when that grows taller . Follows the strip while it scrolls to the landed pane.
5051 */
5152function useHintPlacement ( ) {
5253 const [ hint , setHint ] = useState < HTMLDivElement | null > ( null ) ;
@@ -61,9 +62,10 @@ function useHintPlacement() {
6162 const hostRect = host . getBoundingClientRect ( ) ;
6263 const paneRect = pane . getBoundingClientRect ( ) ;
6364 const composer = pane . querySelector ( '[data-chat-composer-stack="true"]' ) ;
65+ const rest = paneRect . bottom - HINT_BOTTOM_PX ;
6466 const floor = composer
65- ? composer . getBoundingClientRect ( ) . top - HINT_GAP_PX
66- : paneRect . bottom - HINT_EDGE_PX ;
67+ ? Math . min ( rest , composer . getBoundingClientRect ( ) . top - HINT_GAP_PX )
68+ : rest ;
6769 const next = {
6870 left : paneRect . left + paneRect . width / 2 - hostRect . left ,
6971 bottom : hostRect . bottom - floor ,
@@ -151,7 +153,7 @@ function TerminalHintPill({ hint }: { hint: Extract<LayoutHintState, { kind: "te
151153 aria-live = "polite"
152154 data-layout-hint = "terminal"
153155 className = { cn (
154- "pointer-events-none absolute bottom-30 left-1/2 z-40 flex h-8.5 max-w-[calc(100%-2rem)] -translate-x-1/2 items-center gap-2.5 rounded-lg px-3 surface-tooltip transition-opacity duration-200 motion-reduce:transition-none" ,
156+ "pointer-events-none absolute bottom-27 left-1/2 z-40 flex h-8.5 max-w-[calc(100%-2rem)] -translate-x-1/2 items-center gap-2.5 rounded-lg px-3 surface-tooltip transition-opacity duration-200 motion-reduce:transition-none" ,
155157 leaving && "opacity-0" ,
156158 ) }
157159 >
@@ -212,7 +214,7 @@ function WorkspaceHintPill({
212214 aria-live = "polite"
213215 data-layout-hint = { hint . kind }
214216 className = { cn (
215- "pointer-events-none absolute bottom-30 left-1/2 z-40 flex max-w-[calc(100%-2rem)] -translate-x-1/2 items-center gap-2 rounded-lg px-3 surface-tooltip transition-opacity duration-200 motion-reduce:transition-none" ,
217+ "pointer-events-none absolute bottom-27 left-1/2 z-40 flex max-w-[calc(100%-2rem)] -translate-x-1/2 items-center gap-2 rounded-lg px-3 surface-tooltip transition-opacity duration-200 motion-reduce:transition-none" ,
216218 small ? "h-7.5" : "h-8.5 gap-2.5" ,
217219 leaving && "opacity-0" ,
218220 ) }
@@ -254,7 +256,7 @@ function ColumnHintPill({ hint }: { hint: Extract<LayoutHintState, { kind: "colu
254256 aria-live = "polite"
255257 data-layout-hint = "column"
256258 className = { cn (
257- "pointer-events-none absolute bottom-30 left-1/2 z-40 flex h-8.5 max-w-[calc(100%-2rem)] -translate-x-1/2 items-center gap-2.5 rounded-lg px-3 surface-tooltip transition-opacity duration-200 motion-reduce:transition-none" ,
259+ "pointer-events-none absolute bottom-27 left-1/2 z-40 flex h-8.5 max-w-[calc(100%-2rem)] -translate-x-1/2 items-center gap-2.5 rounded-lg px-3 surface-tooltip transition-opacity duration-200 motion-reduce:transition-none" ,
258260 leaving && "opacity-0" ,
259261 ) }
260262 >
0 commit comments