Skip to content

feat: add option to save from the NLP input with Enter - #2404

Closed
k4zcho wants to merge 1 commit into
callumalpass:mainfrom
k4zcho:feat/nlp-enter-to-submit
Closed

k4zcho wants to merge 1 commit into
callumalpass:mainfrom
k4zcho:feat/nlp-enter-to-submit

Conversation

@k4zcho

@k4zcho k4zcho commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

Adds an opt-in Enter saves task setting (Settings → Features → Natural language processing), off by default.

When enabled, in the task creation modal's natural language input:

  • Enter saves the task
  • Shift+Enter inserts a newline
  • Ctrl/Cmd+Enter still saves
  • Enter still accepts an open autocomplete suggestion

Motivation: for single-line quick capture, Enter inserting a newline is awkward, and Cmd+Enter can collide with global launcher hotkeys.

Changes: new nlpEnterToSubmit setting (type, default, toggle, English string; i18n manifest/state synced), handling in TaskCreationModal for both the CodeMirror editor and the textarea fallback, a small isCompletionOpen getter on EmbeddableMarkdownEditor, docs, and an unreleased.md entry.

Testing: added four unit tests (default newline, Enter saves when enabled, Shift+Enter stays a newline, autocomplete wins); existing modal tests pass, and lint and the production build pass. I also built it and tried it by hand in a real Obsidian vault: Enter saves, Shift+Enter inserts a newline, Cmd+Enter still saves, Enter accepts autocomplete suggestions, and turning the setting off restores the old behavior.

🤖 Generated with Claude Code

Add an opt-in "Enter saves task" setting (off by default). When enabled,
Enter in the task creation modal's natural language input saves the task
and Shift+Enter inserts a newline. Ctrl/Cmd+Enter keeps working, and Enter
still accepts an open autocomplete suggestion.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
callumalpass added a commit that referenced this pull request Oct 18, 2026
Only a visible, selectable suggestion now takes Enter. A completion query
that is still pending, with nothing shown, no longer swallows a quick
Enter after typing. When a suggestion is visible, Enter accepts it; if it
opened too recently to accept, the key is swallowed instead of adding a
newline.

The textarea fallback ignores Enter while confirming IME composition,
including WebKit's keydown that follows compositionend.
@callumalpass

Copy link
Copy Markdown
Owner

Thanks @k4zcho! Your Enter-to-save contribution was incorporated in 55239bc and shipped in 4.13.10, with credit in the release notes.

Follow-up changes hardened autocomplete handling, prevented composition-confirming Enter from submitting the textarea fallback, and added translations and regression coverage. The newer v5 integration also includes the feature.

Closing this PR as already incorporated; no rebase is needed. If you encounter any remaining Japanese/Chinese IME or mobile-keyboard problems, please open a focused issue with the OS, keyboard, and reproduction steps. Thank you for contributing this!

callumalpass added a commit that referenced this pull request Oct 24, 2026
Keeps the v5 version and native settings. Main's legacy settings-tab
changes are ported to src/settings/native: Enter saves task (#2404),
the incomplete property-identification warning (#2363), Google
"show all-day as free" (2391cd0), and the modal field ID label (#2408).
Custom property key validation and Microsoft reconnect were already
covered by v5's native settings.

Task List movement takes main's #2381 system, which replaces v5's
setupCardTouchDrag list reorder; Kanban keeps longPressTouchDrag.
Tests and an e2e spec that target the removed legacy tabs are dropped.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants