Repository navigation
6.99.42 — Categories become things you make
Pre-releaseCategories become things you make, rather than things that happen to you.
A category in this fork is a folder you create deliberately, from the sidebar.
Almost everything else about them still assumed the upstream model, where a
category existed only as a side effect of where a note happened to sit. This
release closes that gap. Five fixes, and the first one is the one that started
it.
A new category was real in one browser tab and nowhere else
Making a category from the sidebar put it in the browser and sent nothing to
the server. There was no request to send, and no route to send one to. So the
category existed in that tab and nowhere else: dragging it somewhere answered
"Note not found", renaming it from its menu failed the same way, and a
reload lost it altogether.
The rename it sends looks its folder up without permission to create one,
finds nothing, and the missing folder is reported as a missing note — which is
where that strange message came from.
Making one now creates the folder, with any parents it needs, before anything
appears in the sidebar. A category you can see is one that exists. It is
stored under the name the server could actually use, too: a folder name cannot
hold a colon or a backslash, and showing one that the folder does not have
would be the same lie in a smaller way.
A category you emptied was destroyed
Moving or deleting the last note in a category took the category with it, and
every empty parent above it.
That behaviour makes sense upstream, where there is no way to make a category:
filing a note as Projects/2024/Q1 is the only thing that brings those three
folders into being, so moving that note away leaves three nobody asked for.
Here it is wrong. Someone who builds the structure before filling it has
categories that are empty for a while, and one that was filled and later
emptied is a shelf they built, not debris.
Nothing removes a category now except being asked to.
Categories nested inside another were never reported at all
The listing gathered each folder's categories and then merged that list with
the one from each subfolder — using an operation that, on lists numbered from
zero, keeps the entry it already has wherever the numbering collides. So the
first category at one level hid the first one below it, the second hid the
second, and so on. A nested category only survived if its parent's level
happened to be longer than its own.
Clients/Client1 never reached the browser while Clients did. A category
with no notes directly inside it could not be filed into, chosen, or brought
back by a reload: nothing had reported that it existed.
This went unnoticed for a long time because a category holding a note is also
reconstructed from that note's own path, which is the ordinary case. It only
bites a category that holds no notes — which is exactly what this release
makes possible.
The note menu invented categories from typos
The category field in a note's actions menu accepted anything typed into it
and filed the note under whatever that was, creating the folder on the way.
Type Clients/Client1/Porjects with a slip in it and that is what you got:
the folder made, the note moved into it, and nothing said so. The note simply
left the list it was in and arrived somewhere that looked right at a glance.
The field now offers the categories that exist and nothing else. Typing still
narrows the list, which is how a deep path is reached quickly — that is the
field's own filtering and it is unaffected.
The REST API is unchanged. Filing a note into a category that does not
exist still creates it, which is the documented contract the Android and iOS
clients rely on.
An empty category showed you the last note you had open
Opening a category with nothing in it left whatever note was open before
sitting in the pane beside it — a note from somewhere else entirely, with
nothing to say the category being looked at was empty. And with nothing open
at all, the first-run welcome screen replaced the list, the search field and
the New note button.
The list stays now, whatever the pane beside it holds: the note, the welcome
on a genuine first run, or a line saying why it is empty — No notes in this
category, No notes found, Select a note.
Worth knowing
Nothing about the file format changes, and nothing already written is altered.
A category that exists only because a note sits in it behaves exactly as
before.
If you have empty folders in your Notes directory that you did not expect,
they were always there — they simply could not be reported until now.