feat(chat): Improve text color and segment spacing in UI components

This commit is contained in:
cogwheel0
2025-12-07 23:47:40 +05:30
parent 03c2b030e1
commit dcca839e35
3 changed files with 21 additions and 11 deletions

View File

@@ -420,7 +420,7 @@ class _AssistantMessageWidgetState extends ConsumerState<AssistantMessageWidget>
? Icons.keyboard_arrow_up_rounded
: Icons.keyboard_arrow_down_rounded,
size: 14,
color: theme.textSecondary,
color: theme.textPrimary.withValues(alpha: 0.8),
),
const SizedBox(width: 2),
Flexible(
@@ -429,7 +429,7 @@ class _AssistantMessageWidgetState extends ConsumerState<AssistantMessageWidget>
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: AppTypography.bodySmall,
color: theme.textSecondary,
color: theme.textPrimary.withValues(alpha: 0.8),
height: 1.3,
),
),
@@ -518,6 +518,7 @@ class _AssistantMessageWidgetState extends ConsumerState<AssistantMessageWidget>
Widget _buildSegmentedContent() {
final children = <Widget>[];
bool firstToolSpacerAdded = false;
bool hasNonTextSegment = false;
int idx = 0;
for (final seg in _segments) {
if (seg.isTool && seg.toolCall != null) {
@@ -527,9 +528,16 @@ class _AssistantMessageWidgetState extends ConsumerState<AssistantMessageWidget>
firstToolSpacerAdded = true;
}
children.add(_buildToolCallTile(seg.toolCall!));
hasNonTextSegment = true;
} else if (seg.isReasoning && seg.reasoning != null) {
children.add(_buildReasoningTile(seg.reasoning!, idx));
hasNonTextSegment = true;
} else if ((seg.text ?? '').trim().isNotEmpty) {
// Add spacing before text content if it follows non-text segments
if (hasNonTextSegment) {
children.add(const SizedBox(height: Spacing.sm));
hasNonTextSegment = false;
}
children.add(_buildEnhancedMarkdownContent(seg.text!));
}
idx++;
@@ -1342,7 +1350,7 @@ class _AssistantMessageWidgetState extends ConsumerState<AssistantMessageWidget>
? Icons.keyboard_arrow_up_rounded
: Icons.keyboard_arrow_down_rounded,
size: 14,
color: theme.textSecondary,
color: theme.textPrimary.withValues(alpha: 0.8),
),
const SizedBox(width: 2),
Flexible(
@@ -1351,7 +1359,7 @@ class _AssistantMessageWidgetState extends ConsumerState<AssistantMessageWidget>
overflow: TextOverflow.ellipsis,
style: TextStyle(
fontSize: AppTypography.bodySmall,
color: theme.textSecondary,
color: theme.textPrimary.withValues(alpha: 0.8),
height: 1.3,
),
),

View File

@@ -68,8 +68,8 @@ class _OpenWebUISourcesWidgetState extends State<OpenWebUISourcesWidget> {
splashColor: theme.surfaceContainer.withValues(alpha: 0.2),
child: Container(
padding: const EdgeInsets.symmetric(
horizontal: 14,
vertical: 8,
horizontal: 10,
vertical: 5,
),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20),

View File

@@ -137,7 +137,7 @@ class _MinimalStatusRow extends StatelessWidget {
? Icons.keyboard_arrow_up_rounded
: Icons.keyboard_arrow_down_rounded,
size: 14,
color: theme.textSecondary,
color: theme.textPrimary.withValues(alpha: 0.8),
),
const SizedBox(width: 2),
],
@@ -166,9 +166,10 @@ class _MinimalStatusRow extends StatelessWidget {
bool isPending,
) {
final theme = context.conduitTheme;
final baseColor = theme.textPrimary.withValues(alpha: 0.8);
final baseStyle = TextStyle(
fontSize: AppTypography.bodySmall,
color: theme.textSecondary,
color: baseColor,
height: 1.3,
);
@@ -184,7 +185,7 @@ class _MinimalStatusRow extends StatelessWidget {
return Text(
description,
style: baseStyle.copyWith(
color: theme.textSecondary.withValues(alpha: opacity),
color: baseColor.withValues(alpha: opacity),
),
maxLines: 1,
);
@@ -288,9 +289,10 @@ class _MinimalHistoryTimeline extends StatelessWidget {
bool isPending,
) {
final theme = context.conduitTheme;
final baseColor = theme.textPrimary.withValues(alpha: 0.8);
final baseStyle = TextStyle(
fontSize: AppTypography.bodySmall,
color: theme.textSecondary,
color: baseColor,
height: 1.3,
);
@@ -305,7 +307,7 @@ class _MinimalHistoryTimeline extends StatelessWidget {
return Text(
description,
style: baseStyle.copyWith(
color: theme.textSecondary.withValues(alpha: opacity),
color: baseColor.withValues(alpha: opacity),
),
);
},