chore: reduce span card spacing to reduce unneeded scroll (#5160)

* chore: reduce span card spacing to reduce unneeded scroll

* remove debugging code
This commit is contained in:
ggurdin 2026-01-09 12:06:17 -05:00 committed by GitHub
parent 2aa0c42994
commit 0f80e9349f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -182,6 +182,7 @@ class SpanCardState extends State<SpanCard> {
langCode: MatrixState
.pangeaController.userController.userL2Code!,
),
const SizedBox(),
_SpanCardFeedback(
_selectedChoice != null,
_fetchFeedback,
@ -217,42 +218,37 @@ class _SpanCardFeedback extends StatelessWidget {
@override
Widget build(BuildContext context) {
return ConstrainedBox(
constraints: const BoxConstraints(
minHeight: 50.0,
),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
ValueListenableBuilder(
valueListenable: feedbackState,
builder: (context, state, __) {
return switch (state) {
AsyncIdle<String>() => hasSelectedChoice
? IconButton(
onPressed: fetchFeedback,
icon: const Icon(Icons.lightbulb_outline, size: 24),
)
: Text(
L10n.of(context).correctionDefaultPrompt,
style: BotStyle.text(context).copyWith(
fontStyle: FontStyle.italic,
),
return Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
ValueListenableBuilder(
valueListenable: feedbackState,
builder: (context, state, __) {
return switch (state) {
AsyncIdle<String>() => hasSelectedChoice
? IconButton(
onPressed: fetchFeedback,
icon: const Icon(Icons.lightbulb_outline, size: 24),
)
: Text(
L10n.of(context).correctionDefaultPrompt,
style: BotStyle.text(context).copyWith(
fontStyle: FontStyle.italic,
),
AsyncLoading<String>() => const SizedBox(
width: 24,
height: 24,
child: CircularProgressIndicator(),
),
AsyncError<String>(:final error) =>
ErrorIndicator(message: error.toString()),
AsyncLoaded<String>(:final value) =>
Text(value, style: BotStyle.text(context)),
};
},
),
],
),
),
AsyncLoading<String>() => const SizedBox(
width: 24,
height: 24,
child: CircularProgressIndicator(),
),
AsyncError<String>(:final error) =>
ErrorIndicator(message: error.toString()),
AsyncLoaded<String>(:final value) =>
Text(value, style: BotStyle.text(context)),
};
},
),
],
);
}
}