diff --git a/TODO.md b/TODO.md index d9518ca..9d3e504 100644 --- a/TODO.md +++ b/TODO.md @@ -5,6 +5,7 @@ This document outlines the features and improvements that still need to be imple ## 🚨 High Priority (1-2 weeks) ### 1. Bookmarking System + - **Requirement**: "Users can bookmark posts and topics; local only" - **Status**: ❌ Not implemented - **Missing**: @@ -16,6 +17,7 @@ This document outlines the features and improvements that still need to be imple - **Estimated Effort**: 2-3 days ### 2. Call Sign Setup & Display + - **Requirement**: "Users can setup a call sign; bitcoin identity operator unique name - remains - ordinal used as avatar" - **Status**: ⚠️ Partially implemented - **Missing**: @@ -27,6 +29,7 @@ This document outlines the features and improvements that still need to be imple - **Estimated Effort**: 3-4 days ### 3. Cell Icon System + - **Requirement**: "Cell can be created with a name, description, icon; icon size will be restricted" - **Status**: ❌ Not implemented - **Missing**: @@ -40,6 +43,7 @@ This document outlines the features and improvements that still need to be imple ## 🔶 Medium Priority (2-3 weeks) ### 4. Enhanced Sorting Options + - **Requirement**: "Users can sort topics per new or top" - **Status**: ⚠️ Basic implementation exists - **Missing**: @@ -51,6 +55,7 @@ This document outlines the features and improvements that still need to be imple - **Estimated Effort**: 1-2 days ### 5. Active Member Count Display + - **Requirement**: "A user can see the number of active members per cell; deduced from retrievable activity" - **Status**: ⚠️ Calculated in backend but not shown - **Missing**: @@ -61,6 +66,7 @@ This document outlines the features and improvements that still need to be imple - **Estimated Effort**: 1 day ### 6. IndexedDB Integration + - **Requirement**: "store message cache in indexedDB -- make app local-first" - **Status**: ❌ In-memory caching only - **Missing**: @@ -72,6 +78,7 @@ This document outlines the features and improvements that still need to be imple - **Estimated Effort**: 3-4 days ### 7. Enhanced Moderation UI + - **Requirement**: "Cell admin can mark posts and comments as moderated" - **Status**: ⚠️ Backend logic exists, basic UI - **Missing**: @@ -86,6 +93,7 @@ This document outlines the features and improvements that still need to be imple ## 🔵 Low Priority (3-4 weeks) ### 8. Anonymous User Experience + - **Requirement**: "Anonymous users can upvote, comments and post" - **Status**: ⚠️ Basic support but limited UX - **Missing**: @@ -97,6 +105,7 @@ This document outlines the features and improvements that still need to be imple - **Estimated Effort**: 2-3 days ### 9. Relevance Score Visibility + - **Requirement**: "The relevance index is used to push most relevant posts and comments on top" - **Status**: ⚠️ Calculated but limited visibility - **Missing**: @@ -108,6 +117,7 @@ This document outlines the features and improvements that still need to be imple - **Estimated Effort**: 1-2 days ### 10. Mobile Responsiveness + - **Requirement**: "Users do not need any software beyond a browser to use the forum" - **Status**: ❌ Basic responsive design - **Missing**: @@ -121,18 +131,21 @@ This document outlines the features and improvements that still need to be imple ## 🛠️ Technical Debt & Infrastructure ### 11. Performance Optimizations + - [ ] Implement virtual scrolling for large lists - [ ] Add message pagination - [ ] Optimize relevance calculations - [ ] Implement lazy loading for images ### 12. Testing & Quality + - [ ] Add comprehensive unit tests - [ ] Implement integration tests - [ ] Add end-to-end testing - [ ] Performance testing and monitoring ### 13. Documentation + - [ ] API documentation - [ ] User guide - [ ] Developer setup guide @@ -141,11 +154,13 @@ This document outlines the features and improvements that still need to be imple ## 📋 Implementation Notes ### Dependencies + - Bookmarking system depends on IndexedDB integration - Call sign setup depends on user profile system completion - Enhanced moderation depends on existing moderation backend ### Technical Considerations + - Use React Query for state management - Implement proper error boundaries - Add loading states for all async operations @@ -153,6 +168,7 @@ This document outlines the features and improvements that still need to be imple - Follow existing code patterns and conventions ### Testing Strategy + - Unit tests for utility functions - Integration tests for hooks and contexts - Component tests for UI elements @@ -169,11 +185,11 @@ This document outlines the features and improvements that still need to be imple ## 📅 Timeline Estimate - **Phase 1 (High Priority)**: 1-2 weeks -- **Phase 2 (Medium Priority)**: 2-3 weeks +- **Phase 2 (Medium Priority)**: 2-3 weeks - **Phase 3 (Low Priority)**: 3-4 weeks - **Total Estimated Time**: 6-9 weeks --- -*Last updated: [Current Date]* -*Based on FURPS requirements analysis and codebase review* +_Last updated: [Current Date]_ +_Based on FURPS requirements analysis and codebase review_ diff --git a/src/App.tsx b/src/App.tsx index 6026da9..5f8b7f5 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -23,6 +23,7 @@ import PostPage from './pages/PostPage'; import NotFound from './pages/NotFound'; import Dashboard from './pages/Dashboard'; import Index from './pages/Index'; +import ProfilePage from './pages/ProfilePage'; import { appkitConfig } from './lib/wallet/config'; import { WagmiProvider } from 'wagmi'; import { config } from './lib/wallet/config'; @@ -46,6 +47,7 @@ const App = () => ( } /> } /> } /> + } /> } /> diff --git a/src/components/CellList.tsx b/src/components/CellList.tsx index 164da6f..2747278 100644 --- a/src/components/CellList.tsx +++ b/src/components/CellList.tsx @@ -21,8 +21,71 @@ import { import { CypherImage } from './ui/CypherImage'; import { RelevanceIndicator } from './ui/relevance-indicator'; import { sortCells, SortOption } from '@/lib/utils/sorting'; +import { Cell } from '@/types/forum'; import { usePending } from '@/hooks/usePending'; +// Separate component to properly use hooks +const CellItem: React.FC<{ cell: Cell }> = ({ cell }) => { + const pending = usePending(cell.id); + + return ( + +
+ + +
+
+

+ {cell.name} +

+ {cell.relevanceScore !== undefined && ( + + )} +
+ {pending.isPending && ( +
+ + syncing… + +
+ )} + +

+ {cell.description} +

+ +
+
+ + + {cell.postCount || 0} posts + + + + {cell.activeMemberCount || 0} members + +
+
+
+
+ + ); +}; + const CellList = () => { const { cellsWithStats, isInitialLoading } = useForumData(); const { refreshData } = useForumActions(); @@ -109,63 +172,7 @@ const CellList = () => { ) : ( - sortedCells.map(cell => ( - -
- - -
-
-

- {cell.name} -

- {cell.relevanceScore !== undefined && ( - - )} -
- {usePending(cell.id).isPending && ( -
- - syncing… - -
- )} - -

- {cell.description} -

- -
-
- - - {cell.postCount || 0} posts - - - - {cell.activeMemberCount || 0} members - -
-
-
-
- - )) + sortedCells.map(cell => ) )} diff --git a/src/components/FeedSidebar.tsx b/src/components/FeedSidebar.tsx index 2025a8b..dfd4be4 100644 --- a/src/components/FeedSidebar.tsx +++ b/src/components/FeedSidebar.tsx @@ -1,17 +1,11 @@ -import React, { useState } from 'react'; +import React from 'react'; import { Link } from 'react-router-dom'; -import { Plus, TrendingUp, Users, Eye } from 'lucide-react'; -import { Button } from '@/components/ui/button'; +import { TrendingUp, Users, Eye } from 'lucide-react'; + import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; import { Badge } from '@/components/ui/badge'; -import { - useForumData, - useForumSelectors, - useAuth, - usePermissions, -} from '@/hooks'; +import { useForumData, useForumSelectors, useAuth } from '@/hooks'; import { CypherImage } from '@/components/ui/CypherImage'; -import { CreateCellDialog } from '@/components/CreateCellDialog'; import { useUserDisplay } from '@/hooks'; const FeedSidebar: React.FC = () => { @@ -19,11 +13,9 @@ const FeedSidebar: React.FC = () => { const forumData = useForumData(); const selectors = useForumSelectors(forumData); const { currentUser, verificationStatus } = useAuth(); - const { canCreateCell } = usePermissions(); - const [showCreateCell, setShowCreateCell] = useState(false); // Get user display information using the hook - const { displayName, hasENS, hasOrdinal } = useUserDisplay( + const { displayName, ensName, ordinalDetails } = useUserDisplay( currentUser?.address || '' ); @@ -41,9 +33,9 @@ const FeedSidebar: React.FC = () => { return { text: 'Verified Owner', color: 'bg-green-500' }; } else if (verificationStatus.level === 'verified-basic') { return { text: 'Verified', color: 'bg-blue-500' }; - } else if (hasENS) { + } else if (ensName) { return { text: 'ENS User', color: 'bg-purple-500' }; - } else if (hasOrdinal) { + } else if (ordinalDetails) { return { text: 'Ordinal User', color: 'bg-orange-500' }; } return { text: 'Unverified', color: 'bg-gray-500' }; @@ -82,12 +74,13 @@ const FeedSidebar: React.FC = () => { )} - {verificationStatus.level === 'verified-basic' && !hasOrdinal && ( -
- - Read-only mode. Acquire Ordinals to post. -
- )} + {verificationStatus.level === 'verified-basic' && + !ordinalDetails && ( +
+ + Read-only mode. Acquire Ordinals to post. +
+ )} )} @@ -158,31 +151,6 @@ const FeedSidebar: React.FC = () => { )} - - {/* Quick Actions */} - {canCreateCell && ( - - - Quick Actions - - - - - - )} - - {/* Create Cell Dialog */} - ); }; diff --git a/src/components/Header.tsx b/src/components/Header.tsx index 14379db..eb4cdd3 100644 --- a/src/components/Header.tsx +++ b/src/components/Header.tsx @@ -13,6 +13,7 @@ import { CircleSlash, Home, Grid3X3, + User, } from 'lucide-react'; import { Tooltip, @@ -177,6 +178,19 @@ const Header = () => { Cells + {isConnected && ( + + + Profile + + )} @@ -196,7 +210,12 @@ const Header = () => { {forum.lastSync && ( - Last updated {new Date(forum.lastSync).toLocaleTimeString([], { hour: '2-digit', minute: '2-digit', second: '2-digit' })} + Last updated{' '} + {new Date(forum.lastSync).toLocaleTimeString([], { + hour: '2-digit', + minute: '2-digit', + second: '2-digit', + })} {forum.isSyncing ? ' • syncing…' : ''} )} diff --git a/src/components/PostDetail.tsx b/src/components/PostDetail.tsx index d4fafce..17e6083 100644 --- a/src/components/PostDetail.tsx +++ b/src/components/PostDetail.tsx @@ -185,7 +185,9 @@ const PostDetail = () => { {postVotePending.isPending && ( - syncing… + + syncing… + )} diff --git a/src/components/examples/HookDemoComponent.tsx b/src/components/examples/HookDemoComponent.tsx index 90e76b1..f8fea2b 100644 --- a/src/components/examples/HookDemoComponent.tsx +++ b/src/components/examples/HookDemoComponent.tsx @@ -1,7 +1,6 @@ import { useForumData, useAuth, - useUserDisplay, useUserVotes, useForumActions, useUserActions, @@ -23,7 +22,6 @@ export function HookDemoComponent() { // Core data hooks - reactive and optimized const forumData = useForumData(); const auth = useAuth(); - const userDisplay = useUserDisplay(auth.currentUser?.address || ''); // Derived hooks for specific data const userVotes = useUserVotes(); @@ -142,17 +140,6 @@ export function HookDemoComponent() { - {userDisplay.badges.length > 0 && ( -
- Badges: - {userDisplay.badges.map((badge, index) => ( - - {badge.icon} {badge.label} - - ))} -
- )} -
+
+ )} + + + + + + {/* Action Buttons */} +
+ {isEditing ? ( + <> + + + + ) : ( + + )} +
+ + + + {/* Wallet Wizard */} + setWalletWizardOpen(false)} + /> + + ); +} diff --git a/src/types/waku.ts b/src/types/waku.ts index 2061f4b..f5d3c96 100644 --- a/src/types/waku.ts +++ b/src/types/waku.ts @@ -1,4 +1,4 @@ -import { EDisplayPreference, EVerificationStatus } from "./identity"; +import { EDisplayPreference, EVerificationStatus } from './identity'; /** * Message types for Waku communication @@ -162,8 +162,8 @@ export interface UserIdentityCache { ordinalDetails: string; }; callSign?: string; - displayPreference: EDisplayPreference + displayPreference: EDisplayPreference; lastUpdated: number; - verificationStatus: EVerificationStatus + verificationStatus: EVerificationStatus; }; }