Repository navigation
Fix(tui): a new note opens in the editor always, despite the set default mode - #26
Merged
adibhanna merged 1 commit intoNov 1, 2026
Conversation
createNote opened the note with the default pane mode (or the mode remembered for that path) and then entered insert mode. With a preview or split default, you were typing into a buffer the screen didn't show. The new note's tab is now set to edit mode directly, which leaves the default pane mode and the remembered per-note modes unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
adibhanna
added a commit
that referenced
this pull request
Nov 1, 2026
#26 shows the editor for a note made through createNote (`:new`, the new-note prompt, a quick note, Enter on no match in Search notes, the sidebar's new note, following a link to a missing note) when the default view mode is preview or split. A daily, weekly or monthly note created on first open, a note from a template, a `:taskfile` task and the daily note `:rollover` creates make their note without createNote, so they still opened in preview, with the template's cursor placed in a buffer nobody could see. They now call the same showNewNoteInEditor right after opening the note, as the desktop's rememberEditModeForCreatedNote covers its new, daily, template and task notes (ZenNotes/zennotes da328744). Only the new note's tab changes: the default view mode and the remembered per-note modes stay as they were, and a note that is already there, rollover into an existing daily note included, still opens in the default. A database record page keeps the default too, as on the desktop. Tests: every creation path under a preview and a split default, with keep_view_mode_across_notes on, opens in edit and leaves the default and the remembered modes alone; the new periodic, template, task-file and rollover cases fail without this change. An existing daily note, rollover into it and an existing note open in preview. Checked by hand in zn tui with default_view_mode = "preview": a new daily note and a note from the Meeting Notes template open in the editor, Welcome opens in preview.
adibhanna
added a commit
that referenced
this pull request
Nov 1, 2026
…ault mode (by @spirit-of-light) With the review follow-ups on top of the contributor's commits.
adibhanna
added a commit
that referenced
this pull request
Nov 1, 2026
#26 and #28 fixed the same thing from two sides. #26's showNewNoteInEditor set a new note's tab to edit right after it opened, and its follow-up called it from every creation path. #28 marks a note as new before the open (markNewNote), and since its follow-up a marked note always opens in the editor. Merged together, every creation path called both, one after the other, to the same end. The mark stays, since it acts inside the open itself, before a default, remembered or frontmatter mode is applied, and showNewNoteInEditor goes. Every creation path #26's follow-up covers already marks its note, and its tests (a new periodic, template, task-file and rollover note under a preview and a split default) pass on the mark alone, as do #28's.
Contributor
|
Thanks! This is merged into One follow-up, Since #28 fixed the same thing from the other side (a new-note mark applied during the open), |
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.
Creating a note puts you in insert mode, but with the default pane mode set to preview or split, the new tab showed the preview. You were typing into a buffer you couldn't see.
createNoteopened the note throughopenNote, which picks the tab's mode fromDefaultPaneMode(or the mode remembered for that path), and then sent VimA. It now sets the new note's tab to edit mode directly. It doesn't go throughsetPaneMode, so with "retain view mode" on, the default pane mode and the remembered per-note modes are left as they were.Tests: new
TestCreateNoteOpensInEditModesets the default to preview, creates a note and expects edit mode. It fails onmain("new note opened in mode preview, want edit") and passes here.go test -race ./...,go vet ./...,go build ./cmd/zn,git diff --checkandbash scripts/sandbox.sh --smokepass. Checked by hand in the TUI: a new note shows the editor straight away.🤖 Generated with Claude Code