🐛 Bug fixes
This commit is contained in:
@@ -46,7 +46,6 @@ class _FunctionCallsSectionState extends State<FunctionCallsSection> {
|
|||||||
return Column(
|
return Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
const Gap(12),
|
|
||||||
Container(
|
Container(
|
||||||
padding: const EdgeInsets.all(8),
|
padding: const EdgeInsets.all(8),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:gap/gap.dart';
|
|
||||||
import 'package:material_symbols_icons/material_symbols_icons.dart';
|
import 'package:material_symbols_icons/material_symbols_icons.dart';
|
||||||
|
|
||||||
class ProposalsSection extends StatelessWidget {
|
class ProposalsSection extends StatelessWidget {
|
||||||
@@ -21,7 +20,6 @@ class ProposalsSection extends StatelessWidget {
|
|||||||
return Column(
|
return Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
const Gap(12),
|
|
||||||
Wrap(
|
Wrap(
|
||||||
spacing: 8,
|
spacing: 8,
|
||||||
runSpacing: 8,
|
runSpacing: 8,
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ class ReasoningSection extends StatelessWidget {
|
|||||||
return Column(
|
return Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
const Gap(12),
|
|
||||||
Container(
|
Container(
|
||||||
padding: const EdgeInsets.all(8),
|
padding: const EdgeInsets.all(8),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
|
|||||||
@@ -24,12 +24,20 @@ class ThoughtContent extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
child: SelectableText(
|
child: MarkdownTextContent(
|
||||||
streamingText,
|
isSelectable: true,
|
||||||
style: TextStyle(
|
content: streamingText,
|
||||||
color: Theme.of(context).colorScheme.onSurface,
|
extraBlockSyntaxList: [ProposalBlockSyntax()],
|
||||||
height: 1.4,
|
textStyle: Theme.of(context).textTheme.bodyMedium,
|
||||||
),
|
extraGenerators: [
|
||||||
|
ProposalGenerator(
|
||||||
|
backgroundColor:
|
||||||
|
Theme.of(context).colorScheme.secondaryContainer,
|
||||||
|
foregroundColor:
|
||||||
|
Theme.of(context).colorScheme.onSecondaryContainer,
|
||||||
|
borderColor: Theme.of(context).colorScheme.outline,
|
||||||
|
),
|
||||||
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(width: 8),
|
const SizedBox(width: 8),
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ import 'package:island/widgets/thought/thought_content.dart';
|
|||||||
import 'package:island/widgets/thought/thought_header.dart';
|
import 'package:island/widgets/thought/thought_header.dart';
|
||||||
import 'package:island/widgets/thought/token_info.dart';
|
import 'package:island/widgets/thought/token_info.dart';
|
||||||
import 'package:material_symbols_icons/material_symbols_icons.dart';
|
import 'package:material_symbols_icons/material_symbols_icons.dart';
|
||||||
import 'package:styled_widget/styled_widget.dart';
|
|
||||||
|
|
||||||
List<Map<String, String>> _extractProposals(String content) {
|
List<Map<String, String>> _extractProposals(String content) {
|
||||||
final proposalRegex = RegExp(
|
final proposalRegex = RegExp(
|
||||||
@@ -237,6 +236,7 @@ class ThoughtItem extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
spacing: 8,
|
||||||
children: [
|
children: [
|
||||||
// Main content
|
// Main content
|
||||||
ThoughtContent(
|
ThoughtContent(
|
||||||
@@ -246,14 +246,21 @@ class ThoughtItem extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
|
|
||||||
// Reasoning chunks (streaming only)
|
// Reasoning chunks (streaming only)
|
||||||
ReasoningSection(reasoningChunks: reasoningChunks),
|
if (reasoningChunks.isNotEmpty)
|
||||||
|
ReasoningSection(reasoningChunks: reasoningChunks),
|
||||||
|
|
||||||
// Function calls
|
// Function calls
|
||||||
FunctionCallsSection(
|
if (streamingFunctionCalls.isNotEmpty ||
|
||||||
isStreaming: isStreaming,
|
(thought?.chunks.isNotEmpty ?? false) &&
|
||||||
streamingFunctionCalls: streamingFunctionCalls,
|
thought!.chunks.any(
|
||||||
thought: thought,
|
(chunk) =>
|
||||||
),
|
chunk.type == ThinkingChunkType.functionCall,
|
||||||
|
))
|
||||||
|
FunctionCallsSection(
|
||||||
|
isStreaming: isStreaming,
|
||||||
|
streamingFunctionCalls: streamingFunctionCalls,
|
||||||
|
thought: thought,
|
||||||
|
),
|
||||||
|
|
||||||
// Token count and model name (for completed AI thoughts only)
|
// Token count and model name (for completed AI thoughts only)
|
||||||
if (!isStreaming && isAI && thought != null)
|
if (!isStreaming && isAI && thought != null)
|
||||||
@@ -266,10 +273,7 @@ class ThoughtItem extends StatelessWidget {
|
|||||||
onProposalAction: _handleProposalAction,
|
onProposalAction: _handleProposalAction,
|
||||||
),
|
),
|
||||||
|
|
||||||
if (isStreaming && isAI)
|
if (isStreaming && isAI) LinearProgressIndicator(),
|
||||||
LinearProgressIndicator().padding(
|
|
||||||
top: streamingText.isNotEmpty ? 8 : 0,
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ class TokenInfo extends StatelessWidget {
|
|||||||
return Column(
|
return Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
children: [
|
children: [
|
||||||
const Gap(8),
|
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
if (thought.modelName != null) ...[
|
if (thought.modelName != null) ...[
|
||||||
|
|||||||
Reference in New Issue
Block a user