Skip to content

fix(ui): theme date and time pickers in dark mode - #1583

Merged
khaira777 merged 8 commits into
mainfrom
fix/flocafe-dark-calendar-inputs-r2
Nov 15, 2026
Merged

khaira777 merged 8 commits into
mainfrom
fix/flocafe-dark-calendar-inputs-r2

Conversation

@khaira777

@khaira777 khaira777 commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #1576

Intent

In dark mode, calendar and date/time icons on fields such as Expenses (date filter inputs and the Expense form date field) and other screens across the POS and management pages still appear black, and clicking them opens a native date/time picker with a white background. Using the Dashboard page's custom dark-aware calendar input implementation as the reference pattern, audit every place where calendar/date/time inputs are used across the POS and all other screens and apply the dark-mode theme fix consistently so both the icons and opened pickers match the active Light/Dark theme.

What Changed

  • Added a shared DatePickerInput component and openTemporalPicker helper in frontend/src/components/ui/date-picker-input.tsx that hides the native WebKit picker indicator, sets [color-scheme:light] dark:[color-scheme:dark], and renders an accessible CalendarDays or Clock trigger button invoking showPicker() with a focus() fallback.
  • Extended @layer base in frontend/src/app/globals.css to apply color-scheme: light and .dark color-scheme: dark to date, datetime-local, month, week, and time inputs, and replaced native temporal inputs with DatePickerInput across the dashboard, expenses, WhatsApp automation, cash close/movement modals, and POS order/scheduled-order drawers.
  • Added CSS/component rendering checks in tests/themed-date-time-inputs.test.ts (wired into package.json), updated tests/ui-regressions-621-623-626.test.ts for the shared picker component, and added Playwright coverage in frontend/e2e/dark-calendar-inputs.spec.ts.

Risk Assessment

✅ Low: The change extracts the existing Dashboard custom dark-aware temporal input pattern into a shared DatePickerInput component, applies light/dark color-scheme rules across all 5 HTML temporal input types in globals.css, updates all 8 temporal input call sites consistently across POS and dashboard pages, and adds executable component and Playwright E2E coverage with no functional regressions or unrequired complexity.

Testing

Built backend and static desktop frontend, ran focused Node regression suites (test:themed-date-time-inputs and test:ui-regressions-621-623-626), drove all 4 Playwright Chromium scenarios in frontend/e2e/dark-calendar-inputs.spec.ts plus frontend/e2e/expenses.spec.ts and Electron theme.electron.spec.ts, verified unmocked native showPicker() keyboard interaction, expense creation persistence, and Arabic RTL dark layout, and captured 14 screenshots under ~/.no-mistakes/evidence/01M7F39RN453WYVTCV1FAD83FY, with every driven check passing.

  • Live validation: ✅ go - 7 of 7 scenarios driven live against the product
Scenario Result Live Evidence
Owner toggles Dark mode, opens Expenses, inspects From/To date filters and Add Expense incurred-on date field, creates an expense, and toggles back to Light mode ✅ pass live frontend/e2e/dark-calendar-inputs.spec.ts test 1; expenses-dark-filters.png; expenses-dark-form.png; expenses-light-filters.png; frontend/e2e/expenses.spec.ts
User clicks the custom calendar icon button to open Chromium's real native picker, navigates days by keyboard, and falls back to focus() when showPicker() throws ✅ pass live Live Chromium native picker check (beforeVal 2026-11-10 -> afterVal 2026-11-11) and frontend/e2e/dark-calendar-inputs.spec.ts showPicker error fallback check
Owner switches Dashboard between Day, Month, and Range pickers and opens Close day (CashCloseModal) in Dark and Light modes ✅ pass live frontend/e2e/dark-calendar-inputs.spec.ts test 2; dashboard-dark-day.png; dashboard-dark-month.png; dashboard-dark-range.png; dashboard-dark-cash-close.png; dashboard-light-day.png
Cashier/owner uses POS OrderDetailsDrawer schedule datetime-local input, places a scheduled order, reschedules via ScheduledOrdersDrawer, and opens Cash movement date input in Dark mode ✅ pass live frontend/e2e/dark-calendar-inputs.spec.ts test 3; pos-dark-order-details-drawer.png; pos-dark-scheduled-reschedule.png; pos-dark-cash-movement.png
Owner opens WhatsApp Templates & Rules quiet-hours time inputs (Clock icon) and verifies globals.css base color-scheme across date, datetime-local, month, week, and time in Dark and Light modes ✅ pass live frontend/e2e/dark-calendar-inputs.spec.ts test 4; whatsapp-dark-quiet-hours.png; whatsapp-light-quiet-hours.png
Owner switches store language to Arabic (RTL) in Dark mode on Expenses and verifies calendar icon alignment at inline-end without text overlap ✅ pass live expenses-dark-rtl.png and live RTL geometry check (dir=rtl, btnLeft=884, inLeft=884, inRight=1064)
Real Electron desktop app toggles Dark/Light in Settings and persists theme_mode across full app relaunch ✅ pass live frontend/e2e/desktop/theme.electron.spec.ts (2 passed, 1 skipped requiring FLO_E2E_SHOW_WINDOW=1)

Expenses filter date inputs in dark mode
Add expense modal incurred-on date input in dark mode
Expenses filter date inputs in light mode
Expenses filter date inputs in dark mode RTL (Arabic)
Dashboard day date picker in dark mode
Dashboard month picker in dark mode
Dashboard date range pickers in dark mode
Dashboard Close day modal business date picker in dark mode
Dashboard day date picker in light mode
POS OrderDetailsDrawer scheduled datetime-local picker in dark mode
POS ScheduledOrdersDrawer reschedule datetime-local picker in dark mode
POS CashDrawerMovementModal business date picker in dark mode
WhatsApp quiet-hours time pickers with Clock icon in dark mode
WhatsApp quiet-hours time pickers with Clock icon in light mode

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

✅ **Review** - passed

✅ No issues found.

✅ **Test** - passed

✅ No issues found.

  • Live validation: ✅ go - 7 of 7 scenarios driven live against the product
Scenario Result Live Evidence
Owner toggles Dark mode, opens Expenses, inspects From/To date filters and Add Expense incurred-on date field, creates an expense, and toggles back to Light mode ✅ pass live frontend/e2e/dark-calendar-inputs.spec.ts test 1; expenses-dark-filters.png; expenses-dark-form.png; expenses-light-filters.png; frontend/e2e/expenses.spec.ts
User clicks the custom calendar icon button to open Chromium's real native picker, navigates days by keyboard, and falls back to focus() when showPicker() throws ✅ pass live Live Chromium native picker check (beforeVal 2026-11-10 -> afterVal 2026-11-11) and frontend/e2e/dark-calendar-inputs.spec.ts showPicker error fallback check
Owner switches Dashboard between Day, Month, and Range pickers and opens Close day (CashCloseModal) in Dark and Light modes ✅ pass live frontend/e2e/dark-calendar-inputs.spec.ts test 2; dashboard-dark-day.png; dashboard-dark-month.png; dashboard-dark-range.png; dashboard-dark-cash-close.png; dashboard-light-day.png
Cashier/owner uses POS OrderDetailsDrawer schedule datetime-local input, places a scheduled order, reschedules via ScheduledOrdersDrawer, and opens Cash movement date input in Dark mode ✅ pass live frontend/e2e/dark-calendar-inputs.spec.ts test 3; pos-dark-order-details-drawer.png; pos-dark-scheduled-reschedule.png; pos-dark-cash-movement.png
Owner opens WhatsApp Templates & Rules quiet-hours time inputs (Clock icon) and verifies globals.css base color-scheme across date, datetime-local, month, week, and time in Dark and Light modes ✅ pass live frontend/e2e/dark-calendar-inputs.spec.ts test 4; whatsapp-dark-quiet-hours.png; whatsapp-light-quiet-hours.png
Owner switches store language to Arabic (RTL) in Dark mode on Expenses and verifies calendar icon alignment at inline-end without text overlap ✅ pass live expenses-dark-rtl.png and live RTL geometry check (dir=rtl, btnLeft=884, inLeft=884, inRight=1064)
Real Electron desktop app toggles Dark/Light in Settings and persists theme_mode across full app relaunch ✅ pass live frontend/e2e/desktop/theme.electron.spec.ts (2 passed, 1 skipped requiring FLO_E2E_SHOW_WINDOW=1)
  • npm run test:themed-date-time-inputs
  • npm run test:ui-regressions-621-623-626
  • npx --prefix frontend playwright test --config=frontend/playwright.config.ts --project=chromium frontend/e2e/dark-calendar-inputs.spec.ts
  • npx --prefix frontend playwright test --config=frontend/playwright.config.ts --project=chromium frontend/e2e/expenses.spec.ts
  • npx --prefix frontend playwright test --config=frontend/playwright.electron.config.ts --project=electron-desktop frontend/e2e/desktop/theme.electron.spec.ts
  • Live Chromium verification of unmocked native showPicker() keyboard date selection, Add expense DB persistence, and Arabic RTL dark-mode layout on /expenses
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

…hemed-date-time-inputs.test.ts and tests/ui-regressions-621-623-626.test.ts with rendered markup and executable checks for ScheduledOrdersDrawer (reschedule mode), ExpensesPage, DashboardPage (day/month/range), WhatsAppPage (automation tab), and openTemporalPicker. Focused test commands (npm run test:themed-date-time-inputs && npm run test:ui-regressions-621-623-626) could not execute because ts-node is not on PATH and node_modules is absent in this isolated worktree
… to grant dashboard.view on useAuthStore.currentTenant before rendering DashboardPage and restore prior auth state in finally. Focused verification (npm run test:ui-regressions-621-623-626 && npm run test:themed-date-time-inputs) was blocked because ts-node is unavailable without node_modules in this isolated worktree
… tests/ui-regressions-621-623-626.test.ts so renderWithIntl(React.createElement(Runner)) executes and assigns tree before returning { tree, html }. Focused test execution (npm run test:ui-regressions-621-623-626) remains blocked in this isolated worktree because ts-node is not on PATH and node_modules is not installed
…om DatePickerInput in frontend/src/components/ui/date-picker-input.tsx and kept className="relative" directly on the wrapper div. Focused test execution (npm run test:themed-date-time-inputs) could not run because ts-node is unavailable without node_modules in this isolated worktree
@qodo-code-review

Copy link
Copy Markdown

ⓘ Qodo reviews are paused because your trial has ended. Ask your workspace admin to add credits to resume reviews. Manage billing

@coderabbitai

coderabbitai Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@khaira777 khaira777 changed the title fix(frontend): theme calendar and time inputs across light and dark modes fix(ui): theme date and time pickers in dark mode Nov 15, 2026
@khaira777
khaira777 merged commit 4fbf2c2 into main Nov 15, 2026
23 checks passed
@khaira777
khaira777 deleted the fix/flocafe-dark-calendar-inputs-r2 branch November 15, 2026 08:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(ui): theme date and time pickers in dark mode

1 participant