feat(web): add configurable enter behavior setting#586
Merged
Conversation
There was a problem hiding this comment.
Findings
- No issues found with confidence >= 80% in the added/modified lines.
Summary
- Review mode: initial
- Reviewed the latest PR diff in full for the Web enter-behavior setting, including the new localStorage hook, settings UI wiring, i18n strings, and
HappyComposerEnter handling. Residual risk: the added tests cover storage/options and settings rendering, but not the composer keydown behavior itself.
Testing
- Not run (automation):
bunis not installed in this runner image, sobun --cwd web run test -- src/hooks/useComposerEnterBehavior.test.ts src/routes/settings/index.test.tsxandbun --cwd web run typecheckcould not execute.
HAPI Bot
This was referenced May 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
我根据 #570 在 Web 设置中增加了“回车键行为”设置,默认仍为“发送消息”,也可以切换为“插入换行”。
变更内容
useComposerEnterBehavior,使用 localStorage 持久化用户选择HappyComposer中接入两种输入模式:send:Enter 发送,Shift+Enter 换行newline:Enter 换行,Ctrl/Cmd+Enter 发送验证
cd web && bun run testcd web && bun run typecheckCloses #570