Skip to content

Commit a7fd1fa

Browse files
committed
Version 1.0.4 is expected to be released.
1 parent 428caf4 commit a7fd1fa

5 files changed

Lines changed: 70 additions & 25 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
- 知识库功能.
1414
- 优化了MCP服务器的载入和启动配置.
1515
- 优化了Agent自主生成文件默认在工作目录下.
16-
-
16+
1717

1818
## en
1919
- Optimized the issue of potential stuttering during long conversations.
@@ -24,7 +24,9 @@
2424
- Optimized code highlighting.
2525
- Use [archify](https://github.com/tt-a1i/archify) to summarize and output flowcharts of conversations.
2626
- More reliable version workflows.
27-
27+
- Knowledge base functionality.
28+
- Optimized MCP server loading and startup configuration.
29+
- Optimized the default location of Agent-generated files in the working directory.
2830

2931
# V1.0.3
3032

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
<img src="https://img.shields.io/badge/Skill Support-purple.svg" alt="Skill" />
1616
<img src="https://img.shields.io/badge/API Server-green.svg" alt="API Server" />
1717
<img src="https://img.shields.io/badge/🐱 Global Pet Agent-orange.svg" alt="Pet Agent" />
18-
<img src="https://img.shields.io/badge/v1.0.4-latest-informational.svg" alt="Version" />
1918
</p>
2019
</div>
2120

README_EN.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@
1515
<img src="https://img.shields.io/badge/Skill Support-purple.svg" alt="Skill" />
1616
<img src="https://img.shields.io/badge/API Server-green.svg" alt="API Server" />
1717
<img src="https://img.shields.io/badge/🐱 Global Pet Agent-orange.svg" alt="Pet Agent" />
18-
<img src="https://img.shields.io/badge/v1.0.4-latest-informational.svg" alt="Version" />
19-
</p>
18+
</p>
2019
</div>
2120

2221
---

how_to_use.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@
44
- 工作目录下手动添加memory.json文件可以手动修改权限
55
- 新建工作目录可以与指定工作目录同名,这样在工作目录下面添加memory.json
66
- 在制作Skill的时候,提供openai格式的tool.json可以注入工具给Agent
7-
- 可以在工作目录下自建.toolshell/skills文件夹进行当前工作目录技能注入
7+
- 可以在工作目录下自建.toolshell/skills文件夹进行当前工作目录技能注入
8+
- 如果某历史记录对应的工作目录被删除了,即使切换到此历史,模型上下文也没有了

lib/features/models/model_cards_page.dart

Lines changed: 63 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,37 @@ class _DetectedModel {
1616
const _DetectedModel(this.id, [this.contextWindow = 0]);
1717
}
1818

19-
class ModelCardsPage extends ConsumerWidget {
19+
class ModelCardsPage extends ConsumerStatefulWidget {
2020
const ModelCardsPage({super.key});
2121

2222
@override
23-
Widget build(BuildContext context, WidgetRef ref) {
23+
ConsumerState<ModelCardsPage> createState() => _ModelCardsPageState();
24+
}
25+
26+
class _ModelCardsPageState extends ConsumerState<ModelCardsPage> {
27+
/// 是否处于排序模式(拖拽可用)
28+
bool _reorderMode = false;
29+
30+
@override
31+
Widget build(BuildContext context) {
2432
final cardsAsync = ref.watch(modelCardsProvider);
2533

2634
return Scaffold(
27-
appBar: AppBar(title: Text(context.s.modelsTitle)),
35+
appBar: AppBar(
36+
title: Text(context.s.modelsTitle),
37+
actions: [
38+
// 排序模式切换
39+
if (cardsAsync.valueOrNull != null &&
40+
cardsAsync.valueOrNull!.length > 1)
41+
IconButton(
42+
icon: Icon(
43+
_reorderMode ? Icons.done : Icons.swap_vert,
44+
),
45+
tooltip: _reorderMode ? '完成排序' : '拖拽排序',
46+
onPressed: () => setState(() => _reorderMode = !_reorderMode),
47+
),
48+
],
49+
),
2850
body: cardsAsync.when(
2951
loading: () => const Center(child: CircularProgressIndicator()),
3052
error: (err, stack) =>
@@ -62,25 +84,47 @@ class ModelCardsPage extends ConsumerWidget {
6284
child: Column(
6385
crossAxisAlignment: CrossAxisAlignment.start,
6486
children: [
65-
Padding(
66-
padding: const EdgeInsets.only(bottom: 12),
67-
child: Text(
68-
context.s.modelsReorderHint,
69-
style: Theme.of(context).textTheme.bodySmall?.copyWith(
70-
color: Theme.of(context).colorScheme.onSurfaceVariant,
87+
if (_reorderMode)
88+
Padding(
89+
padding: const EdgeInsets.only(bottom: 12),
90+
child: Text(
91+
context.s.modelsReorderHint,
92+
style: Theme.of(context).textTheme.bodySmall?.copyWith(
93+
color: Theme.of(context).colorScheme.onSurfaceVariant,
94+
),
7195
),
7296
),
73-
),
74-
ReorderableCardGrid<ModelCard>(
75-
items: cards,
76-
keyOf: (c) => c.id,
77-
onReorder: (reordered) =>
78-
ref.read(modelCardsProvider.notifier).reorder(reordered),
79-
itemBuilder: (context, card) => _ModelCardTile(card: card),
80-
trailing: _AddModelCard(
81-
onTap: () => _showAddDialog(context, ref),
97+
// 排序模式:带拖拽的重排网格
98+
// 普通模式:轻量 Wrap,点击即切换默认,无拖拽开销
99+
if (_reorderMode)
100+
ReorderableCardGrid<ModelCard>(
101+
items: cards,
102+
keyOf: (c) => c.id,
103+
onReorder: (reordered) =>
104+
ref.read(modelCardsProvider.notifier).reorder(reordered),
105+
itemBuilder: (context, card) => _ModelCardTile(card: card),
106+
trailing: _AddModelCard(
107+
onTap: () => _showAddDialog(context, ref),
108+
),
109+
)
110+
else
111+
Wrap(
112+
spacing: 12,
113+
runSpacing: 12,
114+
children: [
115+
for (final card in cards)
116+
SizedBox(
117+
width: 280,
118+
child: _ModelCardTile(card: card),
119+
),
120+
SizedBox(
121+
width: 280,
122+
child: _AddModelCard(
123+
onTap: () => _showAddDialog(context, ref),
124+
),
125+
),
126+
],
82127
),
83-
),
84128
],
85129
),
86130
);

0 commit comments

Comments
 (0)