The Fuel Logs page opens directly to an Add form with a Summary sidebar. There's no log history list/table as the primary view. Users likely want to view their fuel history more often than they add entries.
Recommendation
Default to a table/list view of fuel logs with an "Add Fuel Log" button
Place the form behind a button click or modal
The Summary stats should be above or alongside the history table
Acceptance Criteria
Fuel Logs page defaults to showing a list/table of existing fuel logs
"Add Fuel Log" button opens the add form (modal or inline)
Summary stats remain visible and accessible
Tested on mobile (320px, 768px) and desktop (1920px)
Relates to #162
## Severity: High
## Problem
The Fuel Logs page opens directly to an Add form with a Summary sidebar. There's no log history list/table as the primary view. Users likely want to view their fuel history more often than they add entries.
## Recommendation
- Default to a table/list view of fuel logs with an "Add Fuel Log" button
- Place the form behind a button click or modal
- The Summary stats should be above or alongside the history table
## Acceptance Criteria
- Fuel Logs page defaults to showing a list/table of existing fuel logs
- "Add Fuel Log" button opens the add form (modal or inline)
- Summary stats remain visible and accessible
- Tested on mobile (320px, 768px) and desktop (1920px)
Phase: 5 (Fuel Logs restructure) | Priority: High | Depends on: None | Blocks: None
Context
The Fuel Logs page currently uses a two-column layout with the form always visible on the left and the list on the right. This is form-first rather than list-first. Users should see their fuel log history as the primary view, with the form accessible via a button/dialog.
chore: restructure Fuel Logs to list-first with add dialog (refs #168)
Test Criteria
Page opens to list view showing fuel log history
"Add Fuel Log" button opens the form in a dialog/modal
Stats card visible above the list
Successful form submission closes dialog and refreshes list
Edit flow (via FuelLogEditDialog) still works independently
Mobile + desktop layouts both work
Verify on mobile (320px, 768px) and desktop (1920px) viewports
Risk Notes
Significant layout restructure. Existing form logic must work correctly in dialog context.
Ensure form state resets when dialog reopens.
Branch
Work on branch issue-162-ux-design-audit-cleanup (shared with all #162 sub-issues)
## Implementation Plan (from #162 -- Milestone 12)
**Phase**: 5 (Fuel Logs restructure) | **Priority**: High | **Depends on**: None | **Blocks**: None
### Context
The Fuel Logs page currently uses a two-column layout with the form always visible on the left and the list on the right. This is form-first rather than list-first. Users should see their fuel log history as the primary view, with the form accessible via a button/dialog.
### Implementation
**1. Restructure `frontend/src/features/fuel-logs/pages/FuelLogsPage.tsx`:**
- Primary view: `FuelStatsCard` at top, then `FuelLogsList` as main content (full width)
- Remove two-column layout; list takes full width
- Add "Add Fuel Log" button in page header that opens `AddFuelLogDialog`
- Mobile: Same pattern -- stats at top, list below, FAB or button triggers form dialog
**2. Create `frontend/src/features/fuel-logs/components/AddFuelLogDialog.tsx` (new):**
```typescript
interface AddFuelLogDialogProps {
open: boolean;
onClose: () => void;
vehicleId?: string;
}
```
- Wraps existing `FuelLogForm.tsx` inside a MUI `<Dialog>` component
- `FuelLogForm.tsx` remains as-is (standalone form component, reused by both dialog and edit flow)
- Follows same pattern as existing `FuelLogEditDialog.tsx` (which wraps the form for editing)
- On successful submit: close dialog, invalidate fuel logs query to refresh list
- `AddFuelLogDialog.tsx` coexists with `FuelLogEditDialog.tsx` -- they serve different purposes (create vs edit)
**3. Minor update to `frontend/src/features/fuel-logs/components/FuelLogForm.tsx`:**
- Add `onSuccess` callback prop for dialog close notification (if not already present)
**4. Documentation**: After completion, add `AddFuelLogDialog.tsx` entry to components table in `frontend/src/features/fuel-logs/CLAUDE.md`
### Files
- `frontend/src/features/fuel-logs/pages/FuelLogsPage.tsx`
- `frontend/src/features/fuel-logs/components/AddFuelLogDialog.tsx` (new)
- `frontend/src/features/fuel-logs/components/FuelLogForm.tsx` (minor: onSuccess callback)
- `frontend/src/features/fuel-logs/CLAUDE.md` (doc update)
### Commit Convention
```
chore: restructure Fuel Logs to list-first with add dialog (refs #168)
```
### Test Criteria
- Page opens to list view showing fuel log history
- "Add Fuel Log" button opens the form in a dialog/modal
- Stats card visible above the list
- Successful form submission closes dialog and refreshes list
- Edit flow (via FuelLogEditDialog) still works independently
- Mobile + desktop layouts both work
- Verify on mobile (320px, 768px) and desktop (1920px) viewports
### Risk Notes
- Significant layout restructure. Existing form logic must work correctly in dialog context.
- Ensure form state resets when dialog reopens.
### Branch
Work on branch `issue-162-ux-design-audit-cleanup` (shared with all #162 sub-issues)
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Relates to #162
Severity: High
Problem
The Fuel Logs page opens directly to an Add form with a Summary sidebar. There's no log history list/table as the primary view. Users likely want to view their fuel history more often than they add entries.
Recommendation
Acceptance Criteria
Implementation Plan (from #162 -- Milestone 12)
Phase: 5 (Fuel Logs restructure) | Priority: High | Depends on: None | Blocks: None
Context
The Fuel Logs page currently uses a two-column layout with the form always visible on the left and the list on the right. This is form-first rather than list-first. Users should see their fuel log history as the primary view, with the form accessible via a button/dialog.
Implementation
1. Restructure
frontend/src/features/fuel-logs/pages/FuelLogsPage.tsx:FuelStatsCardat top, thenFuelLogsListas main content (full width)AddFuelLogDialog2. Create
frontend/src/features/fuel-logs/components/AddFuelLogDialog.tsx(new):FuelLogForm.tsxinside a MUI<Dialog>componentFuelLogForm.tsxremains as-is (standalone form component, reused by both dialog and edit flow)FuelLogEditDialog.tsx(which wraps the form for editing)AddFuelLogDialog.tsxcoexists withFuelLogEditDialog.tsx-- they serve different purposes (create vs edit)3. Minor update to
frontend/src/features/fuel-logs/components/FuelLogForm.tsx:onSuccesscallback prop for dialog close notification (if not already present)4. Documentation: After completion, add
AddFuelLogDialog.tsxentry to components table infrontend/src/features/fuel-logs/CLAUDE.mdFiles
frontend/src/features/fuel-logs/pages/FuelLogsPage.tsxfrontend/src/features/fuel-logs/components/AddFuelLogDialog.tsx(new)frontend/src/features/fuel-logs/components/FuelLogForm.tsx(minor: onSuccess callback)frontend/src/features/fuel-logs/CLAUDE.md(doc update)Commit Convention
Test Criteria
Risk Notes
Branch
Work on branch
issue-162-ux-design-audit-cleanup(shared with all #162 sub-issues)Milestone: Implementation Complete
Phase: Execution | Agent: Developer | Status: PASS
Changes
pages/FuelLogsPage.tsx(restructured):components/AddFuelLogDialog.tsx(new):onSuccesscloses dialog after submissionVerification
onSuccessprop already existed -- no form changes needede4be744on branchissue-162-ux-design-audit-cleanupVerdict: PASS | Next: Visual verification on mobile and desktop viewports