Daniel Volz
f0496e8ca5
fix: remove duplicate ESC handlers causing double history.back()
...
AboutModal, ProfileModal, and ShareDialog each had their own
useEscapeKey hook AND were handled by the global ESC handler in
App.tsx. When ESC was pressed, both fired synchronously, calling
history.back() twice — navigating past the current page instead
of just closing the modal.
Removed the per-modal useEscapeKey calls since the global handler
in App.tsx already manages ESC priority for all modals.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com >
2026-02-25 23:50:07 +01:00
Daniel Volz
ba36f67371
fix: smooth mobile edit transition and align modal validation behavior ( #286 )
...
* fix: reliable Escape key close for all modals via useEscapeKey hook
- Add useEscapeKey hook (document-level keydown listener)
- Retrofit all 12 modal/overlay components to use it
- Remove redundant overlay onKeyDown Escape handlers
- Simplify modal-content onKeyDown to plain stopPropagation
- Replace MedDetailModal's capture-phase useEffect with 3 useEscapeKey calls
- Replace SharedSchedule's inline useEffect with useEscapeKey
- Add mandatory modal rules to UI Consistency skill
- All 777 frontend + 569 backend tests pass
* fix: smooth mobile edit transition and align modal validation behavior
* fix: keep overlay keydown non-closing for Enter key
* fix: show mobile name error when validation already exists
* fix: restore app-level escape priority handling
* fix: prioritize schedule lightbox on Escape
2026-02-23 06:42:06 +01:00
Daniel Volz
088a6c1a05
chore: fix all Biome lint warnings and MedDetail intake bell icons ( #265 )
...
- Backend: refactor nested ternaries, remove unused imports/any types
- Frontend: fix exhaustive deps, a11y label associations, array index keys,
empty CSS blocks, unused vars, type annotations
- MedDetail modal: fix intake schedule bell icons not rendering (use unified
intake source with fallback), place bell inline after person name
- MedDetail modal: revert schedule rows from grid to flexbox layout
Closes #264
2026-02-22 08:52:03 +01:00
Daniel Volz
943148fb49
feat: close modals with browser back button on mobile ( #257 )
...
* feat: close modals with browser back button on mobile
Create reusable useModalHistory hook that pushes history state when a
modal opens and listens for popstate to close it. Apply to ReportModal,
ClearMissedConfirm, ExportModal, ImportConfirm, and all modals using
ConfirmModal/ShareDialog/Auth/ExportModal base components. Escape key
handling was already in place for desktop.
Closes #253
* fix: update tests for renamed button labels and missing useModalHistory mock
2026-02-21 18:00:12 +01:00
Daniel Volz
052751b2ba
feat: reports, timeline toggles, and stock correction improvements ( #236 )
...
* refactor(frontend): modularize styles and polish modal/ui interactions
* feat: add report workflow and timeline/settings improvements
* fix: resolve CI failures for backend typing, lint, and playwright config
2026-02-20 18:52:59 +01:00
Daniel Volz
89d565bc9d
chore: fix lint errors and reduce warnings across codebase ( #234 )
...
* chore: fix lint errors and reduce warnings across codebase
- Fix noExplicitAny catches in backend routes and plugins
- Fix noNestedTernary issues in backend services
- Add keyboard event handlers for useKeyWithClickEvents in frontend
- Disable noImportantStyles rule in biome.json
- Fix formatting errors across all changed files
- Fix test file lint issues
Closes #233
* fix: restore any types in test files for TS compatibility
* fix: revert Auth.tsx dependency array changes that caused infinite re-render
* fix: null-safe user.username access in AppContext dependency array
2026-02-17 05:21:47 +01:00
Daniel Volz
8718311876
refactor(frontend): modularize App.tsx into components, pages, hooks, and context ( #60 )
...
- Extract App.tsx from 764 lines to ~404 lines
- Create reusable components: MedDetailModal, MobileEditModal, ShareDialog, etc.
- Add AppContext for global state management
- Split pages: DashboardPage, MedicationsPage, SchedulePage, SettingsPage, PlannerPage
- Create custom hooks: useAuth, useMedications, useSettings, useDoses, useSchedule
- Add utility functions in separate modules
- Fix stock status logic (>30 days = green/normal)
- Fix reminder threshold calculation (use reminderDaysBefore not lowStockDays)
- Fix takenBy validation (send [] instead of null)
- Fix datetime format for blister start times (add Z suffix)
- Style 'All OK' status as green/bold
BREAKING: None - all existing functionality preserved
2026-01-22 05:38:34 +01:00