From 6e28d1530aa08b878f5082bbcd85a95f84f830e8 Mon Sep 17 00:00:00 2001 From: Adam Mathes Date: Sat, 14 Feb 2026 21:34:49 -0800 Subject: chore: update build artifacts and finalize test improvements --- frontend/coverage/src/components/FeedList.tsx.html | 215 ++++++++++++++------- 1 file changed, 148 insertions(+), 67 deletions(-) (limited to 'frontend/coverage/src/components/FeedList.tsx.html') diff --git a/frontend/coverage/src/components/FeedList.tsx.html b/frontend/coverage/src/components/FeedList.tsx.html index acb2ede..4061422 100644 --- a/frontend/coverage/src/components/FeedList.tsx.html +++ b/frontend/coverage/src/components/FeedList.tsx.html @@ -23,30 +23,30 @@
- 79.54% + 87.27% Statements - 35/44 + 48/55
- 64.86% + 70% Branches - 24/37 + 35/50
- 64.7% + 78.94% Functions - 11/17 + 15/19
- 82.05% + 90% Lines - 32/39 + 45/50
@@ -61,7 +61,7 @@
-
+
1 2 @@ -248,7 +248,34 @@ 183 184 185 -186  +186 +187 +188 +189 +190 +191 +192 +193 +194 +195 +196 +197 +198 +199 +200 +201 +202 +203 +204 +205 +206 +207 +208 +209 +210 +211 +212 +213        @@ -263,62 +290,85 @@       -13x -13x -13x -13x -13x -13x -13x -13x -13x -13x     -13x   +22x +22x +22x +22x +22x +22x +22x +22x +22x +22x +22x   -13x -  -  +22x +  +22x +11x +11x         -13x -2x   +22x   -13x -6x   -4x -4x +22x +1x +1x +1x     -4x -4x   +22x +2x     -4x -4x -4x +22x +      +22x 1x 1x       -13x +22x +9x +  +7x +7x +  +  +7x +7x +  +  +  +7x +7x 7x   -6x +  +1x 1x     -6x +  +22x +13x +  +12x +2x +  +  +12x       @@ -330,7 +380,8 @@       -  +1x +        @@ -384,6 +435,8 @@       +  +  2x     @@ -415,6 +468,7 @@       +        @@ -437,52 +491,75 @@ 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({ theme, setTheme, setSidebarVisible, + isMobile, }: { theme: string; setTheme: (t: string) => void; setSidebarVisible: (visible: boolean) => void; + isMobile: boolean; }) { const [feeds, setFeeds] = useState<Feed[]>([]); const [tags, setTags] = useState<Category[]>([]); 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'); + Iif (variant) { + localStorage.setItem('neko-sidebar-variant', variant); + } + }, [searchParams]);   const currentFilter = searchParams.get('filter') || (location.pathname === '/' && !feedId && !tagName ? 'unread' : '');   - const handleSearch = (e: React.FormEvent) => { - e.preventDefault(); - if (searchQuery.trim()) { - navigate(`/?q=${encodeURIComponent(searchQuery.trim())}`); + const handleSearch = (e: React.FormEvent) => { + e.preventDefault(); + Eif (searchQuery.trim()) { + navigate(`/?q=${encodeURIComponent(searchQuery.trim())}`); } };   const toggleFeeds = () => { setFeedsExpanded(!feedsExpanded); }; +  + const toggleTags = () => { + setTagsExpanded(!tagsExpanded); + }; +  + const handleLinkClick = () => { + Eif (isMobile) { + setSidebarVisible(false); + } + };   useEffect(() => { Promise.all([ apiFetch('/api/feed/').then((res) => { Iif (!res.ok) throw new Error('Failed to fetch feeds'); - return res.json(); + return res.json() as Promise<Feed[]>; }), apiFetch('/api/tag').then((res) => { Iif (!res.ok) throw new Error('Failed to fetch tags'); - return res.json(); + return res.json() as Promise<Category[]>; }), ]) .then(([feedsData, tagsData]) => { @@ -504,7 +581,7 @@ export default function FeedList({ };   return ( - <div className="feed-list"> + <div className={`feed-list variant-${sidebarVariant}`}> <h1 className="logo" onClick={() => setSidebarVisible(false)}> 🐱 </h1> @@ -515,7 +592,7 @@ export default function FeedList({ type="search" placeholder="search..." value={searchQuery} - onChange={(e) => setSearchQuery(e.target.value)} + onChange={(e) => setSearchQuery(e.target.value)} className="search-input" /> </form> @@ -524,17 +601,17 @@ export default function FeedList({ <div className="filter-section"> <ul className="filter-list"> <li className="unread_filter"> - <Link to="/?filter=unread" className={currentFilter === 'unread' ? 'active' : ''}> + <Link to="/?filter=unread" className={currentFilter === 'unread' ? 'active' : ''} onClick={handleLinkClick}> unread </Link> </li> <li className="all_filter"> - <Link to="/?filter=all" className={currentFilter === 'all' ? 'active' : ''}> + <Link to="/?filter=all" className={currentFilter === 'all' ? 'active' : ''} onClick={handleLinkClick}> all </Link> </li> <li className="starred_filter"> - <Link to="/?filter=starred" className={currentFilter === 'starred' ? 'active' : ''}> + <Link to="/?filter=starred" className={currentFilter === 'starred' ? 'active' : ''} onClick={handleLinkClick}> starred </Link> </li> @@ -542,26 +619,29 @@ export default function FeedList({ </div>   <div className="tag-section"> - <h4 onClick={() => { }} className="section-header"> - Tags + <h4 onClick={toggleTags} className="section-header"> + <span className={`caret ${tagsExpanded ? 'expanded' : ''}`}>▶</span> Tags </h4> - <ul className="tag-list-items"> - {tags.map((tag) => ( - <li key={tag.title} className="tag-item"> - <Link - to={`/tag/${encodeURIComponent(tag.title)}`} - className={`tag-link ${tagName === tag.title ? 'active' : ''}`} - > - {tag.title} - </Link> - </li> - ))} - </ul> + {tagsExpanded && ( + <ul className="tag-list-items"> + {tags.map((tag) => ( + <li key={tag.title} className="tag-item"> + <Link + to={`/tag/${encodeURIComponent(tag.title)}`} + className={`tag-link ${tagName === tag.title ? 'active' : ''}`} + onClick={handleLinkClick} + > + {tag.title} + </Link> + </li> + ))} + </ul> + )} </div>   <div className="feed-section"> <h4 onClick={toggleFeeds} className="section-header"> - Feeds + <span className={`caret ${feedsExpanded ? 'expanded' : ''}`}>▶</span> Feeds </h4> {feedsExpanded && (feeds.length === 0 ? ( @@ -573,6 +653,7 @@ export default function FeedList({ <Link to={`/feed/${feed._id}`} className={`feed-title ${feedId === String(feed._id) ? 'active' : ''}`} + onClick={handleLinkClick} > {feed.title || feed.url} </Link> @@ -585,7 +666,7 @@ export default function FeedList({ <div className="nav-section"> <ul className="nav-list"> <li> - <Link to="/settings" className="nav-link"> + <Link to="/settings" className="nav-link" onClick={handleLinkClick}> settings </Link> </li> @@ -625,7 +706,7 @@ export default function FeedList({