bug(layout-editor): theme refinements like "change it to dark" are ignored with AI providers
维护者通常 1 天内回复
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 88/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- javascript, react
- 领域
- frontend
调研方向
从 packages/layout_editor/src/lib/themeGenerationService.js 开始,重点关注 inferMode、requestedRefinementFields 和 limitRefinementSuggestion。为列出的后续短语添加回归测试,并验证模式得以保留;完成的标准是这些细化操作切换到所请求的浅色或深色模式,同时现有行为仍然有效。
由索引模型根据 Issue 内容生成。
描述
Description:
In the layout editor's theme assistant, a follow-up request like "change it to dark" does not switch the mode when an AI provider (Ollama, OpenAI or Gemini) is used. The request is understood, then discarded.
In packages/layout_editor/src/lib/themeGenerationService.js, inferMode accepts switch|change|set|turn (it) to light|dark, but requestedRefinementFields only allows the mode field for "light/dark mode", "light/dark theme" or exactly "switch to light/dark". limitRefinementSuggestion then drops mode, both from the provider's answer and from the local parsing that is meant to take precedence.
Steps to reproduce:
- Open the layout editor theme assistant with an AI provider selected and generate a light theme.
- Send the follow-up "change it to dark".
Or directly:
limitRefinementSuggestion({ primaryHex: '#ef4444', mode: 'dark' }, 'Change it to dark');
Expected behavior:
The theme switches to dark mode, as it does for "switch to dark theme".
Actual behavior:
Nothing changes, because limitRefinementSuggestion returns {}. The same happens for "switch it to dark", "set it to dark", "turn it to light" and "change to light". The fallback provider is not affected, because it skips limitRefinementSuggestion.
I'd like to send a fix that uses the same pattern for both checks, with a regression test.
- 主要语言
- JavaScript
- 星标
- 170
- 派生
- 397
- 平均合并
- 8 天 20 小时
- 30 天内合并 PR
- 6
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
RocketChat/EmbeddedChat 的其他 Issue
-
Bug: Unused media visibility check and missing useMemo dependencies cause stale/invalid actions in MessageToolbox.js可能已有人在做 @yashsarvaiya45 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
RocketChat/EmbeddedChat#1437 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 84/100
RocketChat/EmbeddedChat#1432 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
RocketChat/EmbeddedChat#1431 ·
维护者通常 1 天内回复
-
bug: editing a multi-line message saves literal \n instead of line breaks可能已有人在做 @arshil42 今天认领。 未关闭
难度 1/5 1-3 小时 新手友好度 92/100
RocketChat/EmbeddedChat#1430 · 3 条评论 ·
维护者通常 1 天内回复
-
Nested inline code, emoji and mentions disappear inside bold, italic and strikethrough可能已有人在做 @gitseraj 于 1 天前认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 75/100
RocketChat/EmbeddedChat#1429 · 2 条评论 ·
维护者通常 1 天内回复
查看 RocketChat/EmbeddedChat 的全部 Issue
相似的 Issue
-
accepted enhancement
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
-
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
channels:edit check:passed
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 1 天内回复