Skip to content

Commit e096ea1

Browse files
author
Developer
committed
fix: align conversation text and bump plugin release
1 parent 455fd4f commit e096ea1

6 files changed

Lines changed: 158 additions & 184 deletions

File tree

app/lib/core/locale/app_localization_extensions.dart

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,4 @@ extension AppLocalizationBuildContextX on BuildContext {
5151
double localeAwareLetterSpacing({required double latin, double chinese = 0}) {
5252
return usesWideGlyphTypography ? chinese : latin;
5353
}
54-
55-
TextAlign localeAwareParagraphTextAlign({
56-
TextAlign standard = TextAlign.start,
57-
TextAlign wideGlyph = TextAlign.justify,
58-
}) {
59-
return usesWideGlyphTypography ? wideGlyph : standard;
60-
}
6154
}

app/lib/features/chat/chat_screen.dart

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5367,16 +5367,19 @@ class _MessageBubbleBody extends StatelessWidget {
53675367
],
53685368
),
53695369
const SizedBox(height: 5),
5370-
_InlineAgentmojiText(
5371-
text: message.body,
5372-
keyPrefix: 'msg-${message.id}',
5373-
selectable: true,
5374-
textAlign: context.localeAwareParagraphTextAlign(),
5375-
imageSize: 36,
5376-
style: Theme.of(context).textTheme.bodyLarge?.copyWith(
5377-
fontSize: 13.5,
5378-
height: 1.42,
5379-
color: AppColors.onSurface.withValues(alpha: 0.96),
5370+
SizedBox(
5371+
width: double.infinity,
5372+
child: _InlineAgentmojiText(
5373+
text: message.body,
5374+
keyPrefix: 'msg-${message.id}',
5375+
selectable: true,
5376+
textAlign: isRemote ? TextAlign.left : TextAlign.right,
5377+
imageSize: 36,
5378+
style: Theme.of(context).textTheme.bodyLarge?.copyWith(
5379+
fontSize: 13.5,
5380+
height: 1.42,
5381+
color: AppColors.onSurface.withValues(alpha: 0.96),
5382+
),
53805383
),
53815384
),
53825385
],

app/lib/features/debate/debate_screen.dart

Lines changed: 42 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2648,6 +2648,7 @@ class _StancePanel extends StatelessWidget {
26482648
final accentColor = seat.side == DebateSide.pro
26492649
? AppColors.primary
26502650
: AppColors.tertiary;
2651+
final alignRight = seat.side == DebateSide.con;
26512652
const cardRadius = BorderRadius.all(Radius.circular(12));
26522653

26532654
return DecoratedBox(
@@ -2670,7 +2671,9 @@ class _StancePanel extends StatelessWidget {
26702671
Padding(
26712672
padding: const EdgeInsets.fromLTRB(16, 14, 16, 14),
26722673
child: Column(
2673-
crossAxisAlignment: CrossAxisAlignment.start,
2674+
crossAxisAlignment: alignRight
2675+
? CrossAxisAlignment.end
2676+
: CrossAxisAlignment.start,
26742677
children: [
26752678
Row(
26762679
mainAxisSize: MainAxisSize.min,
@@ -2706,13 +2709,16 @@ class _StancePanel extends StatelessWidget {
27062709
],
27072710
),
27082711
const SizedBox(height: 8),
2709-
Text(
2710-
seat.stance,
2711-
textAlign: context.localeAwareParagraphTextAlign(),
2712-
style: Theme.of(context).textTheme.bodySmall?.copyWith(
2713-
color: AppColors.onSurfaceMuted,
2714-
fontSize: 12,
2715-
height: 1.45,
2712+
SizedBox(
2713+
width: double.infinity,
2714+
child: Text(
2715+
seat.stance,
2716+
textAlign: alignRight ? TextAlign.right : TextAlign.left,
2717+
style: Theme.of(context).textTheme.bodySmall?.copyWith(
2718+
color: AppColors.onSurfaceMuted,
2719+
fontSize: 12,
2720+
height: 1.45,
2721+
),
27162722
),
27172723
),
27182724
],
@@ -3045,15 +3051,20 @@ class _LiveFormalTurnCard extends StatelessWidget {
30453051
),
30463052
const SizedBox(height: AppSpacing.sm),
30473053
],
3048-
Text(
3049-
turn.quote,
3050-
textAlign: context.localeAwareParagraphTextAlign(),
3051-
style: Theme.of(context).textTheme.bodyLarge
3052-
?.copyWith(
3053-
fontSize: 15,
3054-
height: 1.56,
3055-
color: AppColors.onSurface,
3056-
),
3054+
SizedBox(
3055+
width: double.infinity,
3056+
child: Text(
3057+
turn.quote,
3058+
textAlign: alignRight
3059+
? TextAlign.right
3060+
: TextAlign.left,
3061+
style: Theme.of(context).textTheme.bodyLarge
3062+
?.copyWith(
3063+
fontSize: 15,
3064+
height: 1.56,
3065+
color: AppColors.onSurface,
3066+
),
3067+
),
30573068
),
30583069
],
30593070
),
@@ -3170,14 +3181,20 @@ class _LiveSpectatorMessageCard extends StatelessWidget {
31703181
],
31713182
),
31723183
const SizedBox(height: AppSpacing.sm),
3173-
Text(
3174-
message.body,
3175-
textAlign: context.localeAwareParagraphTextAlign(),
3176-
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
3177-
color: alignRight
3178-
? AppColors.primary
3179-
: AppColors.onSurface,
3180-
height: 1.48,
3184+
SizedBox(
3185+
width: double.infinity,
3186+
child: Text(
3187+
message.body,
3188+
textAlign: alignRight
3189+
? TextAlign.right
3190+
: TextAlign.left,
3191+
style: Theme.of(context).textTheme.bodyMedium
3192+
?.copyWith(
3193+
color: alignRight
3194+
? AppColors.primary
3195+
: AppColors.onSurface,
3196+
height: 1.48,
3197+
),
31813198
),
31823199
),
31833200
],

0 commit comments

Comments
 (0)