Skip to content

Fix(tui): a new note opens in the editor always, despite the set default mode - #26

Open
spirit-of-light wants to merge 1 commit into
ZenNotes:mainfrom
spirit-of-light:fix-new-note-edit-view
Open

spirit-of-light wants to merge 1 commit into
ZenNotes:mainfrom
spirit-of-light:fix-new-note-edit-view

Conversation

@spirit-of-light

Copy link
Copy Markdown
Contributor

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.

createNote opened the note through openNote, which picks the tab's mode from DefaultPaneMode (or the mode remembered for that path), and then sent Vim A. It now sets the new note's tab to edit mode directly. It doesn't go through setPaneMode, so with "retain view mode" on, the default pane mode and the remembered per-note modes are left as they were.

Tests: new TestCreateNoteOpensInEditMode sets the default to preview, creates a note and expects edit mode. It fails on main ("new note opened in mode preview, want edit") and passes here. go test -race ./..., go vet ./..., go build ./cmd/zn, git diff --check and bash scripts/sandbox.sh --smoke pass. Checked by hand in the TUI: a new note shows the editor straight away.

🤖 Generated with Claude Code

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>
@spirit-of-light spirit-of-light changed the title Fix(tui): a new note opens in the editor whatever the default pane mode Fix(tui): a new note opens in the editor always, despite the set default mode Oct 31, 2026
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.

1 participant