feat: add a project from the picker, and keep the context ring

- the project picker has an "Add project" action: a folder browser starts
  at the server user's home, navigates (typed path, up, new folder) and
  adds the chosen folder through POST /api/openchamber/directory; the new
  project becomes the draft's target at once
- refreshProjects merges settings-only projects (newest added first), so a
  project added before its first session still appears in the picker; the
  first session moves it into /api/project as usual
- usageReading no longer hides the composer's context ring when the
  session's model has left the server catalog: a 200K window is assumed,
  the percentage is prefixed with "~", and the usage sheet says the window
  is estimated. A failed model fetch at connect is retried when a chat
  opens, so a normal session shows the real percentage
- tests: the add-project browser flow, settings-only projects, and the
  estimated/known context readings
This commit is contained in:
blumia committed 2026-11-27 09:26:14 +08:00
1 parent bd8afeb686
commit c6b5a870c6
11 files changed
+708 -22

No files matched your search

+12
View File
@@ -11,7 +11,9 @@ const Map<String, String> chineseStrings = {
'Accent color': '主题色',
'Accent color {0}': '主题色 {0}',
'Add attachment': '添加附件',
'Add project': '添加项目',
'Add server': '添加服务器',
'Add this folder': '添加此文件夹',
'Add time': '添加时间',
'Agent': '智能体',
'Agent tools': '通用',
@@ -75,12 +77,15 @@ const Map<String, String> chineseStrings = {
'Copy answer': '复制回答',
'Copy message': '复制消息',
'Copy session ID': '复制会话 ID',
'Could not add the project: {0}': '无法添加项目:{0}',
'Could not attach: {0}': '选择失败:{0}',
'Could not connect to the relay: {0}': '无法连接 Relay:{0}',
'Could not create the chat directory: {0}': '无法创建聊天目录:{0}',
'Could not create the folder: {0}': '无法创建文件夹:{0}',
'Could not decode the QR code; try again': '二维码解码出错,请重试',
'Could not get a WebSocket token ({0})': '无法获取 WebSocket 令牌({0})',
'Could not load image: {0}': '图片加载失败:{0}',
'Could not load this folder: {0}': '无法加载此文件夹:{0}',
'Could not load, refresh to retry': '读取失败,请刷新',
'Could not open the camera: {0}': '无法打开相机:{0}',
'Could not open the subagent session: {0}': '无法打开子代理会话:{0}',
@@ -142,6 +147,7 @@ const Map<String, String> chineseStrings = {
'Edit scheduled task': '编辑计划任务',
'Enable pet': '启用宠物',
'Enabled': '已启用',
'Enter a valid folder name': '请输入有效的文件夹名称',
'End-to-end encrypted; the server and device token stay the same': '端到端加密;服务器与设备令牌保持不变',
'Ended': '已结束',
'Error': '错误',
@@ -162,6 +168,8 @@ const Map<String, String> chineseStrings = {
'File {0}': '文件 {0}',
'Files': '文件',
'Flashlight': '手电筒',
'Folder name': '文件夹名称',
'Folder path': '文件夹路径',
'Follow system': '跟随系统',
'Follow the system, Chinese or English': '跟随系统、中文或 English',
'Follow-up behavior': '追问处理行为',
@@ -172,6 +180,7 @@ const Map<String, String> chineseStrings = {
'Generating summary…': '正在生成摘要…',
'Generating; you can still type…': '生成中,仍可输入…',
'Global memory': '全局记忆',
'Go': '前往',
'Goal': '目标',
'Got it': '知道了',
'Help & about': '帮助与关于',
@@ -261,6 +270,7 @@ const Map<String, String> chineseStrings = {
'No content': '无内容',
'no date': '未选日期',
'no days': '未选',
'No folders here': '此目录没有子文件夹',
'No matching files': '没有匹配的文件',
'No matching files in subdirectories': '子目录里没有匹配的文件',
'No matching memories': '没有匹配的记忆',
@@ -450,6 +460,7 @@ const Map<String, String> chineseStrings = {
'The agent notifies you when work finishes or gets stuck.': '工作完成或卡住时,智能体会通知你。',
'The archive has no pack.json': '压缩包里没有 pack.json',
'The model failed to authenticate. Sign in again on the server or check the API key.': '模型的认证失败,请在服务端重新登录或检查 API Key。',
'The model is not in the catalog; the context window is estimated.': '该模型不在模型目录中,上下文窗口为估算值。',
'The pet pack stored on this device will be deleted.': '本机保存的宠物包会被删除。',
'The server doesn\'t support scheduled tasks': '服务器不支持计划任务',
'The theme is stored on this device only and does not sync with the server.': '主题只保存在本机,不随服务器同步。',
@@ -591,6 +602,7 @@ const Map<String, String> chineseStrings = {
'Success rate': '成功率',
'Failed': '失败',
'Unfinished': '未完成',
'Up': '上一级',
'Updated {0}': '更新于 {0}',
'Subagents: {0}': '子代理:{0}',
'In {0} · Out {1} · Cache {2}': '输入 {0} · 输出 {1} · 缓存 {2}',