Commit Graph

148 Commits

Author SHA1 Message Date
peanut 7a0e729ab4 fix: chat-page 用 height: 100vh 替代 min-height: 100vh 修复真机滚动
根因:min-height: 100vh 允许容器超出视口增长,破坏 flex 布局,
导致 scroll-view 内部滚动层高度=内容高度(都不滚动)。

参考项目内已工作的 .result-page(height: 100% + min-height: 0)。
H5 实际验证:内容 1779px 滚动到底部后提交按钮 visibleInViewport: true
2026-07-19 18:50:57 +08:00
peanut f07817aaff fix: chat 视图 scroll-view 添加 height: 100% + min-height: 0
参考项目内已工作的 .result-view 模式:
- flex: 1 仅在 flex 布局父容器中生效
- 但 UniApp <scroll-view> 是原生组件,必须显式 height: 100%
- 同时 min-height: 0 确保 flex 子项可收缩

之前只设 flex: 1,真机上原生 scroll-view 无法计算可滚动区域。
2026-07-19 18:32:09 +08:00
peanut 30ecf9f4a3 fix: chat 视图 scroll-view 删除固定 height,改用 flex: 1 自适应真机高度
真机上状态栏/tab 栏/安全区域高度各不相同,
硬编码 calc(100vh - 220rpx) 导致 scroll-view 超出可视区域无法滚动。
2026-07-19 18:07:00 +08:00
peanut f6ef0222b3 fix: 修复 chat 视图无法滚动 + SSE 事件重复消费
- scrollResultToLatest 守卫条件兼容 chat 视图
- shortNovel.js 添加 chunkProcessed 标志位避免 H5 双重消费
2026-07-19 16:04:54 +08:00
peanut e109e59f1a feat(mini-program): sendChat 按 generationPhase 切换接口,消息进统一对话流 2026-07-19 15:24:49 +08:00
peanut e41266e6f4 feat(mini-program): 统一 chat 视图,删除 clarifying/outlining/result 独立视图 2026-07-19 15:21:43 +08:00
peanut b4fca0abfa refactor(mini-program): runGeneration+交互函数改为操作对话消息 2026-07-19 15:15:49 +08:00
peanut 84b6a77632 refactor(mini-program): handleShortNovelEvent 改为对话流追加消息 2026-07-19 15:10:42 +08:00
peanut c0adb48949 refactor(mini-program): 扩展 addResultMessage 消息模型 + 新增 generationPhase 2026-07-19 15:05:27 +08:00
peanut 30e2836742 fix(mini-program): 修复心愿实现页接口报错 + .env 指向生产服务器
根因:.env.development 指向 localhost:19089,但本地未启动后端,
所有 API 请求 ERR_CONNECTION_REFUSED。

切换至 https://lifescript.happylifeos.com/api(生产服务器),
符合 CLAUDE.md 服务器端验收规则。

此修复与 generationDisplayText + 继续会话 一起完成完整心愿实现流程验证。
2026-07-19 14:17:11 +08:00
peanut c1293c28ac fix(mini-program): 修复心愿实现页用户消息不显示 + 支持继续会话
1. runGeneration 补赋值 generationDisplayText,修复用户输入心愿不显示
2. 识别外部服务 DAILY_GENERATION_IN_PROGRESS 错误码,保存 session_id
3. 失败态新增'继续创作'按钮,调用 followup action=retry 恢复中断会话
4. 新增 resumeSession 方法,重置状态后恢复流式生成
2026-07-19 13:58:16 +08:00
peanut 1b566d574c fix(mini-program): ScriptView 模板闭合标签和 setupRecorder H5 兼容性 2026-07-19 12:56:38 +08:00
peanut 0190941df7 fix(mini-program): 短信验证码文案从 888888 改为 123456 2026-07-19 12:39:54 +08:00
peanut 34f443939e feat(mini-program): ScriptView 多阶段状态机改造 2026-07-19 12:39:50 +08:00
peanut b3a2f3a3d3 feat(mini-program): 澄清卡片组件 2026-07-19 12:36:11 +08:00
peanut ab13ac258b feat(mini-program): 短篇小说 SSE 流式服务 2026-07-19 12:36:06 +08:00
peanut 2c778fabbb refactor: ScriptView 删除 read 模式 + 兼容旧模式,统一对话流入口 2026-07-01 08:28:47 +08:00
peanut 6aeb5319e3 refactor: ScriptView 删除 read 模式,剧本入口直接进对话流 2026-07-01 07:59:48 +08:00
peanut 86543df75d fix: currentScriptContent 章节字段全空时用 plotJson.fullContent 作为 fallback 2026-06-30 07:45:20 +08:00
peanut 1073123360 fix: createMessage 补 userId 字段 + 使用 senderType/contentType 2026-06-29 23:52:37 +08:00
peanut 3829a3ef92 fix: createMessage 字段名改为 senderType/contentType 匹配后端 DTO 2026-06-29 23:36:26 +08:00
peanut f45fee7cce feat: chat 模式传 messageType/versionLabel/新 emits 给 MessageCard 2026-06-29 22:53:36 +08:00
peanut a713e8823c fix: loadMessages 对历史剧本 plotJson 自动初始化首条 AI 消息 2026-06-29 22:50:15 +08:00
peanut 4a7914eefe fix: displayMessages 去掉根版本过滤(chat 模式显示首条 AI 剧本) 2026-06-29 22:47:37 +08:00
peanut 88ff280b78 feat: MessageCard 支持按 messageType 条件渲染 script/chat 专属按钮组 2026-06-29 22:45:36 +08:00
peanut 6ae721eb89 fix: 回滚 ScriptView 临时 conversationId 正则保护(误伤历史剧本) 2026-06-28 23:33:29 +08:00
peanut 19337b9371 fix: ScriptView loadMessages 对临时 conversationId 正则短路保护 2026-06-28 22:42:24 +08:00
peanut e3eb1afbb0 fix: listByConversation 在 conversation 不存在时返回空列表而非抛异常 2026-06-28 22:40:13 +08:00
peanut bf6f2797ad feat: ScriptView 改造为对话中心查看/修改模式
- 新增 scriptChat.js 和 message.js 服务导入
- 新增 viewMode、scriptId、conversationId、currentVersionMessageId、
  selectedVersionMessageId、messages、versions、chatInput 等状态
- 新增阅读模式:版本栏 + 剧本分章节展示 + 操作按钮
- 新增聊天模式:消息列表 + 聊天输入栏 + 对话修改功能
- 集成 createScriptWithDialogue、streamScriptChat、listMessagesByConversation、
  listMessageVersions、switchVersion、deleteVersion 等后端 API
- 替换 runGeneration 使用 createScriptWithDialogue 创建剧本和对话
- 替换 openScriptChat 使用后端消息加载,不再依赖 localStorage
- 移除 localStorage 作为主要消息存储(persistResultMessages、
  hydrateResultMessages、readStoredMessages、readScriptChatHistory 改为空操作)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-28 18:41:44 +08:00
peanut 6109202a26 chore: request.js 导出 API_BASE_URL 和 getAuthHeader 2026-06-28 18:26:30 +08:00
peanut 1b39d873ab chore: 统一前端/H5 服务固定端口
- web: 5178
- web-admin: 5179
- mini-program: 5180
- life-script: 5181
2026-06-28 10:37:36 +08:00
peanut 8cd52f76ae refactor: 迁移 story-card 相关样式到 MessageCard
删除 ScriptView.vue 中已迁移到 MessageCard 的样式类

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-28 09:19:53 +08:00
peanut c2ed051de0 feat: ScriptView 复用 MessageCard 组件
- story-card 使用 MessageCard
- result-chat-list 中的 assistant 消息按内容长度自动切换短消息/完整卡片模式

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-28 09:16:37 +08:00
peanut cbf5157dcf feat: 创建 MessageCard 组件
封装长消息/故事卡片结构,支持短消息简洁气泡模式
2026-06-28 09:13:34 +08:00
peanut d724cab581 style: 添加消息按钮组样式
- .message-actions: 2 列网格布局,间距 14rpx
2026-06-27 22:22:28 +08:00
peanut 0db434c21f feat: 在 result-chat-list 中添加功能按钮组
为每条 assistant 消息添加完整功能按钮:
- 复制:复制消息内容到剪贴板
- 换个方向:进入换方向修订确认
- 不像我:进入不像我修订确认
- 继续生成:收起故事并聚焦输入框
- 播放:播放故事 TTS 音频
2026-06-27 22:20:28 +08:00
peanut 9b3006d128 feat: 添加消息卡片功能方法
- copyMessageContent: 复制消息内容到剪贴板
- playMessageTts: 播放故事 TTS 音频
- toggleMessageCollapse: 添加展开/收起埋点
2026-06-27 22:18:11 +08:00
peanut 944f6a0a13 fix: 修复 story-card 展开失效 bug
移除 resultHasScriptReplies 条件包裹,让故事正文始终由 storyCollapsed 控制展开/收起
2026-06-27 22:16:37 +08:00
peanut 8e6b69f6c7 fix: 修复遗漏的 backend-single 引用(Java源码/前端注释/配置文件/IDE配置) 2026-06-27 17:32:18 +08:00
peanut 8daf51301a fix: 修复小程序登录页变量初始化顺序错误导致微信登录失败 2026-06-27 13:07:17 +08:00
peanut e3b21cac3e feat:管理后台系统设置页面 + 小程序登录页条件渲染 2026-06-27 10:27:14 +08:00
peanut 7679e973d0 feat:管理页删除确认接入自定义弹窗,标签文字不换行 2026-06-24 22:51:12 +08:00
peanut f11fb142e1 feat:编辑页添加按钮简化为添加,字数限制4字,标签不换行,接入自定义弹窗 2026-06-24 22:47:15 +08:00
peanut 57a42474d7 refactor:TagDialog 移除冗余 glass-card 类引用 2026-06-24 22:43:56 +08:00
peanut bd0f4d6bea feat:新增 TagDialog 自定义弹窗组件,深色太空主题样式 2026-06-24 22:40:43 +08:00
peanut 843ddd4c69 feat:新增管理标签独立页面,支持左滑与 × 按钮删除 2026-06-24 21:56:46 +08:00
peanut 53e895797e fix:onShow 重复触发时先 off 再 on,避免事件监听累积 2026-06-24 21:55:51 +08:00
peanut 2600cb2164 feat:编辑资料页保存携带库字段,onShow 监听管理页更新事件 2026-06-24 21:53:26 +08:00
peanut c7e84f5a13 style:删除 .custom 死代码 CSS 块 2026-06-24 21:51:41 +08:00
peanut 7dc75cbfb4 feat:编辑资料页标签区 UI 重构,新增管理入口与添加标签弹窗 2026-06-24 21:46:02 +08:00