Skip to content

feat: add Desktop composer enter mode toggle - #55244

Open
unleashed-nick wants to merge 2 commits into
NousResearch:mainfrom
unleashed-nick:feat/desktop-composer-enter-newline-mode
Open

feat: add Desktop composer enter mode toggle#55244
unleashed-nick wants to merge 2 commits into
NousResearch:mainfrom
unleashed-nick:feat/desktop-composer-enter-newline-mode

Conversation

@unleashed-nick

Copy link
Copy Markdown

Summary

  • add desktop.composer.enter_sends config, defaulting to the existing Enter-to-send behavior
  • add the Desktop Settings → Chat toggle for switching to multiline-first composer input
  • support multiline-first shortcuts: Enter inserts newline, Ctrl/Cmd+Enter sends/queues, Shift+Enter steers when a turn is running
  • update composer help and keyboard shortcut display to reflect the active input mode
  • add focused tests for default/multiline key behavior and config defaults

Fixes #52952.

Test Plan

  • npm run test:ui -- src/app/chat/composer/enter-key-mode.test.ts src/app/chat/composer/enter-submit-dom-race.test.tsx
  • uv run --with pytest python -m pytest tests/hermes_cli/test_desktop_composer_config.py -q -o 'addopts='
  • npm run typecheck
  • npx eslint src/app/chat/composer/enter-submit-dom-race.test.tsx src/app/chat/composer/help-hint.tsx src/app/chat/composer/index.tsx src/app/shell/keybind-panel.tsx src/app/session/hooks/use-hermes-config.ts src/app/settings/constants.ts src/lib/keybinds/actions.ts src/types/hermes.ts src/store/composer-prefs.ts src/app/chat/composer/enter-key-mode.ts src/app/chat/composer/enter-key-mode.test.ts
  • npm run build

Note: full npm run lint still reports pre-existing unrelated lint errors in electron/titlebar-overlay-width.cjs, src/app/session/hooks/use-message-stream.ts, and src/app/shell/hooks/use-statusbar-items.tsx.

@alt-glitch alt-glitch added type/feature New feature or request P3 Low — cosmetic, nice to have comp/desktop Electron desktop app (apps/desktop/*) comp/cli CLI entry point, hermes_cli/, setup wizard labels Jun 29, 2026

@tonydwb tonydwb left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review Summary

Verdict: LGTM

Well-structured Desktop composer enter mode toggle. The resolveComposerEnterKeyIntent helper is cleanly separated with dedicated test coverage. The 13-file scope is below the high-surface-area threshold, and the changes are well-organized: pure logic in enter-key-mode.ts, config propagation in composer-prefs and settings, and i18n additions.

Testing: Dedicated test file covering all key combinations (Enter, Shift+Enter, Ctrl/Cmd+Enter) for both send-first and multiline-first modes.
Code Quality: Clean separation of concerns — key intent resolution is pure and testable.


Reviewed by Hermes Agent

@tonydwb tonydwb left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review Summary

Verdict: LGTM

Adds Desktop composer Enter key mode toggle. Supports Enter-to-send (default) and multiline-first modes. Clean type system with ComposerEnterKeyIntent type.

  • Well-structured with excellent test coverage
  • Clean separation of concerns
  • Well-scoped: 13 files, 357 additions

Reviewed 13 files, 357 additions. Approved.

@teknium1

Copy link
Copy Markdown
Contributor

Thanks for addressing a real Desktop workflow problem. Current main still prevents plain Enter and submits from apps/desktop/src/app/chat/composer/index.tsx:558-568, so the feature remains needed.

Problems

  • The branch predates current-main’s composer extraction: 773a3703b moved submission behavior into apps/desktop/src/app/chat/composer/hooks/use-composer-submit.ts:49-193, and index.tsx has changed substantially since the PR base. The old ChatBar hunk needs a semantic port to preserve current live-DOM, queue, and draft-sync behavior.

Suggested changes

  • Salvage the resolver, config, and presentation pieces onto the current keydown seam, retaining the live-DOM payload handling at apps/desktop/src/app/chat/composer/index.tsx:561-568.
  • Add a current-composer integration test for config-driven multiline mode; the new helper and Harness tests do not exercise the post-refactor ChatBar path.

Automated hermes-sweeper review.

@teknium1 teknium1 added sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform labels Jul 15, 2026
…-enter-newline-mode

# Conflicts:
#	apps/desktop/src/app/chat/composer/index.tsx
#	apps/desktop/src/app/session/hooks/use-hermes-config.ts
#	apps/desktop/src/app/shell/keybind-panel.tsx
@unleashed-nick

Copy link
Copy Markdown
Author

Updated this branch against current main and resolved the Desktop composer refactor conflict.

Summary:

  • Preserved current main's extracted composer hook structure.
  • Ported the Enter-mode resolver into the new post-refactor keydown path.
  • Preserved live DOM text reads for submit/queue/steer behavior.
  • Added post-refactor ChatBar coverage for default Enter submit, multiline Enter newline, Cmd/Ctrl+Enter submit, and Shift+Enter steering.

Validation:

  • npm run test:ui -- src/app/chat/composer/enter-key-mode.test.ts src/app/chat/composer/enter-submit-dom-race.test.tsx src/app/chat/composer/enter-mode-chatbar.test.tsx — 17 passed
  • npm run typecheck — passed
  • Targeted ESLint — passed
  • uv run --with pytest python -m pytest tests/hermes_cli/test_desktop_composer_config.py -q -o 'addopts=' — 1 passed
  • npm run build — passed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard comp/desktop Electron desktop app (apps/desktop/*) P3 Low — cosmetic, nice to have sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades type/feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Desktop Enter key sends message — no newline support in chat input

4 participants