feat: a settings page, a server footer in the sidebar, and follow-up behaviour
- The sidebar's server switch moves to a footer bar: the connected server's name on the left (tap for the server sheet) and a settings key on the right, matching the first-party phone layout. - Settings has three groups: 外观 (theme mode and seed colour, stored on the device only in shared_preferences), 聊天 (the server's followUpBehavior: steer or queue) and a 宠物 placeholder. The app theme now reads the seed and mode. - The chat's short send while a turn runs uses the configured follow-up behaviour; the long-press sheet offers both and marks the default. The value is read from GET /api/config/settings?surface=mobile on connect, on resume and when the page opens, and written back with PUT. - Tests: settings page groups and choice, sidebar footer naming the server and opening settings, follow-up normalization. - 0.3.17 (317).
This commit is contained in:
1 parent
1aa84a53e5
commit
e646130d1f
13 files changed
+544
-15
No files matched your search
@@ -1621,6 +1621,9 @@ class _ChatScreenState extends State<ChatScreen> {
|
||||
if (!chat.running) return _send();
|
||||
final text = _draftCtrl.text.trim();
|
||||
if (text.isEmpty && _attachments.isEmpty) return;
|
||||
// The configured behavior is what a short press does; mark it here too.
|
||||
final fallback = widget.app.followUpBehavior;
|
||||
final scheme = Theme.of(context).colorScheme;
|
||||
final picked = await showModalBottomSheet<String>(
|
||||
context: context,
|
||||
showDragHandle: true,
|
||||
@@ -1639,12 +1642,18 @@ class _ChatScreenState extends State<ChatScreen> {
|
||||
leading: const Icon(Icons.alt_route),
|
||||
title: const Text('转向当前回合'),
|
||||
subtitle: const Text('在下一步加入,工作继续'),
|
||||
trailing: fallback == 'steer'
|
||||
? Icon(Icons.check, size: 20, color: scheme.primary)
|
||||
: null,
|
||||
onTap: () => Navigator.pop(sheet, 'steer'),
|
||||
),
|
||||
ListTile(
|
||||
leading: const Icon(Icons.schedule),
|
||||
title: const Text('排队'),
|
||||
subtitle: const Text('等本轮结束后发送'),
|
||||
trailing: fallback == 'queue'
|
||||
? Icon(Icons.check, size: 20, color: scheme.primary)
|
||||
: null,
|
||||
onTap: () => Navigator.pop(sheet, 'queue'),
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
@@ -1659,9 +1668,10 @@ class _ChatScreenState extends State<ChatScreen> {
|
||||
Future<void> _send({String? delivery}) async {
|
||||
final text = _draftCtrl.text.trim();
|
||||
if (text.isEmpty && _attachments.isEmpty) return;
|
||||
// An ordinary send while a turn runs joins it, as dsh-Go does; the
|
||||
// long-press sheet can choose to wait instead.
|
||||
final effective = chat.running ? (delivery ?? 'steer') : null;
|
||||
// A short send while a turn runs uses the configured follow-up behavior;
|
||||
// the long-press sheet can choose the other one for this message.
|
||||
final effective =
|
||||
chat.running ? (delivery ?? widget.app.followUpBehavior) : null;
|
||||
// Files ride with the prompt as data URLs.
|
||||
final files = <Map<String, String>>[];
|
||||
final images = <String>[];
|
||||
|
||||
Reference in new issue
Block a user