-
Notifications
You must be signed in to change notification settings - Fork 0
UI Overview
Christophe Babilotte edited this page Dec 26, 2025
·
3 revisions
Technical overview of ProjectHub's UI architecture for contributors.
All main pages use React.lazy() for code splitting:
- Dashboard – Project counts and quick access
- Projects – DataGrid with project records
- Templates – DataGrid with available templates
- Libraries – DataGrid with library files
- Settings – Modal with tabbed content
Shared across Projects, Templates, and Libraries pages:
- Sortable columns (click header to sort)
- Selection via checkboxes
- Built-in search/filter
- Pagination controls
- Row actions (edit, delete, view)
Slide-out chat panel for AI interactions:
- Fixed position on right side (
w-96) - Provider selector in header
- Streaming response display
- Action buttons for save/create when template detected
First-use modal for provider configuration:
- Provider selection (radio buttons)
- API key input with test button
- Contextual help links
- Connection validation before save
React context managing AI state:
-
messages– Conversation history -
streaming– Whether response is in progress -
streamContent– Real-time streaming content -
sendMessage()– Send user message -
testConnection()– Validate provider config
The New Project wizard uses a multi-step pattern:
-
Basics –
BasicsStep.tsx(name, version, destination) -
Templates –
TemplatesStep.tsx(template selection) -
Libraries –
LibrariesStep.tsx(library selection) -
Review –
ReviewStep.tsx(confirmation)
State managed by useProjectsWizard hook. Progress shown via StepperProgress component.
Replace all alert() calls with the toast system:
const addToast = useToast();
addToast('Pack installed successfully', 'success');Types: info, success, warning, error
Toasts render in bottom-right corner with 4-second auto-dismiss.
Modal component provides:
- Focus trapping (Tab cycles within modal)
- Escape key to close
- ARIA attributes (
role="dialog",aria-modal="true") - Backdrop click to close
- Tailwind CSS – Utility classes for all styling
-
CSS variables – Theme colors in
styles.css - Lucide icons – Consistent iconography
-
Animations –
fade-in,slide-up,scale-inkeyframes inanimations.css
- Keep components under 150 lines when possible
- Extract complex logic to custom hooks
- Use
useMemo/useCallbackin contexts to prevent re-renders - Prefer composition over large monolithic components