Commit Graph

173 Commits

Author SHA1 Message Date
peanut 82b138280b fix: 移除 console.log 中的敏感信息(firstQuery 文本、payload 完整内容) 2026-07-21 23:47:17 +08:00
peanut 748fc18c84 feat: 前端添加 SSE 事件诊断日志,确认 originalQuery 传递 2026-07-21 23:43:48 +08:00
peanut b24e176579 feat: 标签顺序改为全部/短篇/中篇/长篇/收藏夹;增加SSE事件诊断日志定位novel_done未触发问题 2026-07-21 21:56:22 +08:00
peanut 3813f91b8d feat: 历史列表分类改为固定5标签(全部/中篇/短篇/长篇/收藏夹),移除状态筛选,后端保存length改为short 2026-07-21 21:15:31 +08:00
peanut 9b496bb42a fix: 撤回 typewriter 改动,novel 改用直接累加 delta 保证流式输出
之前用 useTypewriterStream.writer.push + 同步读 visibleText 有时序问题:
writer 的 visibleText 由内部 setInterval 异步推进,push 后立即同步读得到空串,
气泡一直空白。

撤回 typewriter 改动,恢复 novel_delta 直接 lastNovel.content += delta,
SSE 本身就是流式推送,每次到达即显示。

保留 confirmOutline / modifyOutline 的 pendingNextResponse = true 修复(loading)。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-21 20:43:11 +08:00
peanut 6afec090e4 fix: 大纲确认/修改时显示 loading + novel 消息使用 typewriter 逐字流式输出
- confirmOutline / modifyOutline 中设置 pendingNextResponse.value = true
  解决大纲确认/修改后等待响应期间无 loading 的问题
- novel_start 时为 novel 消息创建独立 typewriter writer 实例(novelWriters Map)
- novel_delta 时通过 writer.push() 推送增量,逐字渲染 visibleText
- novel_done 时 finish writer 并同步最终文本,清理 writer 实例

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-21 20:33:52 +08:00
peanut 7b53821cec fix: 澄清卡片 allow_custom 时允许纯自定义输入提交
- canSubmit 逻辑重构:纯文本卡片只需 customText 非空
- 有选项卡片:满足最小选择数,或(allow_custom 且 customText 非空)即可提交
- 修复其他,请简单描述输入自定义内容后提交按钮灰显的问题

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-21 20:25:24 +08:00
peanut 9a215a89e9 fix: 新生成短篇剧本刷新到历史列表 + 分类标签从实际数据动态生成
- novel_done 事件处理中调用 store.fetchScripts() 刷新剧本列表
- typeTabs 从硬编码改为 computed,根据实际 length 值动态生成
- activeType 默认值从 'long' 改为 'all'(显示全部)
- 过滤逻辑改为精确匹配 length 字段
- 移除无效的 '风格' 硬编码分类标签

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-21 08:39:14 +08:00
peanut 1f5ad3abe2 fix: 大纲修改意见输入框改 textarea,增高并完整显示 placeholder
- input 改为 textarea + auto-height,支持多行输入
- min-height 64rpx 保证 placeholder 完整显示(原来被压扁截断)
- max-height 120rpx 限制约 2 行,超出滚动显示最新底部内容
- line-height 1.5 比例协调,改动幅度小

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-20 23:52:46 +08:00
peanut 7c3bd5c0e3 fix: 心愿实现页面用 pendingNextResponse 标志修复第二轮 loading 显示
- 新增 pendingNextResponse ref 标志等待下一个 assistant 响应
- showChatLoading 改用该标志判断,替代不可靠的最后消息 role 判断
- submitClarification 移除重复 addResultMessage,消除重复用户气泡
- 规避 mp-weixin 对 v-for 中 computed 数组的错误编译导致的页面空白
- runGeneration/clarification/outline/novel_start/novel_done 正确设置标志

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-20 23:37:21 +08:00
peanut 4b3fa1552c fix: 第二轮 loading 不显示 — 用 filteredResultMessages 替代函数调用,避免 mp-weixin 编译丢失 2026-07-20 23:08:42 +08:00
peanut f8d6e881df fix: 恢复 addResultMessage + 渲染层过滤,避免重复气泡同时支持后续 loading 2026-07-20 22:57:24 +08:00
peanut 4afc632cac fix: 移除澄清卡片提交后的重复用户气泡(label 已在卡片内显示) 2026-07-20 21:55:35 +08:00
peanut 180d21b66c fix: 已回答状态显示 AI 的问题(question) 2026-07-20 21:28:03 +08:00
peanut 41c2112c5b fix: 澄清卡片已回答用 label 显示,后端 payload 仍用 value 2026-07-20 21:25:09 +08:00
peanut d560f63d70 fix: chat 视图 loading 在等待首个 assistant 响应期间持续显示 2026-07-20 00:19:19 +08:00
peanut dd11cfae73 feat: 人生事件和剧本收藏从 localStorage 切换为真实 API
- 后端:新增 t_event_favorite 表(UNIQUE KEY + MyBatis-Plus Entity)
- 后端:LifeEventController 新增 /favorite/toggle、/favorite/page、/favorite/check 三个真实端点
- 后端:EventFavoriteService 完整 CRUD,含 toggle/分页/批量查询/状态检查
- 后端:删除旧的 favorite-placeholder mock 端点
- 前端:life-event/detail.vue 从 localStorage 假收藏切换为真实 API + localStorage 缓存防闪烁
- 前端:ScriptLibraryView.vue 从 localFavorites 切换为 checkFavoriteScript 真实 API
- 前端:stores/app.js 新增 toggleEventFavorite / checkEventFavorite 方法
- 修复:审核发现的 UNIQUE 约束缺失、未使用 watch 导入、Controller 参数注解遗漏、Controller 委托 Service 构造 Response

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 23:23:40 +08:00
peanut 05ea918ee1 feat(script-favorite): update toggleFavorite to use backend API
- Import toggleFavoriteScript from epicScript service
- Change toggleFavorite from sync local-only to async with API call
- Implement optimistic update pattern: update local cache first, then call backend
- Rollback on API failure with error toast
- Preserves localFavorites for offline/fast-render scenarios
2026-07-19 21:51:20 +08:00
peanut 50f1bdba38 feat(script-favorite): add favorite API wrappers to epicScript.js
- toggleFavoriteScript: POST /epicScript/favorite/toggle
- getFavoriteScriptPage: GET /epicScript/favorite/page
- checkFavoriteScript: GET /epicScript/favorite/check
- Added to default export object
2026-07-19 21:48:00 +08:00
peanut 7e52bb9ffb fix: .chat-send-btn 设 height:60rpx 与输入框等高 2026-07-19 21:04:50 +08:00
peanut 35b4f97527 fix: .chat-scroll-content padding-bottom 改回 40rpx 避免与父级 padding 叠加 2026-07-19 20:49:16 +08:00
peanut f5b26c2fc7 refactor: .chat-page 改为 height: 100% 让父级 padding 生效 2026-07-19 20:49:05 +08:00
peanut 283914690a fix: .chat-page 增加 safe-area-inset-bottom + .chat-scroll-content padding-bottom 增至 120rpx 2026-07-19 20:21:41 +08:00
peanut 118d20914d fix: 修复 openScriptChat 设置 viewState='result' 导致页面空白的问题 2026-07-19 19:30:48 +08:00
peanut b194b343ad fix: 修复 mp-weixin 模板箭头函数和 TextDecoder 不兼容
- 微信小程序 wxml 模板不支持内联箭头函数
  @submit 改为方法引用,submitClarification 自己找未提交卡片
- TextDecoder 在 mp-weixin 不可用
  decodeChunk 改用纯 JS UTF-8 解码实现
2026-07-19 19:02:52 +08:00
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