Add admin toggle for sorting dropdown visibility and hide A-Z grouping in custom drag mode #19

Merged
Copilot merged 2 commits from copilot/add-toggle-sorting-dropdown into main 2025-11-19 15:59:14 -06:00
Copilot commented 2025-11-19 15:38:46 -06:00 (Migrated from github.com)

Adds admin control to show/hide the sidebar sorting dropdown and removes alphabetical grouping when using custom drag-and-drop ordering.

Changes

Backend (backend/routes/settings.js)

  • Added show_sort_dropdown setting (default: 'true') to control dropdown visibility
  • Exposed setting as public so all authenticated users can read it

Admin Settings UI (frontend/src/pages/SettingsPage.jsx)

  • Added checkbox in Display Settings: "Show Sorting Dropdown to Users"
  • Saves/loads setting alongside other display preferences

Sidebar Component (frontend/src/components/Sidebar.jsx)

  • Conditionally renders sorting dropdown based on show_sort_dropdown setting
  • Hides A-Z alphabetical grouping button when sortBy === 'custom'

Behavior

When dropdown toggle is disabled:

  • Users see pages in default sort order only
  • No "Sort by:" dropdown visible in sidebar

When custom drag mode is active:

  • A-Z grouping button automatically hidden
  • Only flat list view available (prevents confusion with manual ordering)

Both changes are backward compatible—existing installations default to showing the dropdown.

Original prompt

Add a Section in the admin section to toggle if users are able to see the sorting drop down for pages. Also, for the Drag/Drop option, remove the Alphabetical Values


Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Adds admin control to show/hide the sidebar sorting dropdown and removes alphabetical grouping when using custom drag-and-drop ordering. ## Changes ### Backend (`backend/routes/settings.js`) - Added `show_sort_dropdown` setting (default: `'true'`) to control dropdown visibility - Exposed setting as public so all authenticated users can read it ### Admin Settings UI (`frontend/src/pages/SettingsPage.jsx`) - Added checkbox in Display Settings: "Show Sorting Dropdown to Users" - Saves/loads setting alongside other display preferences ### Sidebar Component (`frontend/src/components/Sidebar.jsx`) - Conditionally renders sorting dropdown based on `show_sort_dropdown` setting - Hides A-Z alphabetical grouping button when `sortBy === 'custom'` ## Behavior **When dropdown toggle is disabled:** - Users see pages in default sort order only - No "Sort by:" dropdown visible in sidebar **When custom drag mode is active:** - A-Z grouping button automatically hidden - Only flat list view available (prevents confusion with manual ordering) Both changes are backward compatible—existing installations default to showing the dropdown. <!-- START COPILOT CODING AGENT SUFFIX --> <details> <summary>Original prompt</summary> > Add a Section in the admin section to toggle if users are able to see the sorting drop down for pages. Also, for the Drag/Drop option, remove the Alphabetical Values </details> <!-- START COPILOT CODING AGENT TIPS --> --- ✨ Let Copilot coding agent [set things up for you](https://github.com/SluberskiHomeLab/noodlenook/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot) — coding agent works faster and does higher quality work when set up for your repo.
SluberskiHomeLab (Migrated from github.com) reviewed 2025-11-19 15:38:46 -06:00
Sign in to join this conversation.
No description provided.