-
Notifications
You must be signed in to change notification settings - Fork 28
Fix cleanup_unsubmitted_forms issues and add UI component breakdown #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Scecil044
wants to merge
2
commits into
vula-africa:main
Choose a base branch
from
Scecil044:fix/cleanup-unsubmitted-forms
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,117 @@ | ||
| # Portfolio Overview - Component Breakdown | ||
|
|
||
| ## Component Hierarchy | ||
|
|
||
| ``` | ||
| PortfolioOverviewPage | ||
| ├── Header | ||
| │ ├── PageTitle | ||
| │ └── SearchBar | ||
| ├── KPISection | ||
| │ └── KPICard (reusable) | ||
| ├── PortfolioTable | ||
| │ ├── TableHeader | ||
| │ ├── GroupRow (reusable) | ||
| │ └── CompanyRow (reusable) | ||
| └── LoadingSpinner (conditional) | ||
| ``` | ||
|
|
||
| ## Component Details | ||
|
|
||
| ### **1. PortfolioOverviewPage** (Container) | ||
| - **Purpose**: Main page container, manages state and data fetching | ||
| - **Props**: None (top-level component) | ||
| - **State**: `companies[]`, `kpis[]`, `searchTerm`, `loading` | ||
| - **Responsibilities**: | ||
| - Fetch portfolio data | ||
| - Handle search filtering | ||
| - Pass data down to child components | ||
|
|
||
| ### **2. Header** (Layout) | ||
| - **Purpose**: Top section with title and search | ||
| - **Props**: `searchTerm`, `onSearchChange` | ||
| - **Children**: PageTitle, SearchBar | ||
|
|
||
| ### **3. PageTitle** (Presentational) | ||
| - **Purpose**: Display "Portfolio Overview" heading | ||
| - **Props**: `title` (string) | ||
| - **Reusable**: Yes - could be used across different pages | ||
|
|
||
| ### **4. SearchBar** (Interactive) | ||
| - **Purpose**: Filter all portfolio data | ||
| - **Props**: `value`, `onChange`, `placeholder` | ||
| - **Reusable**: Yes - standard input component | ||
| - **Features**: Real-time filtering, clear button | ||
|
|
||
| ### **5. KPISection** (Container) | ||
| - **Purpose**: Display key metrics in a row | ||
| - **Props**: `kpis[]` | ||
| - **Children**: Multiple KPICard components | ||
|
|
||
| ### **6. KPICard** (Reusable) | ||
| - **Purpose**: Display individual metric | ||
| - **Props**: `title`, `value`, `change`, `trend` | ||
| - **Reusable**: Yes - used for each KPI metric | ||
| - **Variants**: Could support different value types (currency, percentage, count) | ||
|
|
||
| ### **7. PortfolioTable** (Complex Container) | ||
| - **Purpose**: Main data display with companies and groups | ||
| - **Props**: `companies[]`, `searchTerm` | ||
| - **Children**: TableHeader, GroupRow[], CompanyRow[] | ||
| - **Features**: | ||
| - Grouping logic | ||
| - Sorting capabilities | ||
| - Responsive design | ||
|
|
||
| ### **8. TableHeader** (Layout) | ||
| - **Purpose**: Column headers with sorting | ||
| - **Props**: `columns[]`, `sortBy`, `onSort` | ||
| - **Features**: Sortable columns, proper accessibility | ||
|
|
||
| ### **9. GroupRow** (Reusable) | ||
| - **Purpose**: Aggregated data for company groups | ||
| - **Props**: `groupName`, `totalInvestment`, `companyCount`, `avgMetrics` | ||
| - **Reusable**: Yes - any grouped data display | ||
| - **Features**: Expand/collapse functionality | ||
|
|
||
| ### **10. CompanyRow** (Reusable) | ||
| - **Purpose**: Individual company data | ||
| - **Props**: `company` (object with name, investment, metrics) | ||
| - **Reusable**: Yes - could be used in other company lists | ||
| - **Features**: Action buttons, status indicators | ||
|
|
||
| ## Key Reusability Patterns | ||
|
|
||
| ### **1. Data Display Components** | ||
| - `KPICard` - Any metric display across the app | ||
| - `CompanyRow` - Any company listing feature | ||
| - `SearchBar` - Any search functionality | ||
|
|
||
| ### **2. Layout Components** | ||
| - `Header` - Consistent page headers | ||
| - `PageTitle` - Standardized page titles | ||
| - `TableHeader` - Any data table implementation | ||
|
|
||
| ### **3. Utility Components** | ||
| - `LoadingSpinner` - Any loading state | ||
| - `GroupRow` - Any grouped data visualization | ||
|
|
||
| ## Trade-offs Made | ||
|
|
||
| ### **Chosen: Separate SearchBar vs. Integrated Header Search** | ||
| **Decision**: Created separate `SearchBar` component instead of building search into `Header` | ||
|
|
||
| **Why**: | ||
| - **Reusability**: SearchBar can be used in other contexts (modal searches, filters) | ||
| - **Testing**: Easier to unit test search logic in isolation | ||
| - **Flexibility**: Can easily move search position without restructuring Header | ||
|
|
||
| **Trade-off**: Slightly more props drilling, but gains modularity and reusability | ||
|
|
||
| ### **Component Granularity** | ||
| **Decision**: Split into smaller, focused components rather than fewer large ones | ||
|
|
||
| **Benefits**: Better reusability, easier testing, clearer responsibilities | ||
| **Cost**: More props drilling, slightly more complexity | ||
|
|
||
| This structure balances reusability with simplicity while maintaining clear separation of concerns. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prevent accidental data loss; include zero-relationship tokens; push filtering into the DB.
Today we: (a) skip tokens with zero relationships and (b) might delete tokens/entities even when there are non-"new" relationships present (we only include "new" relationships but never exclude the presence of others). Both are correctness/data‑loss risks.
Apply:
Also applies to: 50-53