Commit Graph
33 Commits
Author SHA1 Message Date
xiaomakuaiz f2fc4e43c0 fix(mobile): render tall delimiters and long block derivations
- fontCache 'none': MathJax's 'local' cache emits <defs>/<use> glyph refs,
  and assembled tall delimiters (S4 segments) reference outer templates
  from inside nested <svg> viewports - react-native-svg's template scope
  breaks across nested svg, so brackets lost segments and the native side
  spammed 'template not defined' warnings every streaming frame (which
  also kept dirtying React's passive-update counter via LogBox updates,
  resurfacing the Maximum update depth warning). Inlining every glyph
  path removes cross-scope references entirely; the LRU caches absorb
  the larger output.
- Separate block-math source budget (4096 chars vs 512 inline): multi-row
  aligned derivations routinely exceed 512 and fell back to raw source;
  the 60ex output-height clamp still bounds the rendered result.
2026-08-30 19:50:24 +08:00
xiaomakuaiz fbc00891b6 fix(mobile): make long formulas fully visible and touchable
- Promote whole-line single-line $$…$$ / \[…\] to block math (desktop
  promotes display math via CSS; inline views clip at screen edge with
  no way to scroll). Lines mixing text keep inline parsing.
- Scale inline math down to the available width; block math scales to
  fit one screen (no in-list horizontal scrolling - the vertical list
  always wins the gesture arbitration).
- Over-shrunk block formulas open a fullscreen viewer on tap: backdrop
  and ScrollView are siblings (a Pressable ancestor steals the drag on
  Android and closes the modal on release), wide hit strip, back-key
  close.
- pointerEvents:none on all math SVGs: react-native-svg's Android
  SvgView.interceptsTouchEvent() unconditionally claims touches, which
  blocked scrolling, tap-to-expand and long-press copy over formulas.
- Raise the output height clamp to 60ex so multi-line aligned
  derivations survive while \rule bombs (100ex) stay rejected.
2026-08-30 19:11:28 +08:00
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 980600235d feat(mobile): render math formulas in AI replies
Tokenize $...$, $$...$$, \(...\) and \[...\] via a markdown-it plugin
(delimiter semantics aligned with desktop), render TeX to SVG with a
lazily-loaded MathJax pipeline (LRU-cached, budget-guarded) and draw it
natively through react-native-svg; inline math flows with text baseline,
block math centers and scrolls horizontally. Falls back to source text
until MathJax is ready or when conversion fails.
2026-08-28 23:36:48 +08:00
xiaomakuaiz 9a90d090b6 fix(mobile): update login provider icons 2026-07-28 17:34:46 +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 14aa35d022 fix: stop composer blur bleeding over messages on iOS 26
UIVisualEffectView's gaussian blur spreads ~one blur radius beyond its
bounds. After 6423056 removed the outer clip (required to fix the iOS 26
first-mount blur failure), that bleed escapes above the composer's top
edge and frosts the last line of the agent reply — RN-level clipping
cannot contain it since clipping the effect view's host is documented
undefined behavior.

Switch Glass to expo-glass-effect's GlassView (system UIGlassEffect) on
iOS 26+, which renders strictly within its corner-configured shape, and
keep the BlurView path as fallback for older iOS / non-liquid-glass
builds. The module is lazy-required with a try/catch so OTA bundles
running on binaries without the native module fall back instead of
crashing. colorScheme follows the in-app theme toggle rather than the
system appearance.
2026-07-11 14:11:17 +00: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 e2f563e8f6 fix(mobile): correct app update version endpoint 2026-07-07 15:54:55 +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 6423056be5 Fix first-mount blur failure by removing clip on BlurView's superview
RN overflow:'hidden' on the Glass outer container puts a native clip on
the UIVisualEffectView's superview, which Apple documents as undefined
behavior. On iOS 26+ the effect's backdrop capture fails when the view
mounts during a navigation push transition: entering the task detail
screen the first time shows no blur at all, while re-entering renders
correctly.

Corner clipping stays on the blur/veil layers themselves (radiusStyle,
introduced in #815), which is the supported cornerRadius+clipsToBounds
path, so rounded corners are unaffected.
2026-07-04 16:13:02 +00:00
xiaomakuaiz 2d9738a68d Fix Glass corner radius clipping 2026-07-04 21:28:06 +08:00
xiaomakuaiz 81c6a975a5 Fix Mermaid runtime loading in WebView 2026-07-04 20:32:17 +08:00
xiaomakuaiz d70bf525b4 fix mobile mermaid rendering 2026-07-04 17:50:44 +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 54f80b6a6f feat(mobile): 新建任务选择仓库列表支持手动输入仓库地址
在「选择仓库」列表里「快速开始」之后新增「手动输入仓库地址」入口,
点击弹出居中输入框(onShow 自动聚焦 + 键盘避让),校验 Git 地址格式后
作为 repo_url 创建任务(不带 project_id),无需先在后台创建项目。
2026-06-14 17:59:11 +08:00
xiaomakuaiz 91104d2082 feat(mobile): iOS 按会员等级隐藏更高档位的额度条与模型分组
- 我的页面:仅 iOS 只展示当前会员等级包含的 token 额度条(基础会员只看到基础模型)
- 选择/切换模型:仅 iOS 隐藏高于当前等级的内置分组(专业/旗舰)——App 内无升级
  购买路径,展示用不了的档位既是死入口也有审核风险
- Android 不受影响,保持全部展示
2026-06-12 21:20:21 +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 c6e8142714 Merge pull request #694 from xiaomakuaiz/feat-add-model
Feat add model
2026-06-12 14:54:20 +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 6fea682df5 fix(mobile): 任务列表滑动操作在 iOS 上抖动无法滑开
行内 PanResponder 与外层 FlatList 原生滚动抢手势:iOS 上滚动视图会发 terminationRequest,
默认让出 → 行手势被终止回弹 → 手指仍在拖又重新接管 → 循环抖动。加
onPanResponderTerminationRequest: () => false,接管后不再让出(Android 仲裁路径不同,原本就正常)。
2026-06-10 16:31:15 +08:00
xiaomakuaiz 2ac5e22e41 feat(mobile): 首次 AI 交互前的数据处理同意弹窗(App Store 审核 Guideline 2.1)
向 AI(含第三方服务)发送用户内容前取得明确同意:
- 新增 src/components/AiConsent.tsx:useAiConsent()(AsyncStorage 持久化 mc.aiConsent.v2,一次性)+ AiConsentModal
- 主提示点:登录后进入首页((tabs)/_layout)首次弹出,「同意并继续」记住、「暂不使用」本次关闭
- 硬拦截兜底:任务会话页(可交互时)与新建任务页未同意则弹窗,不同意则退出该页
- 弹窗说明发送内容(指令/代码/文件/图片)会经 AI 模型处理、可能含第三方 AI 服务商,附《隐私政策》入口
2026-06-10 15:45:54 +08: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