Repository navigation
feat(ui): complete Dashboard, POS, and common flow RTL layout for Persian - #338
Merged
Merged
Conversation
…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
…nd Ltr runtime regression tests"}
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
18 tasks done
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.
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
ms/me,ps/pe,text-start/text-end,border-s/border-e,rounded-s/rounded-e).DirectionalToasterto align toast notifications to inline-end (top-leftin RTL,top-rightin LTR), mirrored directional icons with.rtl-flip, and isolated phone numbers, order numbers, printer endpoints, and image URLs within<Ltr>islands.tests/rtl-dashboard-pos-common.test.tsregistered innpm testand an end-to-end Playwright spec infrontend/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.
/var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M06ZR8QPAYE8HF2XV90DDKGY/pos-ltr-en.png)/var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M06ZR8QPAYE8HF2XV90DDKGY/pos-rtl-fa.png)/var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M06ZR8QPAYE8HF2XV90DDKGY/dashboard-rtl-fa.png)/var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M06ZR8QPAYE8HF2XV90DDKGY/orders-rtl-fa.png)/var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M06ZR8QPAYE8HF2XV90DDKGY/products-rtl-fa.png)/var/folders/y_/1ltcxtwj0zd_w1dg9jv4jl580000gn/T/no-mistakes-evidence/01M06ZR8QPAYE8HF2XV90DDKGY/customers-rtl-fa.png)/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-commonnpm run test:rtl-foundationnpm run test:rtl-setup-auth-settingsEVIDENCE_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.