Commit Graph
18 Commits
Author SHA1 Message Date
xiaomakuaiz 7c943b1994 fix(mobile): address review findings for math rendering and stream lifecycle
Review-driven batch on top of the math feature:

- Ask-card custom answer: scroll the card above the keyboard on input
  focus (inverted-list scrollToIndex, viewPosition 0).
- Inline math boundaries: closing-$ guard switched to a negated class so
  bold-wrapped/operator-adjacent formulas (**$E=mc^2$**, $a$-$b$) and
  han-adjacent Chinese phrasing render; CJK/full-width punctuation
  excluded from $-content to kill currency false positives.
- Clamp MathJax output size (rule-bomb guard), reject empty $$ blocks,
  clamp throttle elapsed against clock steps, and gate O(n^2) slicing in
  the inline tokenizer behind a first-char check.
- Streaming perf: stable body root key + content-hash node keys keep
  top-level formulas mounted across re-parses; TeX->SVG and parsed-AST
  LRU caches; memoized markdown style object.
- Android: scale inline formulas into the fixed line box and drop the
  baseline shift (CustomLineHeightSpan overlaps oversized inline views).
- handleSend snapshots the disconnect() return so throttled tail chunks
  are archived; effect cleanup also disconnects the newRound client;
  failPendingToolCalls replaces message objects so memoized tool cards
  observe the status flip.
- Swap @babel/plugin-transform-dynamic-import to the ^7 line (the ^8
  line is Babel-8/ESM-only and breaks installs and jest on older Node).
2026-08-30 17:52:36 +08:00
xiaomakuaiz 1d6628b488 fix(mobile): coalesce stream emits to stop update-depth warnings
Replaying long conversations emits hundreds of per-chunk state updates,
driving back-to-back commits whose passive-effect flushes keep React's
nested-update counter climbing (Maximum update depth exceeded warning).
Throttle TaskStreamClient.emit with a leading+trailing 50ms window
(flushed on disconnect so terminal states still land), and key the
context-usage effect on primitive values instead of the per-emit
contextUsage object identity.
2026-08-28 23:37:06 +08:00
xiaomakuaiz edb8e28cea feat(mobile): add Alipay app login 2026-07-28 17:34:46 +08:00
xiaomakuaiz 9d4993ba42 feat(mobile): show workspace upload progress 2026-07-21 21:33:16 +08:00
xiaomakuaiz 834a085070 feat: support workspace file uploads on mobile 2026-07-20 22:29:30 +08:00
xiaomakuaiz 2a009ecb3c fix: improve mobile task workflows 2026-07-10 20:11:06 +08:00
xiaomakuaiz 5c0b43923b feat: support douyin app login on mobile 2026-07-09 14:58:57 +08:00
xiaomakuaiz 95fd8645c0 Polish mobile login UI 2026-07-06 22:58:21 +08:00
xiaomakuaiz 09d74886f5 Implement native Baizhi phone login 2026-07-06 18:01:54 +08:00
xiaomakuaiz 497c2a43e1 feat(mobile): add profile email binding 2026-07-06 14:26:37 +08:00
xiaomakuaiz bd72d593f0 fix mobile stream dedupe by sequence 2026-07-03 19:37:45 +08:00
xiaomakuaiz 27539d4c97 fix mobile wallet quota and model gating 2026-07-03 17:47:34 +08:00
xiaomakuaiz d51c8380ee chore: align mobile dependencies with Expo SDK 55 2026-07-03 11:46:38 +08:00
xiaomakuaiz 43cd04aafb feat(mobile): 新建项目 + 绑定/编辑 Git 账号
- 新建项目(new-project.tsx):项目页/空态入口 → 选已绑定 Git 账号 → 全屏可搜索选仓库(含手动填地址)→ 命名创建,成功进项目详情
- Git 账号管理(git-identities.tsx):列表 + 删除(409 占用提示)+ 添加方式选择(OAuth 一键授权 / 其他平台手动 Token)
- 绑定/编辑账号(git-identity-form.tsx):手动 PAT 表单,选平台自动填默认地址;?id= 进入编辑,platform/base_url 锁定、Token 留空不改、GitHub App 身份隐藏 Token
- OAuth 授权(git-oauth.tsx):复用登录 WebView 的域名判定,标准浏览器 UA 规避第三方(Google 等)对内嵌 WebView 的登录拦截,支持复制链接
- API/类型(client.ts/types.ts):createProject、git-identities 增删查/详情/更新、{platform}/authorize_url
- 我的页新增「集成」分组 + Git 账号入口;项目页改聚焦刷新并加「新建」入口
- 修复:创建/表单页改 push 屏,消除 iOS modal 下 GlassNav 顶部空白;PreviewBrowser cookie 行为注释(host-only 域隔离,刻意不加 sharedCookiesEnabled/incognito);Icons 补 key/link
2026-06-16 00:45:20 +08:00
xiaomakuaiz 4a45c4b0dc feat: Sign in with Apple 登录 + 账号注销(App Store 4.8 / 5.1.1(v))
移动端:
- 登录页新增 Sign in with Apple(仅 iOS + 官方云),app.json 开启 usesAppleSignIn
- 个人页新增「注销账号」入口,两步确认后删号;导航交给鉴权守卫避免二次跳转
- AuthContext 增加 loginWithApple / deleteAccount;登录直接用接口返回的用户信息

后端:
- 新增 POST /api/v1/users/apple-login:JWKS 验签 identity token,按 Apple sub
  找/建用户;同邮箱(仅信任 token 验签的邮箱)则关联既有个人账号,避免撞唯一索引
- 新增 DELETE /api/v1/users/account:软删用户及第三方身份,撤销 Apple 授权
- pkg/applesign:JWKS 验签(读写锁 + 负缓存,刷新不阻塞登录)+ token 换取/撤销
- user_identities 增加 credential 字段(存 Apple refresh token)+ 迁移 000013
- apple-login 仅在配置了 client_id 时启用,私有化部署默认关闭
2026-06-12 21:07:07 +08:00
xiaomakuaiz 63311f6d41 feat(mobile): 支持用户配置自己的大模型(我的模型)
- 「我的」页新增「自定义模型」入口;新增模型列表页与添加/编辑表单页
- 对接既有用户模型 API:创建/更新/删除/健康检查/供应商模型列表
- 流程对齐 Web 用户控制台(add-model/edit-model):保存前健康检查,
  编辑时连接字段(provider/model/base_url/api_key/interface_type)未变则跳过
- 列表用 ModelIcon 厂商品牌图标、modelLabel 命名,与模型选择器一致
- 编辑模式回填全部配置(后端对自有模型不脱敏 base_url/api_key),
  API Token 默认密文可切换明文
2026-06-12 06:40:13 +00:00
xiaomakuaiz 301a75fb16 feat(mobile): 任务对话支持选图作为附件发送 + 对话图片保存到相册
对齐 Web chat-inputbox:
- 选图:expo-image-picker 相册多选(≤3 张、仅图片);超 2MB 自动用 expo-image-manipulator
  缩边长 + JPEG 压缩到 2MB 内(≤2MB 原图直接用)
- 上传:预签名直传(POST /api/v1/uploader/presign → PUT 原始字节)。用 XHR(responseType blob)
  取本地文件,blob.slice(...,'') 去掉 Content-Type,fetch credentials:'omit' 跨域直传——对齐 Web
  的 new Blob([file]);否则 iOS 多发的 Content-Type 进入 SigV4 规范请求触发 SignatureDoesNotMatch
- 发送:user-input 负载带 attachments:[{url,filename}](原来恒为空);历史/实时用户消息渲染缩略图
- composer:暂存缩略图(上传中/失败态、可移除)、上传中禁发、并发上传;快捷指令不带走暂存图
- AI 的 markdown 图片:覆盖 markdown image 规则,用普通 <Image> + onLoad 自适应比例,修掉
  react-native-fit-image 永久 loading 转圈 + React19 "key spread into JSX" 告警
- 保存到相册:点对话里的图片 → expo-media-library/legacy 存系统相册
- 新增原生依赖 expo-image-picker / expo-image-manipulator / expo-media-library
  (需重新原生构建;app.json 加图库读/写权限)
2026-06-09 22:06:33 +08:00
xiaomakuaiz a6fd8ecbc8 chore(mobile): 移除旧 Capacitor 客户端,Expo 客户端(mobile-expo)重命名为 mobile
删除原 Capacitor 版 mobile/;将 SDK56 重构的 mobile-expo/ 重命名为 mobile/。
(android/ios/node_modules 等为 gitignore 生成物,未入库;本地需重新 npm install + prebuild)
2026-06-09 00:52:42 +08:00