nextcloud / nextcloud/notes

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

Open Beginner friendly
#2,035 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug need to reproduce
Dominant language
JavaScript
Stars
738
Forks
162
Avg merge
6h 2m
Merged PRs (30d)
35

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/components/NotesView.vue, focusing on the single-group branch and the NotesCaption rendering in the grouped branch. Reproduce the case with one note in Personal/Work, then verify the notes list shows the Work caption both with one nested note and after adding a direct Personal note.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
88/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.