From 4bbcd5fb4928cdd2fa7e3ec1b0b2ff56f01cb469 Mon Sep 17 00:00:00 2001 From: ggurdin Date: Wed, 17 Dec 2025 15:40:58 -0500 Subject: [PATCH] conditional top padding for practice tooltips --- .../layout/message_selection_positioner.dart | 52 +++++++++++-------- 1 file changed, 30 insertions(+), 22 deletions(-) diff --git a/lib/pangea/toolbar/layout/message_selection_positioner.dart b/lib/pangea/toolbar/layout/message_selection_positioner.dart index 9af6d7c94..612521b86 100644 --- a/lib/pangea/toolbar/layout/message_selection_positioner.dart +++ b/lib/pangea/toolbar/layout/message_selection_positioner.dart @@ -395,28 +395,6 @@ class MessageSelectionPositionerState extends State alignment: ownMessage ? Alignment.centerRight : Alignment.centerLeft, children: [ - Positioned( - top: 0, - left: 0, - right: 0, - child: ListenableBuilder( - listenable: widget.overlayController.practiceController, - builder: (context, _) { - final instruction = widget.overlayController - .practiceController.practiceMode.instruction; - if (instruction != null) { - return InstructionsInlineTooltip( - instructionsEnum: widget.overlayController - .practiceController.practiceMode.instruction!, - padding: const EdgeInsets.all(16.0), - animate: false, - ); - } - - return const SizedBox(); - }, - ), - ), ValueListenableBuilder( valueListenable: _startedTransition, builder: (context, started, __) { @@ -458,6 +436,36 @@ class MessageSelectionPositionerState extends State selectedToken: widget.overlayController.selectedToken, ), ), + Positioned( + top: switch (MediaQuery.heightOf(context)) { + < 700 => 0, + > 900 => 160, + _ => 80, + }, + left: 0, + right: 0, + child: ListenableBuilder( + listenable: + widget.overlayController.practiceController, + builder: (context, _) { + final instruction = widget.overlayController + .practiceController.practiceMode.instruction; + if (instruction != null) { + return InstructionsInlineTooltip( + instructionsEnum: widget + .overlayController + .practiceController + .practiceMode + .instruction!, + padding: const EdgeInsets.all(16.0), + animate: false, + ); + } + + return const SizedBox(); + }, + ), + ), ], ], ),