Skip to content

Sub-category caption is missing when a category has only one sub-group #2035

Description

@ppardi

When a user selects a category and all its visible notes belong to a single sub-category, the sub-category caption isn't being shown in the notes list. The notes appear directly under the selected category in the list and don't represent where they actually are in the hierarchy.

Since the navigation only lists top-level categories, that caption is the only place in the notes list that shows which category a note is in when it's nested. Without the sub-category in the notes list, it's not possible to know where in the hierarchy the note is without looking at the note's Details tab UI on the note (or switch to "All notes").

Steps to reproduce

  1. Create a note in the category Personal/Work, so it's the only note under Personal
  2. Select Personal in the navigation
  3. Observe the note list. The note shows in the notes list but with no sub-category (Work) caption
  4. Create a second note directly in Personal
  5. Observe the note list again. Now a "Work" caption appears above the first note

Expected behaviour

The sub-category caption should show in both cases. Step 3 should already display a "Work" caption above the note.

Actual behaviour

After step 3, the list shows no caption so the note looks as though it lives directly in Personal. The caption only appears once a second group exists.

Cause

In src/components/NotesView.vue, the single-group case takes a separate branch that renders NotesList on its own:

<NotesList v-if="groupedNotes.length === 1"
    :notes="groupedNotes[0].notes"
    :showCategoryTitle="category === null"
/>
<template v-for="(group, idx) in groupedNotes" v-else :key="idx">
    <NotesCaption v-if="group.category && category !== group.category" … />

NotesCaption only exists in the v-else branch, so it is skipped whenever there is exactly one group.

The note items do not carry the load. .NoteItem's subname would show the full category but its gated on showCategoryTitle (which is category === null). So it also is off when any category is selected. Both signals are suppressed at once.

Server

  • Notes app version: 6.1.0
  • Nextcloud version: 35.0.0
  • Browser: Edge 153

Related

Related to #879 (category tree). The flattened navigation makes this caption the only indication of nested placement, so losing it is more confusing than it would be otherwise.

Investigated with the help of Claude Code.

Activity

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

    bugSomething isn't workingneed to reproduceIssue that has not been reproduced

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions