mirror of
https://github.com/SamyRai/tercul-frontend.git
synced 2025-12-27 00:11:35 +00:00
Plan and analyze missing components for authoring, reading and UI
Adds component analysis reports and implementation plan documents covering missing author and work components, plus core UI elements. Replit-Commit-Author: Agent Replit-Commit-Session-Id: cbacfb18-842a-4116-a907-18c0105ad8ec Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/39b5c689-6e8a-4d5a-9792-69cc81a56534/d1468a00-d93a-40b6-8ef2-3b7ba89b0f76.jpg
This commit is contained in:
parent
ba90a6d705
commit
7859c113fd
384
COMPONENT-ANALYSIS-FINAL.md
Normal file
384
COMPONENT-ANALYSIS-FINAL.md
Normal file
@ -0,0 +1,384 @@
|
|||||||
|
# Component Analysis Report
|
||||||
|
|
||||||
|
## Current Organization
|
||||||
|
|
||||||
|
The project currently has the following component organization:
|
||||||
|
|
||||||
|
- **components/ui/** - Basic UI components (from shadcn)
|
||||||
|
- **components/common/** - Reusable domain components (WorkCard, AuthorChip, LanguageTag, SearchBar)
|
||||||
|
- **components/layout/** - Layout components (PageLayout, DashboardLayout, NavHeader, Footer)
|
||||||
|
- **components/reading/** - Reading experience components (ReadingView, AnnotationSystem, LineNumberedText, etc.)
|
||||||
|
- **components/authors/** - Author-related components (AuthorTimeline)
|
||||||
|
- **components/explore/** - Exploration and discovery components (FilterSidebar)
|
||||||
|
|
||||||
|
## Existing Pages and Required Components
|
||||||
|
|
||||||
|
After reviewing the pages, here are the key features and their required components:
|
||||||
|
|
||||||
|
### Home & Exploration
|
||||||
|
- Home page with featured works
|
||||||
|
- Explore page with filtering
|
||||||
|
- Search page with advanced search functionality
|
||||||
|
|
||||||
|
### Reading Experience
|
||||||
|
- SimpleWorkReading for basic reading
|
||||||
|
- WorkCompare for translation comparison
|
||||||
|
- Annotation system for line-by-line comments
|
||||||
|
- Reading controls for font size, display mode
|
||||||
|
|
||||||
|
### Author Features
|
||||||
|
- Author profiles with timelines
|
||||||
|
- Author listing with filtering
|
||||||
|
- Author statistics and biography display
|
||||||
|
|
||||||
|
### Blog System
|
||||||
|
- Blog listing with previews
|
||||||
|
- Blog post creation with rich text editor
|
||||||
|
- Blog post detail view with comments
|
||||||
|
|
||||||
|
### Collections
|
||||||
|
- Collections listing
|
||||||
|
- Collection creation interface
|
||||||
|
|
||||||
|
### User Features
|
||||||
|
- User profiles with bookmarks, reading history
|
||||||
|
- Submission interface for new works/translations
|
||||||
|
|
||||||
|
### Dashboard
|
||||||
|
- Editorial dashboard with statistics
|
||||||
|
- Blog post management
|
||||||
|
- Work, author, translation management interfaces
|
||||||
|
|
||||||
|
## Missing Author/Work Components (From Additional Page Analysis)
|
||||||
|
|
||||||
|
### Author Components
|
||||||
|
1. **Author Card Grid/List**
|
||||||
|
- Used in Authors.tsx for displaying authors in both grid and list layouts
|
||||||
|
- Needs standardization with consistent styling
|
||||||
|
- Should support filtering and sorting
|
||||||
|
|
||||||
|
2. **Author Filter Controls**
|
||||||
|
- Currently implemented inline in Authors.tsx
|
||||||
|
- Should be extracted into reusable component
|
||||||
|
- Needs consistent styling with other filter controls
|
||||||
|
|
||||||
|
3. **Author Header**
|
||||||
|
- Used in AuthorProfile.tsx
|
||||||
|
- Displays author image, name, bio, and stats
|
||||||
|
- Should be standardized as a component
|
||||||
|
|
||||||
|
4. **Author Works Grid**
|
||||||
|
- Displays works by an author in AuthorProfile.tsx
|
||||||
|
- Should be standardized with filtering and sorting options
|
||||||
|
|
||||||
|
5. **Related Authors Component**
|
||||||
|
- For suggesting similar authors
|
||||||
|
- Currently missing but needed for AuthorProfile.tsx
|
||||||
|
|
||||||
|
6. **Author Statistics Component**
|
||||||
|
- Displays key stats about an author (works, translations, etc.)
|
||||||
|
- Currently implemented inline, should be a component
|
||||||
|
|
||||||
|
### Work Components
|
||||||
|
|
||||||
|
1. **Work Header**
|
||||||
|
- Used in SimpleWorkReading.tsx
|
||||||
|
- Displays work title, author, publication info
|
||||||
|
- Should be standardized as a component
|
||||||
|
|
||||||
|
2. **Translation Selector**
|
||||||
|
- Used in both SimpleWorkReading.tsx and WorkCompare.tsx
|
||||||
|
- Should be improved with better UX
|
||||||
|
- Need consistent styling
|
||||||
|
|
||||||
|
3. **Reading Progress Control**
|
||||||
|
- Track and display reading progress
|
||||||
|
- Save position for resuming later
|
||||||
|
- Currently partially implemented
|
||||||
|
|
||||||
|
4. **Text Display Controls**
|
||||||
|
- Various controls for text appearance (font size, etc.)
|
||||||
|
- Currently in ReadingControls but needs enhancement
|
||||||
|
|
||||||
|
5. **Side-by-Side Comparison View**
|
||||||
|
- Used in WorkCompare.tsx
|
||||||
|
- Needs synchronized scrolling
|
||||||
|
- Should highlight differences
|
||||||
|
|
||||||
|
6. **Work Metadata Display**
|
||||||
|
- Show publication details, genre, etc.
|
||||||
|
- Currently implemented inline, should be component
|
||||||
|
|
||||||
|
7. **Work Actions Menu**
|
||||||
|
- Bookmark, share, like functionality
|
||||||
|
- Should be consistent across reading views
|
||||||
|
|
||||||
|
## Missing Atomic/UI Components
|
||||||
|
|
||||||
|
Based on the todo lists and current implementation, the following atomic and UI components are missing:
|
||||||
|
|
||||||
|
### Missing UI Components (Basic Building Blocks)
|
||||||
|
1. **Typography components**
|
||||||
|
- Heading (h1-h6 variants)
|
||||||
|
- Paragraph with different styling options
|
||||||
|
- Quote/blockquote component
|
||||||
|
- Code block with syntax highlighting
|
||||||
|
- Text with different sizes and weights
|
||||||
|
|
||||||
|
2. **Data Display**
|
||||||
|
- Stat card (currently improvised in Dashboard)
|
||||||
|
- Timeline component (needed for AuthorProfile)
|
||||||
|
- Tree view (for hierarchical data)
|
||||||
|
- Tag cloud (for popular tags visualization)
|
||||||
|
- File viewer (for document previews)
|
||||||
|
- Code syntax highlighter (for code examples in blog posts)
|
||||||
|
- Empty state components (currently improvised)
|
||||||
|
|
||||||
|
3. **Feedback Components**
|
||||||
|
- Empty state (standardized design)
|
||||||
|
- Error state/boundary
|
||||||
|
- Loading spinner (separate from skeleton)
|
||||||
|
- Success/failure indicators
|
||||||
|
- Confirmation dialogs (with clearer UX than alert dialogs)
|
||||||
|
|
||||||
|
4. **Navigation Components**
|
||||||
|
- Stepper for multi-step forms (needed for submission process)
|
||||||
|
- Vertical navigation (for section navigation)
|
||||||
|
- Breadcrumbs (for deep navigation)
|
||||||
|
- Trail/path navigation
|
||||||
|
|
||||||
|
5. **Form Components**
|
||||||
|
- Rich text editor (currently only has toolbar mockup in BlogCreate)
|
||||||
|
- Tag input (currently improvised in BlogCreate)
|
||||||
|
- Date range picker
|
||||||
|
- File uploader with preview
|
||||||
|
- Multi-select with chips
|
||||||
|
- Autocomplete with highlighting
|
||||||
|
- Form wizard (for multi-step forms)
|
||||||
|
|
||||||
|
6. **Layout Components**
|
||||||
|
- Grid system component
|
||||||
|
- Masonry layout (for varying height items)
|
||||||
|
- Split pane (for side-by-side comparison)
|
||||||
|
- Spotlight container (for featured content)
|
||||||
|
- Responsive container with breakpoints
|
||||||
|
|
||||||
|
7. **Specialized Components**
|
||||||
|
- Color picker (for theming)
|
||||||
|
- Rating component
|
||||||
|
- Comparison slider (before/after)
|
||||||
|
- Share button group
|
||||||
|
- Expandable search
|
||||||
|
- Notification badge/bell
|
||||||
|
|
||||||
|
### Missing Feature Components
|
||||||
|
|
||||||
|
1. **Dashboard Components**
|
||||||
|
- Stats card grid (standardized)
|
||||||
|
- Activity feed
|
||||||
|
- Content approval queue
|
||||||
|
- Stats charts and graphs
|
||||||
|
- Dashboard header with actions
|
||||||
|
- User role badge/indicator
|
||||||
|
|
||||||
|
2. **Blog Components**
|
||||||
|
- Blog editor (full-featured)
|
||||||
|
- Blog preview card (standardized)
|
||||||
|
- Tag manager (reusable)
|
||||||
|
- Publication scheduler
|
||||||
|
- Featured post highlighter
|
||||||
|
- Blog post metadata editor
|
||||||
|
- Comment moderation interface
|
||||||
|
|
||||||
|
3. **Work Management Components**
|
||||||
|
- Work editor
|
||||||
|
- Text content editor with line numbers
|
||||||
|
- Work status badge/indicator
|
||||||
|
- Related works grid
|
||||||
|
- Translation manager
|
||||||
|
- Work metadata editor
|
||||||
|
|
||||||
|
4. **Author Components**
|
||||||
|
- Author editor
|
||||||
|
- Timeline event editor
|
||||||
|
- Author profile card (standardized)
|
||||||
|
- Author stats display
|
||||||
|
- Works by author grid
|
||||||
|
- Author filtering system
|
||||||
|
- Related authors component
|
||||||
|
|
||||||
|
5. **Comment Components**
|
||||||
|
- Comment thread (hierarchical)
|
||||||
|
- Comment editor
|
||||||
|
- Moderation tools
|
||||||
|
- Comment filters
|
||||||
|
- User profile link in comments
|
||||||
|
|
||||||
|
6. **Annotation Components**
|
||||||
|
- Annotation editor
|
||||||
|
- Annotation reviewer
|
||||||
|
- Inline annotation form
|
||||||
|
- Annotation browser
|
||||||
|
- Annotation filtering system
|
||||||
|
|
||||||
|
7. **Reading Experience Components**
|
||||||
|
- Side-by-side comparison with sync
|
||||||
|
- Reading position tracker
|
||||||
|
- Advanced reading controls
|
||||||
|
- Font customization panel
|
||||||
|
- Theme selector for reading
|
||||||
|
- Dictionary/reference lookup
|
||||||
|
|
||||||
|
8. **User Components**
|
||||||
|
- User profile card
|
||||||
|
- User avatar with status
|
||||||
|
- Reading progress indicator
|
||||||
|
- Bookmarks manager
|
||||||
|
- User preferences form
|
||||||
|
|
||||||
|
9. **Search Components**
|
||||||
|
- Advanced search form
|
||||||
|
- Search filters panel (more standardized)
|
||||||
|
- Search results grid/list toggle
|
||||||
|
- Pagination controls (unified design)
|
||||||
|
- Sort controls
|
||||||
|
|
||||||
|
## Components Identified in Pages but Missing in Component Folders
|
||||||
|
|
||||||
|
1. **From BlogCreate.tsx**
|
||||||
|
- EditorToolbar (should be a standalone component)
|
||||||
|
- TagSelector (currently inline, should be a component)
|
||||||
|
- PublishToggle (could be a reusable component)
|
||||||
|
|
||||||
|
2. **From Dashboard.tsx**
|
||||||
|
- StatCard (should be standardized)
|
||||||
|
- QuickActionButton (could be a reusable component)
|
||||||
|
- ContentPreviewItem (used for recent works)
|
||||||
|
|
||||||
|
3. **From Profile.tsx**
|
||||||
|
- ProfileHeader (should be a component)
|
||||||
|
- UserStats (could be a component)
|
||||||
|
- EmptyStateCard (should be standardized)
|
||||||
|
|
||||||
|
4. **From Authors.tsx**
|
||||||
|
- AuthorFilters (should be a component)
|
||||||
|
- AuthorGrid/AuthorList (should be standardized)
|
||||||
|
- AuthorCard (extracted from inline implementations)
|
||||||
|
|
||||||
|
5. **From AuthorProfile.tsx**
|
||||||
|
- AuthorHeader (should be a component)
|
||||||
|
- WorksByAuthor (should be a component)
|
||||||
|
- AuthorStats (should be a component)
|
||||||
|
- RelatedAuthors (should be created)
|
||||||
|
|
||||||
|
6. **From SimpleWorkReading.tsx and WorkCompare.tsx**
|
||||||
|
- WorkHeader (should be a component)
|
||||||
|
- TranslationSelector (should be improved)
|
||||||
|
- ReadingViewSwitcher (should be a component)
|
||||||
|
- ReadingProgressTracker (should be a component)
|
||||||
|
|
||||||
|
## Reorganization Recommendations
|
||||||
|
|
||||||
|
### Components to Move
|
||||||
|
|
||||||
|
1. **From common/ to ui/**
|
||||||
|
- LanguageTag.tsx (generic tag pattern, should be a UI component)
|
||||||
|
|
||||||
|
2. **Create domain-specific folders**
|
||||||
|
- **components/blog/** - All blog-related components
|
||||||
|
- BlogPreview
|
||||||
|
- BlogEditor
|
||||||
|
- CommentSection
|
||||||
|
- **components/dashboard/** - Dashboard-specific components
|
||||||
|
- StatCard
|
||||||
|
- ActivityFeed
|
||||||
|
- QuickActions
|
||||||
|
- **components/work/** - Work management components
|
||||||
|
- WorkEditor
|
||||||
|
- WorkMetadata
|
||||||
|
- WorkStatus
|
||||||
|
- WorkHeader
|
||||||
|
- WorkActions
|
||||||
|
- **components/annotation/** - Annotation-specific components (move from reading/)
|
||||||
|
- AnnotationEditor
|
||||||
|
- AnnotationBrowser
|
||||||
|
- **components/comment/** - Comment system components
|
||||||
|
- CommentThread
|
||||||
|
- CommentEditor
|
||||||
|
- **components/user/** - User-related components
|
||||||
|
- UserProfile
|
||||||
|
- UserStats
|
||||||
|
- UserPreferences
|
||||||
|
- **components/search/** - Search-related components
|
||||||
|
- SearchFilters
|
||||||
|
- SearchResults
|
||||||
|
- SortControls
|
||||||
|
|
||||||
|
3. **Create patterns folder for complex component patterns**
|
||||||
|
- **components/patterns/** - For compound components
|
||||||
|
- FilterControls (standardized pattern for all filters)
|
||||||
|
- ModalForms
|
||||||
|
- EmptyStates (standardized)
|
||||||
|
- ActionToolbars
|
||||||
|
- CardGrids (standardized grid layouts)
|
||||||
|
|
||||||
|
### Component Development Priorities
|
||||||
|
|
||||||
|
Based on the todo lists and review of existing pages, the following components should be developed first:
|
||||||
|
|
||||||
|
1. **Rich Text Editor** - Essential for blog post creation and editing
|
||||||
|
- With proper formatting controls
|
||||||
|
- Image upload support
|
||||||
|
- Markdown support
|
||||||
|
|
||||||
|
2. **Dashboard Components** - For editorial management
|
||||||
|
- Standardized StatCard
|
||||||
|
- Content management tables
|
||||||
|
- Action menus with proper permissions
|
||||||
|
|
||||||
|
3. **Author Components** - For author management
|
||||||
|
- AuthorCard (standardized)
|
||||||
|
- AuthorHeader
|
||||||
|
- Author filtering
|
||||||
|
|
||||||
|
4. **Work Reading Components** - For improved reading experience
|
||||||
|
- WorkHeader
|
||||||
|
- Enhanced TranslationSelector
|
||||||
|
- Side-by-side comparison with sync
|
||||||
|
|
||||||
|
5. **Comment System** - For user engagement
|
||||||
|
- Thread view
|
||||||
|
- Moderation tools
|
||||||
|
- User context
|
||||||
|
|
||||||
|
## Implementation Recommendations
|
||||||
|
|
||||||
|
1. **Create Component Templates**
|
||||||
|
- Develop standardized templates for new components
|
||||||
|
- Include prop definitions, stories, and tests
|
||||||
|
|
||||||
|
2. **Implement Component Documentation**
|
||||||
|
- Add JSDoc comments to all components
|
||||||
|
- Consider using Storybook for component documentation
|
||||||
|
|
||||||
|
3. **Standardize Component Patterns**
|
||||||
|
- Form components should follow a consistent pattern
|
||||||
|
- List/table components should have consistent filtering and pagination
|
||||||
|
- Modal/dialog components should have consistent behavior
|
||||||
|
|
||||||
|
4. **Accessibility Focus**
|
||||||
|
- Ensure all components have proper ARIA attributes
|
||||||
|
- Add keyboard navigation support
|
||||||
|
- Test components with screen readers
|
||||||
|
|
||||||
|
5. **Theme Integration**
|
||||||
|
- Ensure all new components support the seasonal theme system
|
||||||
|
- Components should have light/dark mode variants
|
||||||
|
|
||||||
|
## Next Steps
|
||||||
|
|
||||||
|
1. Create the missing UI components in the ui/ folder
|
||||||
|
2. Reorganize existing components into the recommended folder structure
|
||||||
|
3. Develop the high-priority feature components
|
||||||
|
4. Establish component documentation and standards
|
||||||
|
5. Implement the dashboard management pages with proper components
|
||||||
290
COMPONENT-ANALYSIS-UPDATED.md
Normal file
290
COMPONENT-ANALYSIS-UPDATED.md
Normal file
@ -0,0 +1,290 @@
|
|||||||
|
# Component Analysis Report
|
||||||
|
|
||||||
|
## Current Organization
|
||||||
|
|
||||||
|
The project currently has the following component organization:
|
||||||
|
|
||||||
|
- **components/ui/** - Basic UI components (from shadcn)
|
||||||
|
- **components/common/** - Reusable domain components (WorkCard, AuthorChip, LanguageTag, SearchBar)
|
||||||
|
- **components/layout/** - Layout components (PageLayout, DashboardLayout, NavHeader, Footer)
|
||||||
|
- **components/reading/** - Reading experience components (ReadingView, AnnotationSystem, LineNumberedText, etc.)
|
||||||
|
- **components/authors/** - Author-related components (AuthorTimeline)
|
||||||
|
- **components/explore/** - Exploration and discovery components (FilterSidebar)
|
||||||
|
|
||||||
|
## Existing Pages and Required Components
|
||||||
|
|
||||||
|
After reviewing the pages, here are the key features and their required components:
|
||||||
|
|
||||||
|
### Home & Exploration
|
||||||
|
- Home page with featured works
|
||||||
|
- Explore page with filtering
|
||||||
|
- Search page with advanced search functionality
|
||||||
|
|
||||||
|
### Reading Experience
|
||||||
|
- SimpleWorkReading for basic reading
|
||||||
|
- WorkCompare for translation comparison
|
||||||
|
- Annotation system for line-by-line comments
|
||||||
|
- Reading controls for font size, display mode
|
||||||
|
|
||||||
|
### Author Features
|
||||||
|
- Author profiles with timelines
|
||||||
|
- Author listing with filtering
|
||||||
|
|
||||||
|
### Blog System
|
||||||
|
- Blog listing with previews
|
||||||
|
- Blog post creation with rich text editor
|
||||||
|
- Blog post detail view with comments
|
||||||
|
|
||||||
|
### Collections
|
||||||
|
- Collections listing
|
||||||
|
- Collection creation interface
|
||||||
|
|
||||||
|
### User Features
|
||||||
|
- User profiles with bookmarks, reading history
|
||||||
|
- Submission interface for new works/translations
|
||||||
|
|
||||||
|
### Dashboard
|
||||||
|
- Editorial dashboard with statistics
|
||||||
|
- Blog post management
|
||||||
|
- Work, author, translation management interfaces
|
||||||
|
|
||||||
|
## Missing Atomic/UI Components
|
||||||
|
|
||||||
|
Based on the todo lists and current implementation, the following atomic and UI components are missing:
|
||||||
|
|
||||||
|
### Missing UI Components (Basic Building Blocks)
|
||||||
|
1. **Typography components**
|
||||||
|
- Heading (h1-h6 variants)
|
||||||
|
- Paragraph with different styling options
|
||||||
|
- Quote/blockquote component
|
||||||
|
- Code block with syntax highlighting
|
||||||
|
- Text with different sizes and weights
|
||||||
|
|
||||||
|
2. **Data Display**
|
||||||
|
- Stat card (currently improvised in Dashboard)
|
||||||
|
- Timeline component (needed for AuthorProfile)
|
||||||
|
- Tree view (for hierarchical data)
|
||||||
|
- Tag cloud (for popular tags visualization)
|
||||||
|
- File viewer (for document previews)
|
||||||
|
- Code syntax highlighter (for code examples in blog posts)
|
||||||
|
- Empty state components (currently improvised)
|
||||||
|
|
||||||
|
3. **Feedback Components**
|
||||||
|
- Empty state (standardized design)
|
||||||
|
- Error state/boundary
|
||||||
|
- Loading spinner (separate from skeleton)
|
||||||
|
- Success/failure indicators
|
||||||
|
- Confirmation dialogs (with clearer UX than alert dialogs)
|
||||||
|
|
||||||
|
4. **Navigation Components**
|
||||||
|
- Stepper for multi-step forms (needed for submission process)
|
||||||
|
- Vertical navigation (for section navigation)
|
||||||
|
- Breadcrumbs (for deep navigation)
|
||||||
|
- Trail/path navigation
|
||||||
|
|
||||||
|
5. **Form Components**
|
||||||
|
- Rich text editor (currently only has toolbar mockup in BlogCreate)
|
||||||
|
- Tag input (currently improvised in BlogCreate)
|
||||||
|
- Date range picker
|
||||||
|
- File uploader with preview
|
||||||
|
- Multi-select with chips
|
||||||
|
- Autocomplete with highlighting
|
||||||
|
- Form wizard (for multi-step forms)
|
||||||
|
|
||||||
|
6. **Layout Components**
|
||||||
|
- Grid system component
|
||||||
|
- Masonry layout (for varying height items)
|
||||||
|
- Split pane (for side-by-side comparison)
|
||||||
|
- Spotlight container (for featured content)
|
||||||
|
- Responsive container with breakpoints
|
||||||
|
|
||||||
|
7. **Specialized Components**
|
||||||
|
- Color picker (for theming)
|
||||||
|
- Rating component
|
||||||
|
- Comparison slider (before/after)
|
||||||
|
- Share button group
|
||||||
|
- Expandable search
|
||||||
|
- Notification badge/bell
|
||||||
|
|
||||||
|
### Missing Feature Components
|
||||||
|
|
||||||
|
1. **Dashboard Components**
|
||||||
|
- Stats card grid (standardized)
|
||||||
|
- Activity feed
|
||||||
|
- Content approval queue
|
||||||
|
- Stats charts and graphs
|
||||||
|
- Dashboard header with actions
|
||||||
|
- User role badge/indicator
|
||||||
|
|
||||||
|
2. **Blog Components**
|
||||||
|
- Blog editor (full-featured)
|
||||||
|
- Blog preview card (standardized)
|
||||||
|
- Tag manager (reusable)
|
||||||
|
- Publication scheduler
|
||||||
|
- Featured post highlighter
|
||||||
|
- Blog post metadata editor
|
||||||
|
- Comment moderation interface
|
||||||
|
|
||||||
|
3. **Work Management Components**
|
||||||
|
- Work editor
|
||||||
|
- Text content editor with line numbers
|
||||||
|
- Work status badge/indicator
|
||||||
|
- Related works grid
|
||||||
|
- Translation manager
|
||||||
|
- Work metadata editor
|
||||||
|
|
||||||
|
4. **Author Components**
|
||||||
|
- Author editor
|
||||||
|
- Timeline event editor
|
||||||
|
- Author profile card (standardized)
|
||||||
|
- Author stats display
|
||||||
|
- Works by author grid
|
||||||
|
|
||||||
|
5. **Comment Components**
|
||||||
|
- Comment thread (hierarchical)
|
||||||
|
- Comment editor
|
||||||
|
- Moderation tools
|
||||||
|
- Comment filters
|
||||||
|
- User profile link in comments
|
||||||
|
|
||||||
|
6. **Annotation Components**
|
||||||
|
- Annotation editor
|
||||||
|
- Annotation reviewer
|
||||||
|
- Inline annotation form
|
||||||
|
- Annotation browser
|
||||||
|
- Annotation filtering system
|
||||||
|
|
||||||
|
7. **User Components**
|
||||||
|
- User profile card
|
||||||
|
- User avatar with status
|
||||||
|
- Reading progress indicator
|
||||||
|
- Bookmarks manager
|
||||||
|
- User preferences form
|
||||||
|
|
||||||
|
8. **Search Components**
|
||||||
|
- Advanced search form
|
||||||
|
- Search filters panel (more standardized)
|
||||||
|
- Search results grid/list toggle
|
||||||
|
- Pagination controls (unified design)
|
||||||
|
- Sort controls
|
||||||
|
|
||||||
|
## Components Identified in Pages but Missing in Component Folders
|
||||||
|
|
||||||
|
1. **From BlogCreate.tsx**
|
||||||
|
- EditorToolbar (should be a standalone component)
|
||||||
|
- TagSelector (currently inline, should be a component)
|
||||||
|
- PublishToggle (could be a reusable component)
|
||||||
|
|
||||||
|
2. **From Dashboard.tsx**
|
||||||
|
- StatCard (should be standardized)
|
||||||
|
- QuickActionButton (could be a reusable component)
|
||||||
|
- ContentPreviewItem (used for recent works)
|
||||||
|
|
||||||
|
3. **From Profile.tsx**
|
||||||
|
- ProfileHeader (should be a component)
|
||||||
|
- UserStats (could be a component)
|
||||||
|
- EmptyStateCard (should be standardized)
|
||||||
|
|
||||||
|
4. **From ReadingControls.tsx**
|
||||||
|
- FontSizeControls (could be a standalone component)
|
||||||
|
- ReadingModeToggle (could be a component)
|
||||||
|
- ActionButtonGroup (share, like, etc.)
|
||||||
|
|
||||||
|
## Reorganization Recommendations
|
||||||
|
|
||||||
|
### Components to Move
|
||||||
|
|
||||||
|
1. **From common/ to ui/**
|
||||||
|
- LanguageTag.tsx (generic tag pattern, should be a UI component)
|
||||||
|
|
||||||
|
2. **Create domain-specific folders**
|
||||||
|
- **components/blog/** - All blog-related components
|
||||||
|
- BlogPreview
|
||||||
|
- BlogEditor
|
||||||
|
- CommentSection
|
||||||
|
- **components/dashboard/** - Dashboard-specific components
|
||||||
|
- StatCard
|
||||||
|
- ActivityFeed
|
||||||
|
- QuickActions
|
||||||
|
- **components/work/** - Work management components
|
||||||
|
- WorkEditor
|
||||||
|
- WorkMetadata
|
||||||
|
- WorkStatus
|
||||||
|
- **components/annotation/** - Annotation-specific components (move from reading/)
|
||||||
|
- AnnotationEditor
|
||||||
|
- AnnotationBrowser
|
||||||
|
- **components/comment/** - Comment system components
|
||||||
|
- CommentThread
|
||||||
|
- CommentEditor
|
||||||
|
- **components/user/** - User-related components
|
||||||
|
- UserProfile
|
||||||
|
- UserStats
|
||||||
|
- UserPreferences
|
||||||
|
|
||||||
|
3. **Create patterns folder for complex component patterns**
|
||||||
|
- **components/patterns/** - For compound components
|
||||||
|
- SearchFilters (from FilterSidebar)
|
||||||
|
- ModalForms
|
||||||
|
- EmptyStates (standardized)
|
||||||
|
- ActionToolbars
|
||||||
|
|
||||||
|
### Component Development Priorities
|
||||||
|
|
||||||
|
Based on the todo lists and review of existing pages, the following components should be developed first:
|
||||||
|
|
||||||
|
1. **Rich Text Editor** - Essential for blog post creation and editing
|
||||||
|
- With proper formatting controls
|
||||||
|
- Image upload support
|
||||||
|
- Markdown support
|
||||||
|
|
||||||
|
2. **Dashboard Components** - For editorial management
|
||||||
|
- Standardized StatCard
|
||||||
|
- Content management tables
|
||||||
|
- Action menus with proper permissions
|
||||||
|
|
||||||
|
3. **Work Editor** - For creating/editing literary works
|
||||||
|
- With line numbering
|
||||||
|
- Version comparison
|
||||||
|
- Metadata editor
|
||||||
|
|
||||||
|
4. **Comment System** - For user engagement
|
||||||
|
- Thread view
|
||||||
|
- Moderation tools
|
||||||
|
- User context
|
||||||
|
|
||||||
|
5. **User Profile Components** - For user management
|
||||||
|
- Profile editor
|
||||||
|
- Stats visualization
|
||||||
|
- Activity history
|
||||||
|
|
||||||
|
## Implementation Recommendations
|
||||||
|
|
||||||
|
1. **Create Component Templates**
|
||||||
|
- Develop standardized templates for new components
|
||||||
|
- Include prop definitions, stories, and tests
|
||||||
|
|
||||||
|
2. **Implement Component Documentation**
|
||||||
|
- Add JSDoc comments to all components
|
||||||
|
- Consider using Storybook for component documentation
|
||||||
|
|
||||||
|
3. **Standardize Component Patterns**
|
||||||
|
- Form components should follow a consistent pattern
|
||||||
|
- List/table components should have consistent filtering and pagination
|
||||||
|
- Modal/dialog components should have consistent behavior
|
||||||
|
|
||||||
|
4. **Accessibility Focus**
|
||||||
|
- Ensure all components have proper ARIA attributes
|
||||||
|
- Add keyboard navigation support
|
||||||
|
- Test components with screen readers
|
||||||
|
|
||||||
|
5. **Theme Integration**
|
||||||
|
- Ensure all new components support the seasonal theme system
|
||||||
|
- Components should have light/dark mode variants
|
||||||
|
|
||||||
|
## Next Steps
|
||||||
|
|
||||||
|
1. Create the missing UI components in the ui/ folder
|
||||||
|
2. Reorganize existing components into the recommended folder structure
|
||||||
|
3. Develop the high-priority feature components
|
||||||
|
4. Establish component documentation and standards
|
||||||
|
5. Implement the dashboard management pages with proper components
|
||||||
346
COMPONENT-IMPLEMENTATION-PLAN.md
Normal file
346
COMPONENT-IMPLEMENTATION-PLAN.md
Normal file
@ -0,0 +1,346 @@
|
|||||||
|
# Component Implementation Plan for Tercul Platform
|
||||||
|
|
||||||
|
This document outlines a prioritized plan for implementing the missing components identified in the component analysis.
|
||||||
|
|
||||||
|
## Phase 1: Critical UI Components
|
||||||
|
|
||||||
|
### Rich Text Editor
|
||||||
|
**Priority: High**
|
||||||
|
**Target folder:** `components/ui/rich-text-editor.tsx`
|
||||||
|
|
||||||
|
This component is essential for blog post creation/editing and content management.
|
||||||
|
|
||||||
|
Features to implement:
|
||||||
|
- Basic formatting (bold, italic, underline)
|
||||||
|
- Headings (h1-h6)
|
||||||
|
- Lists (ordered, unordered)
|
||||||
|
- Links
|
||||||
|
- Image embedding
|
||||||
|
- Markdown support
|
||||||
|
- Preview mode
|
||||||
|
|
||||||
|
Implementation approach:
|
||||||
|
1. Evaluate existing libraries (TipTap, Slate, etc.)
|
||||||
|
2. Implement with shadcn UI styling
|
||||||
|
3. Create toolbar component
|
||||||
|
4. Add content parser/renderer
|
||||||
|
5. Implement preview functionality
|
||||||
|
|
||||||
|
### Stat Card
|
||||||
|
**Priority: High**
|
||||||
|
**Target folder:** `components/ui/stat-card.tsx`
|
||||||
|
|
||||||
|
Needed for dashboard statistics display.
|
||||||
|
|
||||||
|
Features to implement:
|
||||||
|
- Title and description
|
||||||
|
- Value display
|
||||||
|
- Icon support
|
||||||
|
- Trend indicator (up/down)
|
||||||
|
- Comparison to previous period
|
||||||
|
- Loading state
|
||||||
|
|
||||||
|
Implementation approach:
|
||||||
|
1. Extract from Dashboard.tsx
|
||||||
|
2. Create standardized component
|
||||||
|
3. Support theme variants
|
||||||
|
4. Add animation options
|
||||||
|
|
||||||
|
### Empty State
|
||||||
|
**Priority: High**
|
||||||
|
**Target folder:** `components/ui/empty-state.tsx`
|
||||||
|
|
||||||
|
Used throughout the application to show when data is missing.
|
||||||
|
|
||||||
|
Features to implement:
|
||||||
|
- Icon display
|
||||||
|
- Title and description
|
||||||
|
- Optional action button
|
||||||
|
- Customizable appearance
|
||||||
|
- Size variants
|
||||||
|
|
||||||
|
Implementation approach:
|
||||||
|
1. Extract patterns from existing pages
|
||||||
|
2. Create standardized component
|
||||||
|
3. Support different contexts (empty list, no search results, etc.)
|
||||||
|
|
||||||
|
### Tag Input
|
||||||
|
**Priority: High**
|
||||||
|
**Target folder:** `components/ui/tag-input.tsx`
|
||||||
|
|
||||||
|
Used for blog post tags, work metadata, and filtering.
|
||||||
|
|
||||||
|
Features to implement:
|
||||||
|
- Add tags by typing
|
||||||
|
- Tag selection from existing options
|
||||||
|
- Tag removal
|
||||||
|
- Validation
|
||||||
|
- Limit maximum tags
|
||||||
|
|
||||||
|
Implementation approach:
|
||||||
|
1. Extract from BlogCreate.tsx
|
||||||
|
2. Create reusable component
|
||||||
|
3. Add autocomplete functionality
|
||||||
|
4. Support controlled and uncontrolled modes
|
||||||
|
|
||||||
|
## Phase 2: Dashboard Components
|
||||||
|
|
||||||
|
### Data Table with Actions
|
||||||
|
**Priority: High**
|
||||||
|
**Target folder:** `components/dashboard/data-table.tsx`
|
||||||
|
|
||||||
|
Core component for all dashboard management pages.
|
||||||
|
|
||||||
|
Features to implement:
|
||||||
|
- Sortable columns
|
||||||
|
- Filtering
|
||||||
|
- Pagination
|
||||||
|
- Row selection
|
||||||
|
- Action menu
|
||||||
|
- Bulk actions
|
||||||
|
- Loading states
|
||||||
|
- Empty states
|
||||||
|
|
||||||
|
Implementation approach:
|
||||||
|
1. Extend shadcn table components
|
||||||
|
2. Add consistent action patterns
|
||||||
|
3. Implement with shadcn styling
|
||||||
|
4. Create reusable filters
|
||||||
|
|
||||||
|
### Dashboard Header
|
||||||
|
**Priority: Medium**
|
||||||
|
**Target folder:** `components/dashboard/dashboard-header.tsx`
|
||||||
|
|
||||||
|
Consistent header for all dashboard pages.
|
||||||
|
|
||||||
|
Features to implement:
|
||||||
|
- Title and description
|
||||||
|
- Action buttons
|
||||||
|
- Breadcrumbs
|
||||||
|
- Back navigation
|
||||||
|
- Quick filters
|
||||||
|
|
||||||
|
Implementation approach:
|
||||||
|
1. Extract patterns from existing dashboard pages
|
||||||
|
2. Create standardized component
|
||||||
|
3. Support different contexts and permissions
|
||||||
|
|
||||||
|
### Activity Feed
|
||||||
|
**Priority: Medium**
|
||||||
|
**Target folder:** `components/dashboard/activity-feed.tsx`
|
||||||
|
|
||||||
|
For showing recent activity in the dashboard.
|
||||||
|
|
||||||
|
Features to implement:
|
||||||
|
- Activity items with icons
|
||||||
|
- User attribution
|
||||||
|
- Timestamp
|
||||||
|
- Activity types
|
||||||
|
- Loading state
|
||||||
|
- Empty state
|
||||||
|
|
||||||
|
Implementation approach:
|
||||||
|
1. Design consistent item layout
|
||||||
|
2. Support different activity types
|
||||||
|
3. Implement virtual scrolling for performance
|
||||||
|
|
||||||
|
## Phase 3: User Experience Components
|
||||||
|
|
||||||
|
### Comment Thread
|
||||||
|
**Priority: Medium**
|
||||||
|
**Target folder:** `components/comment/comment-thread.tsx`
|
||||||
|
|
||||||
|
For discussions on works, blog posts, etc.
|
||||||
|
|
||||||
|
Features to implement:
|
||||||
|
- Nested comments
|
||||||
|
- User information
|
||||||
|
- Timestamps
|
||||||
|
- Voting/liking
|
||||||
|
- Reply functionality
|
||||||
|
- Moderation tools
|
||||||
|
- Loading states
|
||||||
|
|
||||||
|
Implementation approach:
|
||||||
|
1. Design threaded comments UI
|
||||||
|
2. Handle nested data structure
|
||||||
|
3. Add moderation capabilities based on user role
|
||||||
|
|
||||||
|
### User Profile Card
|
||||||
|
**Priority: Medium**
|
||||||
|
**Target folder:** `components/user/profile-card.tsx`
|
||||||
|
|
||||||
|
For displaying user information consistently.
|
||||||
|
|
||||||
|
Features to implement:
|
||||||
|
- Avatar
|
||||||
|
- User name and handle
|
||||||
|
- Role badge
|
||||||
|
- Stats summary
|
||||||
|
- Action buttons
|
||||||
|
- Size variants
|
||||||
|
|
||||||
|
Implementation approach:
|
||||||
|
1. Extract patterns from Profile.tsx
|
||||||
|
2. Create standardized component
|
||||||
|
3. Support different contexts (dashboard, comments, etc.)
|
||||||
|
|
||||||
|
### Work Preview
|
||||||
|
**Priority: Medium**
|
||||||
|
**Target folder:** `components/work/work-preview.tsx`
|
||||||
|
|
||||||
|
For consistent display of works in lists and grids.
|
||||||
|
|
||||||
|
Features to implement:
|
||||||
|
- Title and author
|
||||||
|
- Publication info
|
||||||
|
- Tags
|
||||||
|
- Preview snippet
|
||||||
|
- Action menu
|
||||||
|
- Size variants
|
||||||
|
|
||||||
|
Implementation approach:
|
||||||
|
1. Standardize from WorkCard component
|
||||||
|
2. Add variants for different contexts
|
||||||
|
3. Support loading and error states
|
||||||
|
|
||||||
|
## Phase 4: Editorial Components
|
||||||
|
|
||||||
|
### Publication Scheduler
|
||||||
|
**Priority: Medium**
|
||||||
|
**Target folder:** `components/blog/publication-scheduler.tsx`
|
||||||
|
|
||||||
|
For scheduling content publication.
|
||||||
|
|
||||||
|
Features to implement:
|
||||||
|
- Date and time selection
|
||||||
|
- Time zone handling
|
||||||
|
- Preview of scheduled time
|
||||||
|
- Status indicator
|
||||||
|
|
||||||
|
Implementation approach:
|
||||||
|
1. Create date/time picker with validation
|
||||||
|
2. Add status visualization
|
||||||
|
3. Handle scheduling logic
|
||||||
|
|
||||||
|
### Work Editor
|
||||||
|
**Priority: High**
|
||||||
|
**Target folder:** `components/work/work-editor.tsx`
|
||||||
|
|
||||||
|
For creating and editing literary works.
|
||||||
|
|
||||||
|
Features to implement:
|
||||||
|
- Line-numbered text editing
|
||||||
|
- Syntax highlighting for poetry
|
||||||
|
- Metadata editor
|
||||||
|
- Translation alignment
|
||||||
|
- Version comparison
|
||||||
|
|
||||||
|
Implementation approach:
|
||||||
|
1. Create specialized text editor
|
||||||
|
2. Add line numbering and navigation
|
||||||
|
3. Implement metadata form
|
||||||
|
4. Support translations
|
||||||
|
|
||||||
|
### Author Editor
|
||||||
|
**Priority: Medium**
|
||||||
|
**Target folder:** `components/author/author-editor.tsx`
|
||||||
|
|
||||||
|
For creating and editing author profiles.
|
||||||
|
|
||||||
|
Features to implement:
|
||||||
|
- Author details form
|
||||||
|
- Timeline event management
|
||||||
|
- Works association
|
||||||
|
- Image upload
|
||||||
|
|
||||||
|
Implementation approach:
|
||||||
|
1. Create form component
|
||||||
|
2. Add timeline event editor
|
||||||
|
3. Implement work selection
|
||||||
|
4. Add image upload and cropping
|
||||||
|
|
||||||
|
## Phase 5: Advanced UI Components
|
||||||
|
|
||||||
|
### Timeline
|
||||||
|
**Priority: Low**
|
||||||
|
**Target folder:** `components/ui/timeline.tsx`
|
||||||
|
|
||||||
|
For displaying chronological events.
|
||||||
|
|
||||||
|
Features to implement:
|
||||||
|
- Vertical/horizontal layout
|
||||||
|
- Event nodes
|
||||||
|
- Connectors
|
||||||
|
- Date display
|
||||||
|
- Interactive events
|
||||||
|
|
||||||
|
Implementation approach:
|
||||||
|
1. Create base timeline component
|
||||||
|
2. Add event rendering
|
||||||
|
3. Support interactive features
|
||||||
|
|
||||||
|
### File Uploader
|
||||||
|
**Priority: Medium**
|
||||||
|
**Target folder:** `components/ui/file-uploader.tsx`
|
||||||
|
|
||||||
|
For uploading images and documents.
|
||||||
|
|
||||||
|
Features to implement:
|
||||||
|
- Drag and drop
|
||||||
|
- File selection
|
||||||
|
- Progress indicator
|
||||||
|
- Preview
|
||||||
|
- Validation
|
||||||
|
- Error handling
|
||||||
|
|
||||||
|
Implementation approach:
|
||||||
|
1. Create upload component
|
||||||
|
2. Add drag-drop functionality
|
||||||
|
3. Implement preview rendering
|
||||||
|
4. Add validation and error handling
|
||||||
|
|
||||||
|
### Comparison Slider
|
||||||
|
**Priority: Low**
|
||||||
|
**Target folder:** `components/ui/comparison-slider.tsx`
|
||||||
|
|
||||||
|
For comparing translations or versions.
|
||||||
|
|
||||||
|
Features to implement:
|
||||||
|
- Side-by-side view
|
||||||
|
- Draggable divider
|
||||||
|
- Synchronized scrolling
|
||||||
|
- Highlighting differences
|
||||||
|
|
||||||
|
Implementation approach:
|
||||||
|
1. Create slider component
|
||||||
|
2. Implement dragging behavior
|
||||||
|
3. Add content synchronization
|
||||||
|
|
||||||
|
## Implementation Timeline
|
||||||
|
|
||||||
|
### Week 1: Critical UI Components
|
||||||
|
- Rich Text Editor
|
||||||
|
- Stat Card
|
||||||
|
- Empty State
|
||||||
|
- Tag Input
|
||||||
|
|
||||||
|
### Week 2: Dashboard Components
|
||||||
|
- Data Table with Actions
|
||||||
|
- Dashboard Header
|
||||||
|
- Work Preview standardization
|
||||||
|
|
||||||
|
### Week 3: User Experience Components
|
||||||
|
- Comment Thread
|
||||||
|
- User Profile Card
|
||||||
|
- Publication Scheduler
|
||||||
|
|
||||||
|
### Week 4: Editorial Components
|
||||||
|
- Work Editor
|
||||||
|
- Author Editor
|
||||||
|
- File Uploader
|
||||||
|
|
||||||
|
### Week 5: Advanced UI Components
|
||||||
|
- Timeline
|
||||||
|
- Comparison Slider
|
||||||
|
- Remaining UI improvements
|
||||||
Loading…
Reference in New Issue
Block a user