Describe the bug
When you click on categories like "Important" or "Work", the sidebar highlights them correctly. However, if you click "All Notes", the highlight disappears completely. This happens because the filterNotesByCategory function dynamically looks for an HTML element with the ID nav + category (which resolves to navall). But in your HTML, the ID for that tab is navNotes.
To Reproduce
/* BEFORE */
// Check if it's a built-in category or a custom folder
const builtInNav = document.getElementById(nav${category});
if (builtInNav) {
builtInNav.classList.add('active');
}
/* AFTER */
// Check if it's a built-in category or a custom folder
const navId = category === "all" ? "navNotes" : nav${category};
const builtInNav = document.getElementById(navId);
if (builtInNav) {
builtInNav.classList.add('active');
}
Expected behavior
Clicking "All Notes" or clicking out of a category back to the main view will now correctly highlight the " All Notes" tab in the sidebar.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
Smartphone (please complete the following information):
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
Additional context
Add any other context about the problem here.
Describe the bug
When you click on categories like "Important" or "Work", the sidebar highlights them correctly. However, if you click "All Notes", the highlight disappears completely. This happens because the filterNotesByCategory function dynamically looks for an HTML element with the ID nav + category (which resolves to navall). But in your HTML, the ID for that tab is navNotes.
To Reproduce
/* BEFORE */
// Check if it's a built-in category or a custom folder
const builtInNav = document.getElementById(
nav${category});if (builtInNav) {
builtInNav.classList.add('active');
}
/* AFTER */
// Check if it's a built-in category or a custom folder
const navId = category === "all" ? "navNotes" :
nav${category};const builtInNav = document.getElementById(navId);
if (builtInNav) {
builtInNav.classList.add('active');
}
Expected behavior
Clicking "All Notes" or clicking out of a category back to the main view will now correctly highlight the " All Notes" tab in the sidebar.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context
Add any other context about the problem here.