Skip to content

Releases

0.2.0

Choose a tag to compare

@ddon ddon released this 15 Nov 21:27

The notes panel grows a folder tree with drag and drop, and edits with Leaf
wherever Leaf can talk to it. Several ways of overwriting a colleague's save
are closed, and an open vault page now follows membership changes.

Added

  • A folder tree in the notes panel, using core's FolderExplorer, rooted
    at the panel's folder. Its folders and notes can be expanded, opened, created
    and renamed. It starts collapsed and appears once the panel is wide enough;
    a narrow panel keeps the breadcrumbs.
  • Drag and drop in the panel, using core's MediaDragDrop hook: drop a
    note or folder onto a folder, or onto the top of the tree, to move it. Every
    move is checked against the panel's folder (its fence). A folder never goes
    into itself, and someone who may only read gets no drag. Since core 3.6 the
    hook lives in core's admin bundle, so a host that upgraded core must have
    run mix phoenix_kit.update.
  • A list like core's media page. Name, Created and Modified, each with who
    did it. A person with no name is shown by their email's local part, never
    the whole address. A folder's row shows how many notes it holds and its
    latest change. A folder has a back arrow up one level, except at the panel's
    own folder.
  • Rename from the title. Click a note's title to edit it in place; Enter
    or leaving the field saves it, and Escape puts it back.
  • vault_link (default false): a button that opens the whole vault on
    the admin pages. It is shown only to someone the admin pages would let in.
  • Notes.folder_tree/2 takes under: for one folder's subtree.

Changed

  • The panel edits with Leaf when Leaf is 0.11 or later, which Leaf 0.12 in
    the lock now is, with formatting and [[/# autocomplete. An older Leaf
    still gets the plain markdown textarea.
  • phoenix_kit floor is 3.5.0 (>= 3.5.0 and < 4.0.0), the ecosystem
    minimum.
  • Leaf floor is 0.6.1 (>= 0.6.1 and < 1.0.0). ~> 0.5 admitted versions
    without Leaf.Collab or click-to-follow links.
  • Dependencies updated: phoenix_kit 3.6.0, leaf 0.12.0, mdex 0.14.7, and
    others. ex_aws_ec2 left the lock along with core.

Fixed

  • A colleague's save is no longer overwritten without a prompt. Before, if
    someone else had saved the open note, your next keystroke could replace their
    text after any of these actions:

    • moving or renaming it, or moving any folder;
    • dragging it, or re-selecting its current folder;
    • clicking it again in the tree, or following a link to it;
    • in the panel, a host re-render.

    The editor now keeps the version it loaded, takes only the note's new
    location, and shows "Someone else changed this note". The next save is
    refused, and you choose.

  • A save writes where the note is now. A save after someone else moved the
    note, "Keep mine" included, used to write its old path. That recreated the
    file, or overwrote the note that had taken that path. Trash and rename act
    on the note as it is now too. A note moved out of the panel's folder is let
    go of, and trashing it from the vault page leaves alone whatever now sits at
    the old path.

  • A moved folder keeps its id, so the tree still opens it, drag targets
    still find it, and expanded folders stay expanded.

  • Creating in a folder moved away since it was shown no longer brings that
    folder back. The panel returns to its top and says so. A subfolder is not
    rebuilt once its vault is gone.

  • A reused panel lets go of its previous context. A host that reuses the
    component for another record or another signed-in user no longer leaves the
    previous note open, which could show private notes to the next person. A
    visibility_options change that removes the selected option switches to an
    allowed one.

  • An open vault page follows membership changes. A demoted editor can no
    longer save or delete, and a removed member can no longer search or receive
    updates. Both browser events and messages (autosaves, PubSub) are checked
    again.

  • Leaf is detected reliably in dev. The panel checked for Leaf without
    loading it, so in a dev server it showed the textarea until another page had
    rendered Leaf, then swapped editors mid-session.

  • "Back" in the panel no longer shows a fresh listing after access is
    withdrawn. A re-mounted panel can no longer gain a second poll timer.

  • The vault page drops core 3.6's new drag-hook events (box_select,
    move_picked_to_folder, pick_quick_confirm) instead of crashing on them.

  • The "deleted by someone else" message is translated.


Hex · Docs

0.1.0

Choose a tag to compare

@ddon ddon released this 15 Nov 21:27

First release. Notes are markdown files on disk; Postgres indexes them.

0.1.0 was drafted on 2026-08-25 but not published then. The sections below
are what changed after that draft; the draft's own list, which describes the
foundations, follows under its date.

Added

  • notes_panel edits on today's PhoenixKit. Without a Leaf that supports
    notify (0.11; core 3.4.0 caps Leaf at 0.10) the drop-in panel used to show
    notes read-only. It now edits them in a plain markdown textarea: autosave,
    the stale-write guard with its "Take theirs / Keep mine" choice, read-only
    without :edit access, and a debounced change for a note no longer open is
    dropped. With Leaf 0.11 the Leaf editor takes over, unchanged.

  • Search snippets: search_with_snippets/3 returns each match with a
    snippet of its body around the matched words (ts_headline, front matter
    left out), as {:text, _} / {:match, _} segments for the host to render
    and escape itself.

  • Numbered names on demand. create_note/4, rename_note/4,
    move_note/4 and restore_note/3 take unique: true: a name already taken
    becomes Ideas 2, Ideas 3, … instead of :already_exists /
    :target_exists (Obsidian's rule). The note's own current path counts as
    free, so renaming a note to its own name stays a no-op. Past 100 the answer
    is :too_many_duplicates, with its own message.

  • Rename and move in one step: move_note/4 takes title:. One file move,
    so the note is never briefly renamed in the old folder or moved under a name
    that collides there.

  • A trash a host can search: list_trash/2 with frontmatter: true adds
    each entry's parsed front matter, so a host that binds notes by a property
    (an id:) finds its trashed copy without reading .trash/ itself.

  • Notes by front-matter property: list_notes/2 takes property: {key, value} (compared as text) and has_property: key | [keys], and
    get_note_by_property/3 returns the first match, so hosts stop querying
    frontmatter in this module's tables with their own SQL.

  • Right-click menus on the vault tree. Folders offer Rename and Move to
    trash, notes offer Open and Move to trash; touch-and-hold does the same on a
    phone, and the menu names the row it was opened on. Core's explorer already
    marks every row with the attributes <.context_menu> reads, so this is two
    menu declarations — one element each, not one per row, and no round-trip to
    open. Confined to the sidebar with within, so a right-click on a note title
    in the search results or the editor still gets the browser's own menu. The
    folder menu stamps both spellings of the uuid param, because
    start_rename_folder takes folder-uuid (the sidebar's click vocabulary) and
    trash_folder takes folder_uuid (the drag hook's) — cheaper than a shim
    clause that exists only to rename a key. One new handler, open_note: the
    tree opens a note through a <.link patch> and a context menu cannot, since
    item hrefs are fixed at render time and only phx-value-* varies per row.

  • [[wiki-links]] render as links in the editor. Leaf 0.6.0 decorates them
    and asks which targets exist; the answer goes through the same resolver and
    same-folder tie-break that builds the stored link index, so a link never
    renders as pointing somewhere the backlinks panel disagrees with. An
    ambiguous title still resolves and now says so on hover, naming the note it
    picked. An unresolved target is styled distinctly and points at the create
    page, and the hover tooltip names the note a link resolved to. Leaf never
    navigates: the target is re-resolved on the server rather than trusting the
    href the page was rendered with.

    Configured follow: :click, matching Obsidian's Live Preview. Following a
    link does not work yet
    , through no fault of the configuration: hybrid's
    source swap runs off selectionchange, which a mouse press fires before
    click, so Leaf's handler finds the link's span already replaced and
    returns. No gesture reaches it. Written up for upstream in
    dev_docs/2026-08-28-leaf-wikilink-click-bug.md; the outgoing-links panel
    remains the way to navigate.

  • Folder move and rename, which the vault had no way to do — the README
    said "mv the directory and rescan". Storage.move_folder/3 plus
    Notes.relocate_folder/3: one operation, because a rename and a reparent are
    one operation on a filesystem. Notes underneath keep their uuids and therefore
    their backlinks, empty subdirectories move with the rest, and every key the
    subtree answered to is re-resolved so path-qualified [[folder/Note]] links
    follow. Refuses the vault root, an existing target, a move into its own
    subtree, and anything outside the vault.

  • Notes and folders in one tree, as Obsidian shows them. Core's
    FolderExplorer gained leaf items in 2.13.14; this passes every note keyed by
    the folder holding it and renders each as a link. The flat note list now
    appears only under a tag filter — without one it was a second copy of the
    tree.

  • The sidebar now uses core's FolderExplorer — guide lines, expand and
    collapse, inline rename — and core's MediaDragDrop hook, so notes and
    folders can be dragged into folders and notes onto Trash. Both come from
    phoenix_kit, so this module still ships no JavaScript.

  • Live editing groundwork. A Leaf.Collab.Room per note, started on demand
    under core's supervisor via the children/0 callback, and a
    Leaf.Collab.Store implementation that persists through
    Notes.update_content/4 rather than writing the file directly — so a
    collaborative edit re-derives the title, front matter, tags, link graph and
    search vector, which Leaf.Collab.Store.File would have left stale. The
    editor is not wired to it yet.

  • scripts/verify_collab.exs — what a room writes and what it refuses,
    against a real database and filesystem.

  • scripts/verify_links.exs — link resolution checked against a real
    database: what a link points at after every operation that can change the
    answer. mix test is deliberately database-free and smoke_http.exs only
    proves a page renders, not that it renders the right note.

  • Trash. Deleted notes and folders move to .trash/ inside the vault
    instead of being unlinked, under a per-deletion directory that preserves the
    original path — so restore is a move, and deleting the same path twice keeps
    both copies. Trash panel with restore, permanent delete and empty.

  • Leaf collaboration spec (dev_docs/2026-08-25-leaf-collaboration-spec.md) — what Leaf
    needs for CRDT multi-user editing, staged, with the Hex ecosystem survey
    (y_ex, prosemirror_ex, the y-phoenix-channel demo) and the settled
    storage model: the CRDT lives in Postgres while a note is open and is flushed
    to disk on a timer.

  • Live sync across browsers and devices. Each vault page subscribes to a
    PubSub topic; note saves, deletions, folder changes and rescans propagate to
    every open session. A note open in reading view is replaced immediately; one
    being edited raises a banner instead, so unsaved keystrokes are never
    discarded on your behalf. Rescans emit a single message rather than one per
    file, so mix phoenix_kit_knowledge_base.rescan in a terminal refreshes open
    browsers without flooding them.

Changed

  • Leaf 0.6.0, phoenix_kit 2.13.13. No code change was needed — the existing
    ~> 0.5 constraint already admits 0.6.0 — but the pair has to move together:
    core vendors the jsDelivr pin for Leaf's JS, and 2.13.13 is the release that
    points it at @v0.6.0. 0.6.0 brings Leaf.Collab (live editing) and
    [[wiki-link]] rendering, neither wired up here yet.
  • Reading view removed. There is one surface — the editor — as in Obsidian.
  • File names are validated, not repaired. An invalid title is refused with
    the reason instead of having its characters silently stripped, which used to
    file Ideas: Part 2 as Ideas Part 2. Adds Obsidian's link-breaking
    characters ([ ] # ^) and Windows device names to the refused set.
  • phoenix_kit constraint raised from ~> 2.0 to >= 2.14.0 and < 4.0.0,
    and all deps updated to their latest allowed versions.
    2.14.0 is the first
    published core with the <.context_menu> components the vault tree's
    right-click menus use (and 2.13.15+ has FolderExplorer's items attr /
    :item slot); with the old lock at 2.13.13 the module did not compile at
    all. The lock now resolves phoenix_kit 3.0.0 (compile-, test- and
    credo-verified; core 3.0 still drives module-owned tables through
    migration_module/0, which this module implements) plus mdex 0.14.6,
    ex_doc 0.40.4, yaml_elixir 2.12.2, dialyxir 1.4.8. Hosts upgrading to core
    3.0 must be at V225 (core 2.65.0) first — core refuses lower with
    BelowFloorError.

Fixed

  • Renaming or moving a note listed it twice. index_entry/4 looks the row
    up by path, which is the wrong key when the path is what changed: it found
    nothing at the new path and inserted a second row, leaving the old entry
    pointing at a file that had moved, rename_note/4 returning that stale row,
    and every backlink still attached to it. The row being moved is now named
    explicitly. (Rescan-detected renames were never affected — they update in
    place and match by content hash.)
  • The Reload button did not reload the editor. Leaf's surfaces are
    phx-update="ignore", so assigning content changes nothing on screen —
    replacing the buffer needs send_update(Leaf, action: :set_content, …).
    Discard mine, reload and a rescan that changed the open note underneath
    both left the old text in the editor while the server believed otherwise.
  • [[ autocomplete died at the first space. Neither suggestion trigger set
    :token, so both inherited Leaf's default of [\p{L}\p{N}_-]. A title like
    Attention Is All You Need could never be complet...
Read more