@@ -443,3 +443,58 @@ export const BackgroundProcesses: AppStory = {
443443 } ,
444444 } ,
445445} ;
446+
447+ /**
448+ * Mode selector with HelpIndicator tooltip - verifies props forwarding for Radix asChild.
449+ *
450+ * Regression test: HelpIndicator must spread rest props so TooltipTrigger's asChild
451+ * can attach event handlers for tooltip triggering.
452+ *
453+ * The fix ensures HelpIndicator forwards props (like onPointerEnter, onFocus) that
454+ * Radix TooltipTrigger needs when using asChild. Without the fix, the tooltip
455+ * would never appear on hover/focus.
456+ */
457+ export const ModeHelpTooltip : AppStory = {
458+ render : ( ) => (
459+ < AppWithMocks
460+ setup = { ( ) =>
461+ setupSimpleChatStory ( {
462+ messages : [ ] ,
463+ } )
464+ }
465+ />
466+ ) ,
467+ play : async ( { canvasElement } ) => {
468+ const canvas = within ( canvasElement ) ;
469+
470+ // Wait for app to fully load - the chat input with mode selector should be present
471+ await canvas . findAllByText ( "Exec" , { } , { timeout : 10000 } ) ;
472+
473+ // Find the help indicator "?" - should be a span with cursor-help styling
474+ const helpIndicators = canvas . getAllByText ( "?" ) ;
475+ const helpIndicator = helpIndicators . find (
476+ ( el ) => el . tagName === "SPAN" && el . className . includes ( "cursor-help" )
477+ ) ;
478+ if ( ! helpIndicator ) throw new Error ( "HelpIndicator not found" ) ;
479+
480+ // Hover to open the tooltip and leave it visible for the visual snapshot
481+ await userEvent . hover ( helpIndicator ) ;
482+
483+ // Wait for tooltip to fully appear (Radix has 200ms delay)
484+ await waitFor (
485+ ( ) => {
486+ const tooltip = document . querySelector ( '[role="tooltip"]' ) ;
487+ if ( ! tooltip ) throw new Error ( "Tooltip not visible" ) ;
488+ } ,
489+ { timeout : 2000 , interval : 50 }
490+ ) ;
491+ } ,
492+ parameters : {
493+ docs : {
494+ description : {
495+ story :
496+ "Verifies the HelpIndicator tooltip works by focusing the ? icon. The tooltip should appear with Exec/Plan mode explanations." ,
497+ } ,
498+ } ,
499+ } ,
500+ } ;
0 commit comments