137 Commits

Author SHA1 Message Date
wangdl
c021370a82 fix(ios): 选择模式下点击卡片任意位置即可选中/取消
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-27 22:52:50 +08:00
wangdl
3f80f9aaf8 fix(ios): 拆分删除知识库和选择知识点按钮,避免误触
- 删除知识库 🗑 移到左侧灰色按钮,远离右侧操作区
- 选择知识点 ☑ 独立显示在右侧
- 不再共用 ⋯ 菜单

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-27 22:50:37 +08:00
wangdl
e1bfda0169 feat(ios): 知识点删除 + 批量选择删除
- 新增单个删除 + 批量删除 API 调用
- LibraryDetailPage 新增选择模式:
  - ⋯ 菜单 → "选择知识点" 进入多选模式
  - 全选/取消全选 + 批量删除按钮
  - 选中的 items 显示选中标记
  - 选择模式下禁止导航进入详情
- LibraryDetailViewModel 新增 deleteItem + batchDeleteItems

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-27 22:47:24 +08:00
wangdl
ed3e587bf0 fix(ios): 文件上传模式隐藏标题,标题仅在手写模式显示
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-27 22:29:13 +08:00
wangdl
2b464df7cf feat(ios): 添加知识点 - 多选文件 + 标题可选 + 每个文件独立知识点
- 文件选择器改为多选(allowsMultipleSelection: true)
- 图片选择器支持多选(maxSelectionCount: 10)
- 标题改为可选,留空自动用文件名
- 每个文件独立上传 → 独立知识点
- 多文件时按钮显示"批量添加 (N个)"
- 已选文件可逐个删除
- 部分失败时显示 X/N 成功计数

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-27 22:26:32 +08:00
wangdl
42b60a21ec feat(ios): TabBar 隐藏/出现增加平滑动画
- ContentView 新增 TabBarVisibleKey 环境值 + AnimatedTabBarHide modifier
- TabView 使用 .toolbar(visible/hidden) + .animation 驱动动画
- 子页面 onAppear 隐藏 → onDisappear 出现,带 easeInOut 0.28s
- 替换所有静态 .toolbar(.hidden, for: .tabBar) 为 .animatedTabBarHide()

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-27 22:16:22 +08:00
wangdl
f288421493 fix(ios): 所有子页面隐藏底部 TabBar
- 17个子页面添加 .toolbar(.hidden, for: .tabBar)
- 包括:知识库详情、创建、编辑、搜索、添加知识点、
  个人资料编辑、设置、反馈、目标、方法偏好、通知、
  AI对话、每日思考、薄弱点、回忆测试、AI反馈、主动回忆、
  复习卡片、学习会话

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-27 22:12:00 +08:00
wangdl
e0998169a1 fix(ios): 修复另一个 LinearGradient/Color 三元表达式类型不匹配
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-27 22:07:37 +08:00
wangdl
2dac206b39 fix(ios): LibrarySubpages.swift 缺少 PhotosUI 和 UniformTypeIdentifiers import
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-27 22:06:46 +08:00
wangdl
fe7aae7c27 feat(ios): AddKnowledgePage 支持文件上传(md/txt/pdf/图片)
- 新增内容来源切换:手写输入 | 上传文件
- 文件模式:支持 .md/.txt/.pdf 文档选择 + 图片选择
- FileUploadService 新增 uploadData 通用上传方法
- 上传到 COS → 创建知识点(content=下载URL, itemType=格式)
- 手写模式保持原有文本编辑器

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-27 22:05:33 +08:00
wangdl
0860d7b8c2 fix(ios): 修正文件确认上传路径 confirm-upload → complete
后端接口是 POST /files/complete,不是 confirm-upload

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-27 21:55:23 +08:00
wangdl
1a88aaeecb feat(ios): 头像上传功能接入 COS
- 新增 FileUploadService:获取预签名URL → PUT到COS → confirm → 拿下载链接
- 新增 FileUploadUrlRequest/Response 等文件上传相关模型
- EditProfilePage 新增头像区域:
  - PhotosPicker 选择照片
  - 正方形裁剪 + 缩放到 256x256
  - 上传中显示 ProgressView
  - 上传完成后自动更新 profile avatarUrl
- ProfileView 支持显示真实头像图片(AsyncImage)
- 保存时携带 avatarUrl 不再写死 nil

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-27 21:44:07 +08:00
wangdl
942c3e8454 fix(ios): 修复三元表达式 Color/LinearGradient 类型不匹配
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-27 21:34:25 +08:00
wangdl
e80f8af79b feat(ios): 知识库详情页 - toolbar 按钮 + 删除功能
- + 和删除按钮移入导航栏 toolbar,与系统返回按钮同行
- 新增删除确认弹窗(alert with destructive action)
- LibraryDetailViewModel 新增 deleteKnowledgeBase 方法
- 删除成功后 toast + 自动返回列表

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-27 21:33:36 +08:00
wangdl
f90f90ee41 fix(ios): 创建知识库页面 - 创建后自动返回 + 成功/失败反馈
- 新增 @Environment(\.dismiss) 创建成功后自动返回列表
- 新增 isCreating 加载态,按钮显示 ProgressView 并禁用
- 空名称时按钮灰色不可点击
- 成功 toast "知识库已创建" + 自动 dismiss
- 失败 toast "创建失败,请重试"

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-27 21:28:40 +08:00
wangdl
9aa9fd76c7 fix(ios): 知识库页面优化 - 去掉中间创建按钮,右上角+改为创建
- 移除列表中部的虚线"创建新知识库"按钮
- 右上角+按钮从 libraryImport 改为 libraryCreate
- 空状态提示更新

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-27 21:24:44 +08:00
wangdl
e4132dd1c3 fix(ios): 修复顶部导航栏间距过大问题
- 所有 Tab 主页面 padding-top 从 statusBarH(44)+16=60pt 改为 8pt
- NavigationStack 已自动处理状态栏安全区,无需手动硬编码
- 影响页面:StudyHomeView / LibraryHomeView / AnalysisHomeView / ProfileView

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-27 21:20:49 +08:00
wangdl
49bebad402 fix(ios): APIClient 401 错误码传递到 AuthManager,完成错误码分支闭环
- notifyTokenExpired 接受 errorCode 参数,通过 Notification userInfo 传递
- 401 响应提取 errorCode 后传给 notifyTokenExpired
- AuthManager 观察者从 userInfo 读取 errorCode,调用 applyErrorCode
- handleUnauthorized 根据 errorCode 切换精确状态(disabled/deleted/expired)
- restoreSession 冷启动也检查 errorCode,禁用/删除用户不尝试 refresh

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-27 21:13:15 +08:00
wangdl
539b9a7d2b feat(ios): AppSession 状态枚举接入路由 + TabBar 精简 + authorizationCode
- AuthManager: 移除 isAuthenticated/isRestoring,仅保留 AppSession 枚举
- App 入口: switch session 分发行路由,支持 disabled/deleted 状态页
- 新增 AccountStatusView(禁用/注销提示)
- ContentView: TabBar 5→4(学习/知识库/分析/我的),去掉 AI 首页
- StudyHomeView: 融合每日思考题,去掉 AI 输入栏和本周活跃
- AnalysisHomeView: 新增本周学习活跃柱状图
- AppleAuthRequest 新增 authorizationCode,LoginPage 提取传递
- APIError 支持 errorCode,APIClient 解析服务端 errorCode
- AuthManager.applyErrorCode() 根据错误码切换状态

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-27 21:08:11 +08:00
wangdl
0f8e542b2a fix(ios): Apple登录nonce+401透传+DesignSystem v2.0+AIHomePage重设计
- LoginPage: 新增nonce生成(SHA256)CryptoKit、取消按钮、Task可取消
- APIClient: 401响应透传服务端error message(不再硬编码)
- DesignTokens: 主色切换#3D7FFB渐变#3D7FFB→#9DA7FD、补全15个兼容别名
- AIHomeView: 全新v2.0设计(暖白底色/知习蓝/34pt hero/Rive占位)
- AppleAuthRequest: 新增nonce字段
2026-05-27 20:23:01 +08:00
b3ad86a8f3 revert: remove Agent View config from README and delete AI_IOS_WORKSPACE
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-20 13:38:00 +08:00
42f7a0fe3c docs: add AI iOS workspace template and For AI Agents section to README
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-20 10:58:21 +08:00
90e4e2b2e6 docs: update README with current page list, project structure, and fix changelog
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-19 15:24:44 +08:00
a05dd09902 refactor(ios): migrate NavigationLink to value-based routing, add Dynamic Type support, fix gesture conflicts
- Replace all deprecated NavigationLink(destination:) with NavigationLink(value: Route)
- Add Route enum with navigationDestination mapping in new Core/Navigation/
- Extract 7 new sub-page files (AIChatPage, AIFeedbackPageView, RecallTestPage, WeakPointsPage, FeedbackFormView, GoalSettingDetailView, MethodPreferenceView)
- Add @ScaledMetric-based zxFontScaled modifier for Dynamic Type
- Fix ZXPressModifier gesture conflict with ScrollView using onLongPressGesture
- Enlarge touch targets from 36pt to 44pt
- Add accessibility labels to TextField and other controls

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-19 15:21:36 +08:00
9a4b4afaf4 fix: add missing animations to progress rings, bars, and charts in learning views
- StudyHomeView: ring trim animation + bar width animation + week bar spring animations with staggered delay + numeric text transitions
- LearningSessionView: animatedProgress state with onChange driving smooth ring animation + background track ring
- ReviewCardView: progress bar width animation
- AnalysisHomeView: chart line trim animation + gradient fill fade-in

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-18 15:59:31 +08:00
8c486c73ae fix: change API base URL to https://longde.cloud/api to match nginx proxy
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-18 15:44:29 +08:00
be7fca5305 fix: resolve 3 compilation errors
- NotificationListView.swift: unwrap optional String? for Text()
- LocalCache.swift: add @escaping to fetch closure parameter
- ContentView.swift: reformat ZXTabBar body for item scope fix

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-18 11:35:23 +08:00
89d89e542c feat(ios): P2 动效补充 + 无障碍适配
- 新增 ZXAnimations.swift — ZXButtonStyle/ZXPressModifier/ZXPageTransition/ZXThinkingOverlay/ZXCelebrationView/ZXAIAnalysisProgress
- 新增 ZXLoadingView.swift — 品牌化加载动画/ZXDotLoader/ZXShimmer
- 新增 ZXRefreshableScrollView.swift — 下拉刷新+上拉加载更多
- 新增 ZXToast.swift — 全局 Toast 通知系统
- 新增 FileCache.swift / LocalCache.swift — 本地缓存层
- 新增 AIChatViewModel.swift / StudyHomeViewModel.swift / ReviewPlanViewModel.swift
- 全部关键按钮接入 .zxPressable() 触觉反馈
- AI 分析流程接入 ZXThinkingOverlay + ZXAIAnalysisProgress
- 学习完成/复习完成接入 ZXCelebrationView 庆祝动画
- 全部关键交互元素添加 .accessibilityLabel
- 修复 ProfileViewModel async let 问题、EditProfilePage 保存失败、let _ = Task{} 反模式

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-17 22:31:24 +08:00
b182203464 fix(ios): APIClient 兼容有无 ResponseInterceptor 两种响应格式
服务器部署版本可能未启用 ResponseInterceptor,返回裸 JSON 而非
{ success, data, timestamp } 信封格式。APIClient 解码时先探测
JSON 结构,自动适配包裹/裸数据两种格式。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-17 19:42:17 +08:00
5e19bd740e feat(ios): 鉴权系统完善 + 前后端打通 + 模型对齐 + ViewModel 创建
- 新增 AuthManager (ObservableObject) 集中管理鉴权状态:
  - session 恢复 → token 验证 → 自动刷新
  - 登出自动重定向到登录页
  - NotificationCenter 监听 401 实现全局踢回
- APIClient 新增 401 自动 refresh + 单次重试
- App.swift 重构鉴权门控:
  - 去掉 hasCompletedOnboarding 绕过鉴权漏洞
  - 拆分为 SplashScreen / PreLoginFlow / PostLoginOnboardingFlow / ContentView
  - LoginPage 移除"跳过"按钮
- KeychainHelper 实现 token 安全存储
- APIModels 对齐后端 Prisma schema (UserProfile/KnowledgeBase/ReviewCard 等)
- APIService 简化 AuthService,token 管理迁移至 AuthManager
- 新增 8 个 ViewModel 接入 API:
  ProfileViewModel, LibraryViewModel, StudyViewModel,
  ActiveRecallViewModel, AIAnalysisViewModel, ReviewViewModel, ActivityViewModel
- 新增 EditProfilePage 编辑资料页
- 新增 NotificationListView 通知列表页
- AIHomeView 修复"检测中"卡住 (改用公开 GET / 健康检查)
- SettingsView 登出调用 AuthManager.signOut() 实现重定向
- 修复 NotificationItem 命名冲突、Combine import 缺失等编译错误

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-17 19:06:23 +08:00
dc4ad424e2 switch API to HTTPS api.longde.cloud, remove NSAllowsArbitraryLoads, migrate docs to startup-plan
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-15 17:30:27 +08:00
d7e57dcebc chore: 同步 xcodeproj 和 LearningSessionView 改动 2026-05-13 15:59:32 +08:00
a96d6cb159 feat(ios): 补全页面跳转、浅色模式、3个新页面
- 移除 3 处强制深色模式,用 @AppStorage 全局切换
- 设置页「外观」按钮实时切换深色/浅色/跟随系统
- 底部导航栏 inactive 颜色改为自适应 Color.zxF03
- 12 个子页面修复:保留返回按钮 + 消除顶部空白
- 新增 LearningSessionView/ReviewCardView/ActiveRecallView
- 新增 NotificationListView/SettingsView 等子页面
- 补全所有按钮 NavigationLink 跳转(0 个空白 action)
- KnowledgeBase 模型对齐服务器数据
- Info.plist 补充 CFBundleIdentifier + ATS
- 新增缺口分析文档 gap-analysis-1/2.md
2026-05-12 17:08:27 +08:00
fb95c27340 refactor: 重构架构,接入线上 API 并修复编译错误
- 删除旧 ViewModel/Repository/Storage 层,简化架构
- 新增网络层:APIClient、APIConfig、APIError
- 新增数据模型层:APIModels(含 20+ DTO)
- 新增服务层:APIService(含 8 个业务服务类)
- 各页面内联组件定义,消除跨文件依赖
- 修复 ZXQuickAction、ZXAIInteractionRow、ZXWeakRow 缺失
- 修复 ZXTabBtn 参数标签缺失
- 配置 ATS 例外允许 HTTP 请求
- API 地址指向线上服务器 81.70.187.179:3001
2026-05-11 17:27:56 +08:00
7066200b7b feat: MVVM 架构、全套 UI 页面、浅深色主题、本地持久化、等待名单、AI 动效
- 架构层:ViewModel/ObservableObject、Service/Repository、网络层 APIClient/APIEndpoint/APIError
- 设计系统:Color(light:dark:) 自适应 28 色 Token、ColorSchemeManager 深浅色切换
- 全页面:AI 对话/反馈/回忆/薄弱点、知识库 CRUD、学习工作台、复习计划、学习分析、个人中心/设置
- 登录与引导:Sign in with Apple、AppSession 状态管理、引导流程、演示模式
- 本地持久化:FileCache + PersistenceController(学习任务/复习任务/学习记录)
- 本地化:zh-Hans Localizable.strings ~120 条、ZXStrings 程序化引用、LanguageManager
- 组件库:ZXTabBar/ZXBackHeader/ZXSTaskRow/ZXChartView/ZXTypingIndicator 等 22 个共享组件
- 等待名单:WaitlistView 邮箱收集表单
- 动效:ZXTypingIndicator AI 打字动画、ZXShimmerModifier 骨架屏
- 测试:StudyHomeViewModel/AIChatViewModel/ReviewPlanViewModel/FileCache 共 28 条
- Dynamic Type 支持 + 范围限制

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-10 22:22:50 +08:00
b2795fe64b feat: iOS app - design tokens, 22 pages, navigation, onboarding 2026-05-09 11:18:35 +08:00
5f1930be40 feat: init AIStudyApp iOS project
- SwiftUI App
- Basic project structure
- Assets configuration
2026-05-04 16:12:51 +08:00