Skip to content

feat(ui): complete Dashboard, POS, and common flow RTL layout for Persian - #338

Merged
khaira777 merged 4 commits into
mainfrom
feat/241-rtl-dashboard-pos-common
Aug 17, 2026
Merged

khaira777 merged 4 commits into
mainfrom
feat/241-rtl-dashboard-pos-common

Conversation

@khaira777

@khaira777 khaira777 commented Aug 17, 2026 •

Copy link
Copy Markdown
Contributor

Intent

Batch E of umbrella issue #241 (FreeOpenSourcePOS/FloCafe): make the core merchant/cashier workflow visually correct and usable under Persian RTL, while keeping Persian hidden from normal Setup/Settings language selectors. Convert dashboard, POS ordering, cart, products/categories, customers, tables, held orders, checkout/payment flows, bills/order detail, common dialogs/confirmation prompts, toasts where layout is affected, and shared operational components to logical direction utilities (ms/me/ps/pe/start/end, text-start/text-end, border-s/e, rounded-s/e), mirror directional icons via the shared .rtl-flip class, and isolate naturally-LTR values (order numbers, phone numbers, printer IP/VID, URLs, support codes, JSON payloads) in dir=ltr islands so numeric/technical values stay readable. Make the toast host direction-aware (Persian RTL toasts at inline-end/top-left; LTR languages keep top-right). Do NOT enable Persian for normal users, do NOT implement money-unit conversion or Shamsi policy, do NOT modify browser or ESC/POS receipt printing, and do NOT solve KDS/Server App/WhatsApp beyond shared-component fixes. Preserve English, Spanish, and Portuguese behavior. Add regression coverage (unit test registered in npm test plus a focused Playwright e2e spec) and verify with frontend typecheck, lint, build, backend lint/build, and the full e2e suite.

What Changed

  • Converted merchant and cashier screens (dashboard, POS, cart, products, customers, tables, orders, payment modals, and tax breakdown) from physical to logical direction utilities (ms/me, ps/pe, text-start/text-end, border-s/border-e, rounded-s/rounded-e).
  • Introduced DirectionalToaster to align toast notifications to inline-end (top-left in RTL, top-right in LTR), mirrored directional icons with .rtl-flip, and isolated phone numbers, order numbers, printer endpoints, and image URLs within <Ltr> islands.
  • Added regression coverage via tests/rtl-dashboard-pos-common.test.ts registered in npm test and an end-to-end Playwright spec in frontend/e2e/rtl-dashboard-pos-common.spec.ts.

Risk Assessment

✅ Low: The changes cleanly convert physical layout utilities to logical direction equivalents across merchant and cashier workflows, isolate LTR values, and provide executable component and E2E regression coverage without regressions.

Testing

Executed targeted RTL regression unit tests and Playwright end-to-end tests against the live application server, validating Persian RTL and English LTR layouts, DirectionalToaster placement across languages, phone number LTR preservation, icon mirroring, and no horizontal page overflow. Captured 7 full-page screenshots covering English baseline POS and Persian RTL POS, Dashboard, Orders, Products, Customers, and Tables screens.

  • Evidence: POS Screen English Baseline (LTR) (local file: /var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M06ZR8QPAYE8HF2XV90DDKGY/pos-ltr-en.png)
  • Evidence: POS Screen Persian (RTL) with LTR Phone Input (local file: /var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M06ZR8QPAYE8HF2XV90DDKGY/pos-rtl-fa.png)
  • Evidence: Dashboard Persian (RTL) with Mirrored Directional Icons (local file: /var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M06ZR8QPAYE8HF2XV90DDKGY/dashboard-rtl-fa.png)
  • Evidence: Orders Screen Persian (RTL) (local file: /var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M06ZR8QPAYE8HF2XV90DDKGY/orders-rtl-fa.png)
  • Evidence: Products Catalog Persian (RTL) (local file: /var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M06ZR8QPAYE8HF2XV90DDKGY/products-rtl-fa.png)
  • Evidence: Customers Directory Persian (RTL) (local file: /var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M06ZR8QPAYE8HF2XV90DDKGY/customers-rtl-fa.png)
  • Evidence: Tables Overview Persian (RTL) (local file: /var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M06ZR8QPAYE8HF2XV90DDKGY/tables-rtl-fa.png)

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

🔧 **Review** - 1 issue found → auto-fixed ✅
  • ⚠️ tests/rtl-dashboard-pos-common.test.ts:95 - tests/rtl-dashboard-pos-common.test.ts verifies direction utility compliance by reading .tsx source files with fs.readFileSync and executing regex scans against code strings rather than asserting behavior through an executable interface. While this follows the pattern of rtl-foundation.test.ts and rtl-setup-auth-settings.test.ts, source-content-only assertions do not test runtime execution directly.

🔧 Fix: {"summary": "Add executable DirectionalToaster and Ltr runtime regression tests"}
✅ Re-checked - no issues remain.

✅ **Test** - passed

✅ No issues found.

  • npm run test:rtl-dashboard-pos-common
  • npm run test:rtl-foundation
  • npm run test:rtl-setup-auth-settings
  • EVIDENCE_DIR=/var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M06ZR8QPAYE8HF2XV90DDKGY npx playwright test e2e/rtl-dashboard-pos-common.spec.ts
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

…sian

Convert the core cashier/merchant screens (dashboard, POS, cart, products,
customers, tables, orders, checkout/payment, bills) to logical direction
utilities, mirror directional icons via rtl-flip, isolate naturally-LTR
values (order numbers, phones, IPs, URLs) in LTR islands, and make the
toast host direction-aware. Persian stays hidden from normal selectors.

Refs #241
@khaira777
khaira777 requested a review from itsbkm as a code owner August 17, 2026 04:29
Move the ltr/rtl mapping next to the language definitions in lib/i18n.ts
(expose getLanguageDirection) and have HtmlLangSync, KdsHtmlLang, and the
DirectionalToaster all derive direction from it instead of hard-coding fa.
Adding another RTL language now only requires updating the metadata map.

Refs #241
@khaira777
khaira777 merged commit d2a5fca into main Aug 17, 2026
12 checks passed
@khaira777
khaira777 deleted the feat/241-rtl-dashboard-pos-common branch August 17, 2026 04:57
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.

1 participant