Root notebook notes

Issue

Not really a bug, so maybe this is a feature request :thinking: ?

The default behavior is If a notebook has notes at it’s root and also sub notebooks with other notes, expanding and selecting the root notebook will list just the notes on the root folder instead of all notes under that root notebook + sub notebooks.
But going on the detail view, for that same root notebook, there’s no way to get just the list of notes under the root notebook so if I want just those notes, I have to get out of the detail view :frowning:

Any chance that we can get something like this? so that the root notebook is also clickable and only those notes are listed?

Environment

  • Platform: macOS
  • Platform version: Ventura 13.6.3
  • App Version: 5.6.2

How to reproduce

Thank you Takuya :slight_smile:

Hi picklecillo,

Thanks for the feedback.
That’s interesting as I haven’t ever thought of it.
An idea to quickly solve it is to support a modifier key for the ‘All Notes’ menu item click handler. e.g., if you click it while holding Alt, it shows only the direct children. But it is not an obvious UX.
I don’t know if having a ‘Root’ menu item below the ‘All Notes’ item at the moment.
Do you have any other ideas? :thinking:

Hi Takuya,

I’d be ok with the modifier key option, but I agree its not the best UX. :thinking:
Some thoughts:

  • Maybe make Notebooks clickable?

    • Pro: makes sense that the expanded parent of all sub notebooks will show the root notes
    • Pro: Same behavior as clicking on a expanded parent notebook on the default view
    • Con: weird to click something labeled Notebooks to get notes
    • Con: It would mean (i’m assuming) having a slightly different component to list notebooks vs the default view
  • Maybe have some UI switch or another way to visually show the modified behavior?

  • Or, have a plugin add a section on the side nav for it. Would that be possible to implement?

It’d be ok to add another sidebar item for displaying the direct children, but the problem is that what label it should have since we already have ‘All Notes’.
It sounds weird to call it ‘Direct children’…

  • Maybe have some UI switch or another way to visually show the modified behavior?

It is still unclear just as the menu label problem.

  • Or, have a plugin add a section on the side nav for it. Would that be possible to implement?

BTW, you can create a custom command that toggles the children flag in your init.js like so

inkdrop.commands.add(
  document.body,
  'custom:note-ilst-toggle-children',
  (event) => {

    const { bookId, includeChildren } = inkdrop.store.getState().queryContext

    if (bookId) {
      inkdrop.commands.dispatch(document.body, 'core:note-list-show-notes-in-book', {
        bookId,
        includeChildren: !includeChildren
      })
    }

  }
})

Then, you can bind it with a keymap.

Hey!
Set up the command + key bind. Solves my issue :ok_hand:

Last idea. Could the same behavior be set up as a filter?

That’s possible. Update your command to invoke the redux actions instead of the command like so:

const { actions } = require('inkdrop')
const { dispatch } = inkdrop.store

const qc = { ...inkdrop.store.getState().queryContext }
qc.includeChildren = !qc.includeChildren

Promise.all([
  dispatch(
    actions.notes.loadWithQueryContext(qc, {
      limit: 50
    })
  ),
  dispatch(actions.queryContext.restore(qc))
])