From ad6b8187e5a7ba6b36f330b181434e4582bf2d74 Mon Sep 17 00:00:00 2001 From: Adam Mathes Date: Sat, 14 Feb 2026 16:05:56 -0800 Subject: UI: Add collapsible caret icons for Tags and Feeds in sidebar (NK-gjymiw) --- frontend/src/components/FeedList.css | 17 ++++++++++++ frontend/src/components/FeedList.tsx | 51 ++++++++++++++++++++++++------------ 2 files changed, 51 insertions(+), 17 deletions(-) (limited to 'frontend') diff --git a/frontend/src/components/FeedList.css b/frontend/src/components/FeedList.css index 7c39901..35543b7 100644 --- a/frontend/src/components/FeedList.css +++ b/frontend/src/components/FeedList.css @@ -4,6 +4,9 @@ color: #777; /* specific v1 color */ font-size: 0.8rem; + background: var(--sidebar-bg); + min-height: 100%; + flex: 1; } .feed-list h1.logo { @@ -57,6 +60,20 @@ /* Darker than list items */ text-transform: lowercase; font-variant: small-caps; + display: flex; + align-items: center; + gap: 0.5rem; +} + +.caret { + display: inline-block; + font-size: 0.6rem; + transition: transform 0.2s ease; + color: #777; +} + +.caret.expanded { + transform: rotate(90deg); } .filter-list, diff --git a/frontend/src/components/FeedList.tsx b/frontend/src/components/FeedList.tsx index 250ce7d..a4ecccf 100644 --- a/frontend/src/components/FeedList.tsx +++ b/frontend/src/components/FeedList.tsx @@ -2,6 +2,7 @@ import { useEffect, useState } from 'react'; import { Link, useNavigate, useSearchParams, useLocation, useParams } from 'react-router-dom'; import type { Feed, Category } from '../types'; import './FeedList.css'; +import './FeedListVariants.css'; import { apiFetch } from '../utils'; export default function FeedList({ @@ -20,12 +21,22 @@ export default function FeedList({ const [loading, setLoading] = useState(true); const [error, setError] = useState(''); const [feedsExpanded, setFeedsExpanded] = useState(false); + const [tagsExpanded, setTagsExpanded] = useState(true); const [searchQuery, setSearchQuery] = useState(''); const navigate = useNavigate(); const [searchParams] = useSearchParams(); const location = useLocation(); const { feedId, tagName } = useParams(); + const sidebarVariant = searchParams.get('sidebar') || localStorage.getItem('neko-sidebar-variant') || 'glass'; + + useEffect(() => { + const variant = searchParams.get('sidebar'); + if (variant) { + localStorage.setItem('neko-sidebar-variant', variant); + } + }, [searchParams]); + const currentFilter = searchParams.get('filter') || (location.pathname === '/' && !feedId && !tagName ? 'unread' : ''); @@ -41,6 +52,10 @@ export default function FeedList({ setFeedsExpanded(!feedsExpanded); }; + const toggleTags = () => { + setTagsExpanded(!tagsExpanded); + }; + const handleLinkClick = () => { if (isMobile) { setSidebarVisible(false); @@ -77,7 +92,7 @@ export default function FeedList({ }; return ( -
+

setSidebarVisible(false)}> 🐱

@@ -115,27 +130,29 @@ export default function FeedList({
-

{ }} className="section-header"> - Tags +

+ Tags

-
    - {tags.map((tag) => ( -
  • - - {tag.title} - -
  • - ))} -
+ {tagsExpanded && ( +
    + {tags.map((tag) => ( +
  • + + {tag.title} + +
  • + ))} +
+ )}

- Feeds + Feeds

{feedsExpanded && (feeds.length === 0 ? ( -- cgit v1.2.3