conditional top padding for practice tooltips

This commit is contained in:
ggurdin 2025-12-17 15:40:58 -05:00
parent 392b3e31c6
commit 4bbcd5fb49
No known key found for this signature in database
GPG key ID: A01CB41737CBB478

View file

@ -395,28 +395,6 @@ class MessageSelectionPositionerState extends State<MessageSelectionPositioner>
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<MessageSelectionPositioner>
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();
},
),
),
],
],
),