feat: tabs own the panel header, a Termux key bar, and agent memory

- The panel's top row is now the tab group plus the close button; each tab
  keeps its own header: the files tab has the breadcrumb with new/more (or
  the name and edit/download while previewing), knowledge its search and
  refresh, the terminal its status.
- The key bar is Termux's two rows of seven: ESC / — HOME ↑ END PGUP, then
  TAB CTRL ALT ← ↓ → PGDN; the modifiers still apply to what the phone
  keyboard types.
- The panel is a dialog, so it gives the IME's height back itself
  (viewInsets.bottom). The key bar and the terminal stay above the
  keyboard, and the PTY reflows to the smaller terminal.
- Project knowledge gains the memory tab: both scopes from
  /api/agent-memory/all, absent when the server has memory switched off,
  with type, edit and delete.
- File preview editing passes minLines: null alongside expands.
- 0.3.12 (312).
This commit is contained in:
blumia committed 2026-11-21 11:09:44 +08:00
1 parent 5f95e2da97
commit 5a371e4faf
8 files changed
+675 -231

No files matched your search

+56
View File
@@ -586,6 +586,62 @@ class Client {
return ProjectPlanContent.fromJson(r);
}
// ----------------------------------------------------------------- memory
/// Both memory scopes at once; null when the server has the feature switched
/// off (the route answers 404, which it also uses for a missing entry, but
/// this read has no entry id to miss).
Future<AgentMemorySnapshot?> agentMemory(String projectId,
{String? directory}) async {
try {
final r = await _json('GET', '/api/agent-memory/all',
query: {
if (projectId.isNotEmpty) 'projectId': projectId,
},
directory: directory);
return AgentMemorySnapshot.fromJson(r);
} on ApiError catch (error) {
if (error.status == 404) return null;
rethrow;
}
}
Future<void> updateMemory(String memoryId,
{required String scope,
String? projectId,
String? title,
String? body,
String? type,
String? directory}) async {
await _json(
'PATCH', '/api/agent-memory/${Uri.encodeComponent(memoryId)}',
query: {
'scope': scope,
if (scope == 'project' && projectId != null && projectId.isNotEmpty)
'projectId': projectId,
},
body: {
if (title != null) 'title': title,
if (body != null) 'body': body,
if (type != null) 'type': type,
},
directory: directory);
}
Future<void> deleteMemory(String memoryId,
{required String scope,
String? projectId,
String? directory}) async {
await _json(
'DELETE', '/api/agent-memory/${Uri.encodeComponent(memoryId)}',
query: {
'scope': scope,
if (scope == 'project' && projectId != null && projectId.isNotEmpty)
'projectId': projectId,
},
directory: directory);
}
// --------------------------------------------------------------- terminal
Future<TerminalSessionInfo> createTerminal(