Skip to content

Folders: an empty folder offers the Paste or create card #1670

Done

Description

@vmillet-dev

Context — A folder just created and opened shows « Aucune note ne correspond à cette recherche. » and a « How it works » link, although nothing was searched; the only way to add a note is the « New note » button in the header. A folder holding notes shows the dashed « Paste or create » card after them. Reported on 1.2.1. A space without notes shows the same search message.

Change — An empty folder (and an empty space) shows the folder's list with the dashed « Paste or create » card in the first cell, exactly as when it holds notes. The « no note matches » message stays for a search or a filter that finds nothing.

To do

  • Draw the sections when the view has a creation card, even with no card matched; the empty state only when nothing matched and no section offers the creation card.
  • Keep the folder's name as the list's heading when it is empty.
  • Check the board view of an empty folder is unchanged (board.emptyZone).

Tests — Core: view.rs already holds an_opened_folder_keeps_the_slot_a_note_is_created_from; add the same with no note (one Results section, no card, show_create_ghost). kittest in canvas/tests.rs: an empty folder shows create-ghost and no canvas-no-results; clicking it opens a new note filed in the folder. e2e 20_folder_descent: a step opening a new empty sub-folder asserts create-ghost and the absence of canvas-no-results (its search step keeps asserting canvas-no-results).


Technical analysis

Cause. The core already answers what is wanted: in engine/src/notes/view.rs, build lays an opened folder out as Layout::Flat { create_ghost: !criteria.narrows() } (line 537), and results returns one Results section with show_create_ghost = true even when it has no card; the dated layout always keeps its Week section with the ghost (line 927). The interface throws it away: ui/src/notes/canvas/mod.rs:79 returns early on if view.matched == 0 and draws widgets::empty_state with notes.noResults (line 94) and, when no filter is typed, the « How it works » link — before sections is ever reached. Inside a folder has_user_filters() is false, so the user sees a search message with a documentation link.

Fix. Replace the condition by one answered by the core (D10, the UI decides nothing): a NotesView::offers_creation() (any section with show_create_ghost) and draw the empty state only when matched == 0 && !view.offers_creation(). Rows::of already counts the ghost as a cell (rows.rs:50, cards.len() + show_create_ghost), so an empty Results section lays out as a heading and one dashed cell; the opened heading (canvas/mod.rs, after line 110) names it after the folder. The ghost's click pushes GlobalAction::NewNote, which files the note in the opened folder.

Risk. Low. The « How it works » link of an empty library (first use without samples) disappears with the message: the samples seed every fresh install, so that path is reached only by emptying a space; the link remains in the About menu.

Activity

  1. added
    bug
    on Nov 27, 2026
  2. added a commit that references this issue on Nov 27, 2026
  3. vmillet-dev commented on Nov 27, 2026

    @vmillet-dev
    OwnerAuthor

    Fixed by #1678, merged into dev/1.2.2.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions