From e014ded82a630bd91b15be4307125f5580119f4d Mon Sep 17 00:00:00 2001 From: Adam Mathes Date: Fri, 13 Feb 2026 13:50:25 -0800 Subject: Analyze page size and fix frontend tests --- frontend/coverage/src/components/FeedList.tsx.html | 175 +++++++++++++++------ 1 file changed, 131 insertions(+), 44 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 75aeb6a..b1b0a27 100644 --- a/frontend/coverage/src/components/FeedList.tsx.html +++ b/frontend/coverage/src/components/FeedList.tsx.html @@ -23,30 +23,30 @@
- 94.44% + 91.66% Statements - 17/18 + 22/24
- 83.33% + 82.35% Branches - 10/12 + 14/17
100% Functions - 6/6 + 8/8
- 93.75% + 100% Lines - 15/16 + 20/20
@@ -114,36 +114,86 @@ 49 50 51 -52  +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +69 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81  +  +  +  +  +  +11x +11x +11x +11x +  +11x +6x +  +4x +4x +  +  +4x +4x +  +    +4x +4x +4x     +1x +1x     -9x -9x -9x   -9x +11x 5x   -3x -  +4x +  +  +  +  +  +    -3x     -3x -3x     -1x -1x       -9x -4x   3x   @@ -153,7 +203,15 @@       -2x +  +  +  +  +  +  +  +  +3x       @@ -167,24 +225,29 @@    
import { useEffect, useState } from 'react';
 import { Link } from 'react-router-dom';
-import type { Feed } from '../types';
+import type { Feed, Category } from '../types';
 import './FeedList.css';
  
 export default function FeedList() {
     const [feeds, setFeeds] = useState<Feed[]>([]);
+    const [tags, setTags] = useState<Category[]>([]);
     const [loading, setLoading] = useState(true);
     const [error, setError] = useState('');
  
     useEffect(() => {
-        fetch('/api/feed/')
-            .then((res) => {
-                Iif (!res.ok) {
-                    throw new Error('Failed to fetch feeds');
-                }
+        Promise.all([
+            fetch('/api/feed/').then(res => {
+                Iif (!res.ok) throw new Error('Failed to fetch feeds');
+                return res.json();
+            }),
+            fetch('/api/tag').then(res => {
+                Iif (!res.ok) throw new Error('Failed to fetch tags');
                 return res.json();
             })
-            .then((data) => {
-                setFeeds(data);
+        ])
+            .then(([feedsData, tagsData]) => {
+                setFeeds(feedsData);
+                setTags(tagsData);
                 setLoading(false);
             })
             .catch((err) => {
@@ -198,20 +261,44 @@ export default function FeedList() {
  
     return (
         <div className="feed-list">
-            <h2>Feeds</h2>
-            {feeds.length === 0 ? (
-                <p>No feeds found.</p>
-            ) : (
-                <ul className="feed-list-items">
-                    {feeds.map((feed) => (
-                        <li key={feed._id} className="feed-item">
-                            <Link to={`/feed/${feed._id}`} className="feed-title">
-                                {feed.title || feed.url}
-                            </Link>
-                            {feed.category && <span className="feed-category">{feed.category}</span>}
-                        </li>
-                    ))}
+            <div className="filter-section">
+                <ul className="filter-list">
+                    <li><Link to="/?filter=unread">Unread</Link></li>
+                    <li><Link to="/?filter=all">All</Link></li>
+                    <li><Link to="/?filter=starred">Starred</Link></li>
                 </ul>
+            </div>
+            <div className="feed-section">
+                <h2>Feeds</h2>
+                {feeds.length === 0 ? (
+                    <p>No feeds found.</p>
+                ) : (
+                    <ul className="feed-list-items">
+                        {feeds.map((feed) => (
+                            <li key={feed._id} className="sidebar-feed-item">
+                                <Link to={`/feed/${feed._id}`} className="feed-title">
+                                    {feed.title || feed.url}
+                                </Link>
+                                {feed.category && <span className="feed-category">{feed.category}</span>}
+                            </li>
+                        ))}
+                    </ul>
+                )}
+            </div>
+ 
+            {tags && tags.length > 0 && (
+                <div className="tag-section">
+                    <h2>Tags</h2>
+                    <ul className="tag-list-items">
+                        {tags.map((tag) => (
+                            <li key={tag.title} className="tag-item">
+                                <Link to={`/tag/${encodeURIComponent(tag.title)}`} className="tag-link">
+                                    {tag.title}
+                                </Link>
+                            </li>
+                        ))}
+                    </ul>
+                </div>
             )}
         </div>
     );
@@ -223,7 +310,7 @@ export default function FeedList() {