feat: mobile UX, Apple iOS design, E2E tests, security fixes#1
Open
Srbino wants to merge 8 commits into
Open
Conversation
UI/UX: - Lucide icons (local, CSP-safe) in sidebar, bottom nav and pages - 5-item bottom nav with slide-up drawer for mobile - Bottom sheet modals on mobile, expense-card components - Wallet stats row, icon buttons, amount-pill styles Security fixes: - SEC-1: Ownership check on all edit/delete/toggle operations (shopping, logbook, menu) - SEC-2: expense_date validated via DateTime::createFromFormat() - BUG-2: requireLogin() returns JSON for AJAX requests (no 302) - BUG-4: switchTab() uses explicit el param (Safari compat) - BUG-1: logbook departure/arrival_time PHP Warning fixed - CALC-3: CZK expense edit preserves original exchange_rate - CALC-4: formatMoney() override removed from wallet.php Docker local environment: - docker-compose.yml (PHP 8.2 + Apache + MySQL 8) - docker/apache.conf, schema.sql, seed.sql Test suite (229 + 216 tests, all passing): - tests/wallet_test.php: 62 unit tests (split, CZK, settlement) - tests/validation_test.php: 74 unit tests (date, category, email, NM, meal type, rate limiting) - tests/integration_test.php: 93 HTTP integration tests (auth, wallet, shopping, logbook, menu, cars, checklist) - tests/e2e_calculations_test.php: 90 DB-backed E2E tests (split integrity, balances, settlements, stress) - tests/e2e_10user_test.php: 216 truth-table E2E tests (10 users, exact per-split values, CZK rate preservation) task.md: documented all bugs SEC-1..4, CALC-1..5, BUG-1..15 with before/after code and test coverage
- docker/seed_roadtrip.sql: realistic 10-day trip, 10 people, 2 boats, 20 expenses (mix EUR/CZK), fixed rate 25.00 CZK/EUR for reproducibility. Each expense annotated with expected split values and balance contribution. - tests/golden_dataset_test.php: 161 tests comparing app output against independently computed reference values (computed via direct SQL, not app logic). Verifies exact paid/share/balance per user, all 9 settlement transactions by amount, and CZK conversion accuracy. - tests/fuzz_test.php: 1819 property-based tests across 1800 random scenarios (1000 splits, 500 CZK conversions, 300 settlements) + edge cases. Uses fixed mt_srand(42) for reproducibility. Tests invariants: SUM==amount, each split>=0, all non-first splits identical, settlements reduce residual to ~0.
- CSS: added avatar, FAB, progress-bar, stat-card-inner, balance-row, settlement-item-v2, shop-item-card, log-entry-card, menu-day-card, cl-section accordion, and shop-category-header components - Dashboard: initials avatars for crew, balance card with progress bar, nav-cards with coloured icon tiles, countdown context label - Wallet: expense-card category icons (Lucide per category), balance-row cards replacing plain table (avatar + progress bar), settlement-item-v2 with avatars and arrow icons - Shopping: card-based item list grouped by category with Lucide category icons, bought-toggle checkboxes, hide-bought filter, FAB for mobile - Checklist: replaced emoji with Lucide icons, accordion sections (collapsible), pencil edit icon, FAB for mobile - Logbook: stat-cards with icon wrappers, log-entry cards replacing table (date column + route + NM badge + note) - Menu: day-cards replacing table, initials avatar for cook, edit icon - Cars: car icon header, progress bar for capacity, steering-wheel icon for driver, initials avatars for passengers, user-x for unassigned - Crews: Lucide phone/mail icons replacing unicode, initials avatars, sailboat icon in card header - Itinerary: Lucide icons in timeline dots (car/sailboat/anchor/map-pin), colour-coded type badges per entry type
…n from top - Hamburger moved from bottom-nav to top-bar (right side, next to logout) - Bottom nav reduced to 4 items (no More button) - Drawer now slides down from top-bar instead of up from bottom - main-content uses padding-bottom (not margin) so page scrolls fully - mobile-menu overlay starts below top-bar (no z-index overlap) - iOS safe-area-inset-bottom respected in padding
Modal je nyní display:flex flex-direction:column. modal-body má flex:1 a overflow-y:auto takže scrolluje obsah. modal-footer má flex-shrink:0 takže tlačítka Uložit/Zrušit jsou vždy viditelná i při dlouhém obsahu (10 checkboxů posádky, apod.)
- wallet API: přidán paid_by_avatar (u.avatar) do SELECT - expense card JS: pokud má paid_by_avatar, zobrazí <img>, jinak initials span
Skripts přesunuty z footer.php do header.php – stránkové <script> bloky (wallet.php, crews.php apod.) se spouštějí až po načtení app.js, takže getInitials() a ostatní globální funkce jsou vždy dostupné.
…UDE.md Mobile UX (5 priority fixes): - Touch targets enlarged to 44px minimum (icon-btn, modal-close, checkboxes, hamburger, drawer-close) - Bottom nav: font 0.75rem, icons 24px, height 60px for readability - Wallet modal: collapsible "Za koho" section with participant counter - Scroll indicators: CSS mask gradient on wallet stats row - Inline styles replaced with CSS classes in wallet modal Design system: - Apple iOS inspired color palette (oklch): System Blue primary, clean neutral grays - Pure black dark mode (OLED-friendly), iOS system semantic colors - SF Pro font stack, 15px base size, 8-12px radius, soft diffused shadows Bug fixes: - api/wallet.php: date parsing uses ?: instead of ?? (DateTime returns false, not null) - Added Y-m-d\TH:i format support for HTML5 datetime-local inputs Tests: - E2E wallet test suite (47 tests) validating splits, balances, settlements, CRUD, edge cases - Tests run against live app via HTTP: docker exec vol5_web php tests/e2e_wallet_test.php Documentation: - CLAUDE.md: full project context for AI assistants - README.md: comprehensive rewrite with architecture, API reference, wallet logic, security Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Comprehensive update: mobile UX fixes, Apple iOS design system, financial E2E tests, security fixes, and full documentation.
Mobile UX (5 priority fixes)
Apple iOS Design System
Bug Fixes
api/wallet.phpuses?:instead of??(DateTime::createFromFormatreturnsfalse, notnull)Y-m-d\TH:iformat supportE2E Wallet Test Suite (47 tests)
docker exec vol5_web php /var/www/html/tests/e2e_wallet_test.phpTests validate against the live running app:
Documentation
Test plan
🤖 Generated with Claude Code