Repository navigation
fix(settings): hydrate KDS state on Printers tab - #1138
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
|
@greptile review |
|
|
The direct Printers tab hydration fix is valid, and the new browser test covers the original missing-warning issue. However, I found a save/load race in the new KDS hydration logic that should be addressed before merging. 1. Prevent pending saves from being overwritten The new Please test this sequence:
The final UI, shared POS settings store, and warning banner must reflect the successfully saved enabled value. A stale GET must not overwrite it. Also test the reverse transition and failed PUT responses. 2. Coordinate with PR #1132 PR #1132 also changes KDS/KOT hydration and save handling in Please review the latest #1132 implementation before changing this PR. The two fixes should use a single consistent state-management approach. In particular, #1138 currently uses the touch key Prefer reusing the shared kitchen-setting hydration/reconciliation logic rather than adding another independent guard. 3. Add deterministic regression tests Verify:
Preserve the original double-off warning behavior and avoid unrelated Settings changes. Please run the focused Settings and Playwright tests after integrating the fixes, and report the results before merging. |
8a4ce22 to
5a69fe6
Compare
5a69fe6 to
ba864b9
Compare
ba864b9 to
e4f13cb
Compare
Fixes #1087
Intent
Verify and implement the surgical fix for FreeOpenSourcePOS/FloCafe issue #1087 ("Settings Printers tab omits double-off warning on direct load when KDS is also disabled"): in
frontend/src/app/(dashboard)/settings/page.tsx, ensure the Printers tab hydrates KDS enabled state on direct tab load so the double-off warning renders when both KOT and KDS are disabled. Deliver via theno-mistakespipeline as its own PR withFixes #1087in the PR summary.What Changed
/settings/kds_enabledalongside/settings/kot_printing_enabledwhen hydrating thereceipts-printerstab infrontend/src/app/(dashboard)/settings/page.tsx, and treat a404on/settings/kds_enabledduring post-failure reconciliation as the default enabled (true) state.frontend/e2e/settings-request-budget.spec.tsfor direct Printers tab loads when KDS is disabled or enabled, as well as cross-tab KDS/Printers transitions whilekds_enabledsaves are in flight or fail.Fixes #1087
Risk Assessment
✅ Low: The change surgically adds KDS enabled hydration on the Printers settings tab using existing optional-read and versioned kitchen-setting reconciliation helpers, backed by browser E2E tests covering direct tab load and cross-tab pending/failed saves.
Testing
Built the backend and static frontend, ran the targeted Playwright settings hydration/concurrency/request-budget suites and backend KDS/KOT toggle integration tests, and drove the live application in Chromium against the real SQLite-backed Express server to capture visual screenshot evidence of the Printers tab double-off warning on direct load, suppression when KDS is enabled, and reconciliation after cross-tab KDS save races; all checks and scenarios passed.
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.
npm run build && npm run build:frontendcd frontend && npx playwright test e2e/settings-request-budget.spec.ts -g "Store Settings does not hydrate inactive tabs|Rapid Settings navigation stays below the read rate limit|Printers tab hydrates KDS enabled state on direct load|Direct KDS tab load hydrates KOT state|Failed kitchen setting saves before initial hydration|Switching from Printers to KDS while KOT save is pending|Rapid repeated kitchen setting changes|Tenant switch while KDS/KOT requests are pending|Direct Printers tab load hides double-off warning|Switching from KDS to Printers while KDS save is pending"npm run test:issue-133-kds-kot-togglescd frontend && npx playwright test e2e/settings-e2e-read-budget.spec.tsLive Chromium E2E verification against real Express/SQLite backend capturing visual evidence in~/.no-mistakes/evidence/01M4W4B8ZB1Z3H08AXTYDRP1TZ✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.