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
@@ -343,6 +343,19 @@ class Client {
|
||||
directory: directory, body: {'model': model.toJson()});
|
||||
}
|
||||
|
||||
/// The instance settings. `surface` selects a per-surface profile (a phone
|
||||
/// still shares every key that is not marked per-surface).
|
||||
Future<Map<String, dynamic>> settings({String surface = 'mobile'}) async {
|
||||
return _json('GET', '/api/config/settings', query: {'surface': surface});
|
||||
}
|
||||
|
||||
/// Persists a partial settings patch and returns the updated settings.
|
||||
Future<Map<String, dynamic>> saveSettings(Map<String, dynamic> patch,
|
||||
{String surface = 'mobile'}) async {
|
||||
return _json('PUT', '/api/config/settings',
|
||||
query: {'surface': surface}, body: patch);
|
||||
}
|
||||
|
||||
Future<void> switchAgent(String sessionId, String agent, {String? directory}) async {
|
||||
await _json('POST', '/api/session/${Uri.encodeComponent(sessionId)}/agent',
|
||||
directory: directory, body: {'agent': agent});
|
||||
|
||||
Reference in new issue
Block a user