Feature/dashboard api integration - #41
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 19
Note
Due to the large number of review comments, Critical, Major severity comments were prioritized as inline comments.
🟡 Minor comments (8)
src/components/Dashboard/IngredientsView.jsx-318-320 (1)
318-320: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winRename the upload CTA to ingredients, not menu.
This screen uploads ingredient files, so “Upload Menu csv” is misleading user-facing copy.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/components/Dashboard/IngredientsView.jsx` around lines 318 - 320, The upload CTA copy in IngredientsView is misleading because it still says “Upload Menu csv” for an ingredients upload flow. Update the selectedFile label text in the IngredientsView component so the default prompt references ingredients instead of menu, keeping the existing selectedFile.name fallback behavior unchanged.src/components/Dashboard/OrdersView.jsx-47-56 (1)
47-56: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winClamp ring percentages before computing the SVG offsets.
When sales/orders exceed the target,
strokeDashoffsetgoes negative and the ring wraps past a full circle. The text can still show>100%, but the geometry should be capped at 100.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/components/Dashboard/OrdersView.jsx` around lines 47 - 56, Clamp the ring values before calculating the SVG stroke offsets in OrdersView so the circles never wrap past a full turn; the current use of salesPct and orderPct in the strokeDashoffset math can go negative when targets are exceeded. Update the percentage handling near the SVG circles to use capped values for the geometry (100 max) while leaving the displayed label logic based on displayPct/Math.round(salesPct) unchanged if it should still show values above 100.src/components/Dashboard/shared/StatusBadge.jsx-18-18 (1)
18-18: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winUse a darker foreground for
Queue.
bg-yellow-500 text-whiteis hard to read at the badge’s 11px text size. A darker text color or lighter yellow background keeps the new status legible.Suggested fix
- Queue: "bg-yellow-500 text-white", + Queue: "bg-yellow-100 text-yellow-800",🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/components/Dashboard/shared/StatusBadge.jsx` at line 18, The Queue badge style in StatusBadge should use a more legible foreground against the yellow background. Update the Queue entry in the status-to-class mapping to replace text-white with a darker text color or otherwise soften the yellow background so the 11px label remains readable.src/utils/sortItems.js-19-23 (1)
19-23: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
"1.2k"is still sorted as1.2.
parseNum()drops the suffix and only parses the leading numeric fragment, so the documented"1.2k"case sorts below"950"instead of above it. Either expand the parser fork/m/bsuffixes or remove that example from the contract.Suggested fix
const parseNum = (val) => { if (typeof val === "number") return val; - const match = String(val).match(/[\d.]+/); - return match ? parseFloat(match[0]) : NaN; + const match = String(val).trim().toLowerCase().match(/^(-?\d+(?:\.\d+)?)([kmb])?/); + if (!match) return NaN; + const base = parseFloat(match[1]); + const multiplier = { k: 1e3, m: 1e6, b: 1e9 }[match[2]] ?? 1; + return base * multiplier; };🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/utils/sortItems.js` around lines 19 - 23, The parseNum helper in sortItems is only extracting the leading numeric fragment, so values like "1.2k" are treated as 1.2 instead of 1200. Update parseNum to recognize common magnitude suffixes such as k, m, and b before falling back to plain numeric parsing, and keep the sort logic in sortItems aligned with the documented examples.src/components/Dashboard/LiveKitchen/constants.js-7-10 (1)
7-10: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winRename the Ready-column action to match the actual transition.
The last kanban column sends
nextStatus: "done"but still labels the CTA as"Ready". That makes the button disagree withSTATUS_FLOW, so users see a "Ready" action that actually completes the order.Suggested fix
export const COLUMNS = [ { key: "queue", label: "Order Queue", action: "Start Preparing", nextStatus: "preparing", prevStatus: null }, { key: "preparing", label: "Preparing", action: "Prepared", nextStatus: "ready", prevStatus: "queue" }, - { key: "ready", label: "Ready", action: "Ready", nextStatus: "done", prevStatus: "preparing" }, + { key: "ready", label: "Ready", action: "Mark Done", nextStatus: "done", prevStatus: "preparing" }, ]; @@ - if (action === "Ready") return "bg-[`#16A34A`] text-white border border-transparent hover:bg-green-700 shadow-sm"; + if (action === "Mark Done") return "bg-[`#16A34A`] text-white border border-transparent hover:bg-green-700 shadow-sm";Also applies to: 25-29
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/components/Dashboard/LiveKitchen/constants.js` around lines 7 - 10, The last entry in COLUMNS has an action label that does not match its actual status transition. Update the Ready column’s action in the COLUMNS constant so it reflects the done transition used by nextStatus: "done", and keep it consistent with STATUS_FLOW and the related rendering in the LiveKitchen dashboard.src/components/Dashboard/LiveKitchen/constants.js-59-70 (1)
59-70: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winMerge later ticket metadata for the same chef.
buildChefsFromTickets()locksdisplayName,station, andstatusto the first ticket seen for a chef. If that first ticket has fallback values and a later ticket has the real metadata,ChefManagementkeeps showingChef #…,UNASSIGNED, orACTIVEincorrectly.Suggested fix
safe.forEach((t) => { if (t.assignedChefId == null) return; - if (!chefsMap.has(t.assignedChefId)) { - chefsMap.set(t.assignedChefId, { - id: t.assignedChefId, - displayName: t.chefDisplayName || `Chef #${t.assignedChefId}`, - station: t.chefStation || "UNASSIGNED", - status: t.chefStatus || "ACTIVE", - ticketCount: 0, - }); - } - chefsMap.get(t.assignedChefId).ticketCount += 1; + const chef = chefsMap.get(t.assignedChefId) ?? { + id: t.assignedChefId, + displayName: `Chef #${t.assignedChefId}`, + station: "UNASSIGNED", + status: "ACTIVE", + ticketCount: 0, + }; + + if (t.chefDisplayName) chef.displayName = t.chefDisplayName; + if (t.chefStation) chef.station = t.chefStation; + if (t.chefStatus) chef.status = t.chefStatus; + chef.ticketCount += 1; + + chefsMap.set(t.assignedChefId, chef); });🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/components/Dashboard/LiveKitchen/constants.js` around lines 59 - 70, In buildChefsFromTickets(), the chef metadata is only initialized once in the chefsMap entry, so later tickets for the same assignedChefId cannot replace fallback displayName, station, or status values. Update the existing entry when iterating safe tickets so the latest non-fallback chefDisplayName, chefStation, and chefStatus are merged into the chef record while still incrementing ticketCount. Keep the fix localized to buildChefsFromTickets() in constants.js and preserve the current ticket aggregation logic.src/services/mappers/dashboardMappers.js-141-142 (1)
141-142: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winDerive
statusLabelfrom the normalized status.When
data.statusis missing, Line 141 falls back to"PENDING"but Line 142 still indexesORDER_STATUS_LABELS[data.status], sostatusLabelbecomesundefinedinstead of"Pending".Suggested fix
-export const mapOrderResponse = (data) => ({ - id: data.id, - customerId: data.customerId, - status: data.status || "PENDING", - statusLabel: ORDER_STATUS_LABELS[data.status] || data.status, +export const mapOrderResponse = (data) => { + const status = data.status || "PENDING"; + return { + id: data.id, + customerId: data.customerId, + status, + statusLabel: ORDER_STATUS_LABELS[status] || status, totalPrice: data.totalPrice || 0, discount: data.discount || 0, createdAt: data.createdAt || null, @@ - : [], -}); + : [], + }; +};🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/services/mappers/dashboardMappers.js` around lines 141 - 142, The `statusLabel` mapping in `mapDashboardOrder` is using the raw `data.status` instead of the normalized fallback value, so missing statuses don’t resolve to the expected label. Update the `status`/`statusLabel` logic together so `statusLabel` is derived from the same normalized status value used by the `status` field, ensuring the default `"PENDING"` maps to the corresponding label in `ORDER_STATUS_LABELS`.src/components/Dashboard/shared/InactiveMenuModal.jsx-8-10 (1)
8-10: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick winBlock parallel uploads while the shared mutation is pending.
This modal has one file input and one mutation state. Leaving the other rows enabled during
isPendingletsselectedItemIdswitch mid-upload, so the loading state can jump to the wrong item.Suggested fix
- disabled={isPending && selectedItemId === item.id} + disabled={isPending}Also applies to: 114-116
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/components/Dashboard/shared/InactiveMenuModal.jsx` around lines 8 - 10, Block item switching while the shared upload mutation is pending in InactiveMenuModal. Use the existing isPending state from useUpdateMenuItem alongside selectedItemId so other rows cannot trigger a new selection or upload until updateMeal finishes, preventing the loading indicator from moving to the wrong item. Update the row disable/interaction logic in InactiveMenuModal and any related handlers that read selectedItemId so they respect the pending state.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/components/Dashboard/ChefMenuView.jsx`:
- Around line 98-103: The category count logic in ChefMenuView is falling back
to the backend value when there are no active dishes, which hides real zero
counts. Update the categoryCounts mapping so it uses the filtered activeItems
match count directly and preserves 0 instead of applying the `cat.count`
fallback in the count calculation. Use the `categoryCounts` mapping in
`ChefMenuView` as the place to adjust this behavior.
- Around line 206-210: The table row click handler in ChefMenuView is
mouse-only, so keyboard users can’t open DishDetailsModal. Update the row
rendering around the onClick on the <tr> element to make it keyboard reachable
by adding appropriate focus/role semantics and a keyboard handler that triggers
setViewingItem(item) for Enter/Space, while keeping the existing click behavior.
In `@src/components/Dashboard/IngredientsView.jsx`:
- Around line 57-60: The add/delete handlers in IngredientsView are wired to
mutation hooks, but the underlying dashboardService methods still always reject,
so those actions can never succeed. Update the service functions used by
useUploadIngredients and useDeleteIngredient in dashboardService.js to perform
the real create/delete API logic instead of unconditionally returning rejected
Promises, and make sure the IngredientsView mutation handlers continue calling
those hooks for create/remove flows.
- Around line 80-81: The delete flow in IngredientsView is currently dead
because the table’s Actions column only renders Edit while handleDelete and the
confirm modal logic still exist. Update the Actions cell rendering in
IngredientsView to include a Delete action that calls handleDelete, and make
sure the confirm modal still uses the existing deletion state/handlers so the
delete path is reachable and the unused handleDelete lint error is resolved.
In `@src/components/Dashboard/LiveKitchen/ChefManagement.jsx`:
- Around line 22-38: The icon-only controls in ChefManagement.jsx are missing
accessible names, so the edit/save/cancel buttons are announced as unlabeled
buttons. Update the button elements in the inline name editor to include
meaningful accessible labels, such as aria-label or equivalent text, for the
edit toggle, handleSave, and handleCancel actions so screen readers can identify
each control.
- Around line 8-16: The edit buffer in ChefManagement’s `useState` for `value`
is only initialized from `currentName` once, so later server-side name updates
can leave `handleSave` and `handleCancel` working with stale data. Update the
component to sync `value` whenever `currentName` changes, using the existing
`editing`, `setValue`, and `handleCancel`/`handleSave` flow so reopening an edit
session reflects the latest name instead of reverting it.
In `@src/components/Dashboard/LiveKitchen/OrderCards.jsx`:
- Around line 48-51: The clickable cards in OrderCards currently rely on a div
with onViewOrder, which is not keyboard-accessible. Update the card wrappers in
OrderCards to use an interactive element or add proper keyboard handling and
accessibility attributes so users can trigger onViewOrder with Enter/Space as
well as a pointer, and apply the same fix to both card instances mentioned in
the component.
In `@src/components/Dashboard/LiveKitchenView.jsx`:
- Around line 154-159: Propagate the active tickets query state into
ChefManagement instead of only passing tickets from LiveKitchenView. Update the
useActiveTickets() consumer so it forwards loading/error state alongside
tickets, and adjust ChefManagement to render the empty state only when the query
has successfully completed with no data. This avoids showing “No chefs found”
while the tickets query is still loading or has failed.
- Around line 123-129: The “Not Done” revert path in LiveKitchenView is no
longer reachable because the done-board rendering only passes `onViewOrder` to
DoneCard, while `orderToRevert` and `confirmRevert` are still expecting a
trigger. Update the done section in LiveKitchenView and the DoneCard wiring so a
completed order can still set `orderToRevert` before opening the revert
confirmation, keeping the existing revert flow functional.
In `@src/components/Dashboard/MenuManagementView.jsx`:
- Around line 18-34: The `useMemo` in `MenuManagementView` returns a `today`
value that is never used, and the destructuring keeps an unused binding that
triggers lint errors. Remove `today` from the returned object and from the
`useMemo` destructuring, while keeping the other values (`todayDate`,
`monthName`, `dayDisplay`, `calendarDays`) unchanged.
In `@src/components/Dashboard/OrdersView.jsx`:
- Around line 25-33: The shared sorter’s numeric parsing breaks the OrdersView
time column because sortItems() only compares the first number in a string, so
time values like “10:05 AM” and “10:55 AM” collapse to the same sort key. Update
the sorting logic used for the time field in OrdersView/ORDER_SORT_COLS so it
sorts by actual clock time instead of the first numeric run, either by adding a
time-specific comparator or by normalizing/parsing the time value before
comparing.
In `@src/components/Dashboard/RecipeBuilderView.jsx`:
- Around line 25-27: The save flow in RecipeBuilderView is collecting time and
nutrition fields, but useCreateMenuItem and useUpdateMenuItem are stripping
those values before the API call, so saved recipes lose data. Update the
mutation payload handling in RecipeBuilderView and the create/update hooks so
handleSave() passes through time, fat, calories, protein, and sugar unchanged,
and ensure the logic in useCreateMenuItem/useUpdateMenuItem no longer removes
these fields from the request body.
In `@src/hooks/dashboard/useMenuItems.js`:
- Around line 51-58: The payload built in useMenuItems’s mutation functions is
dropping recipe-builder fields that RecipeBuilderView collects. Update both
create/edit mutation payloads to include time, fat, calories, protein, and sugar
alongside the existing fields, so the service receives the full form data from
data in the mutationFn.
- Around line 60-64: Treat the image upload in `useMenuItems`
(`updateMenuItem`/create flow around `uploadMealImage`) as a partial-success
step instead of part of the main mutation. Keep the meal save committed first,
then call `uploadMealImage(id, data.imageFile)` in a separate try/catch so a
failed upload does not reject the already-successful create/update; surface the
upload failure separately (e.g. as a warning or follow-up error state) without
rolling back the saved meal.
In `@src/mocks/handlers.js`:
- Around line 448-453: The active-ticket mock payload in the tickets handler is
not matching what KitchenTicketsTable expects, which causes double-prefixed
order IDs and missing chef assignment data. Update the ticket objects built in
the handler that pushes into tickets so the shape includes the fields used by
KitchenTicketsTable.jsx, especially aligning orderId so it renders correctly
with #{ticket.orderId}, and populating chefDisplayName and assignedChefId
instead of only assignedChef. Make the changes in the ticket-generation logic
that currently sets id, orderId, status, assignedChef, and createdAt so mock
mode renders the same data the table reads.
- Around line 465-481: The PATCH matcher in the tickets status handler only
accepts numeric ids, so it misses the alphanumeric ids returned by GET /active.
Update the match logic in the mock handler that processes
/api/kitchen/tickets/.../status (and the related MOCK_HANDLERS lookup if needed)
so it matches the same id format emitted by the active tickets endpoint, then
keep the direct forwarding to the kanban status handler in sync with that id.
In `@src/services/dashboardService.js`:
- Around line 133-135: The create/delete ingredient flows are wired to service
methods that always reject, so the UI in IngredientsView still exposes actions
that can never succeed. Update the Dashboard ingredient UX to stop offering the
add and delete paths from src/components/Dashboard/IngredientsView.jsx, or gate
them behind a backend-supported implementation using createIngredient and
deleteIngredient only when they no longer hard-reject. Make sure any modal,
delete confirmation, and action buttons tied to those methods are removed,
disabled, or hidden so users cannot trigger guaranteed failures.
In `@src/services/mappers/dashboardMappers.js`:
- Around line 216-221: The dashboard mapper is dropping the existing ingredients
field and only returning mealIngredients, which causes RecipeBuilderView,
useMenuItems, and InactiveMenuModal to lose or overwrite recipe data. Update the
mapping in dashboardMappers so the mapped item preserves ingredients alongside
mealIngredients, keeping the original ingredients value intact when spreading or
serializing menu items. Make sure the mapper’s returned object still includes
ingredients from the source item rather than defaulting it to an empty array.
In `@src/store/authStore.js`:
- Line 49: The default value for `isAuthenticated` in `authStore` is causing a
security bypass because it is not persisted by `partialize` and therefore resets
on every load. Update the initializer in `authStore` to start `isAuthenticated`
as false, and ensure only the `login` and `restoreSession` flows set it to true
after successful authentication. Verify the auth gating logic used by
`ProtectedRoute` and `StaffRoute` continues to rely on this flag.
---
Minor comments:
In `@src/components/Dashboard/IngredientsView.jsx`:
- Around line 318-320: The upload CTA copy in IngredientsView is misleading
because it still says “Upload Menu csv” for an ingredients upload flow. Update
the selectedFile label text in the IngredientsView component so the default
prompt references ingredients instead of menu, keeping the existing
selectedFile.name fallback behavior unchanged.
In `@src/components/Dashboard/LiveKitchen/constants.js`:
- Around line 7-10: The last entry in COLUMNS has an action label that does not
match its actual status transition. Update the Ready column’s action in the
COLUMNS constant so it reflects the done transition used by nextStatus: "done",
and keep it consistent with STATUS_FLOW and the related rendering in the
LiveKitchen dashboard.
- Around line 59-70: In buildChefsFromTickets(), the chef metadata is only
initialized once in the chefsMap entry, so later tickets for the same
assignedChefId cannot replace fallback displayName, station, or status values.
Update the existing entry when iterating safe tickets so the latest non-fallback
chefDisplayName, chefStation, and chefStatus are merged into the chef record
while still incrementing ticketCount. Keep the fix localized to
buildChefsFromTickets() in constants.js and preserve the current ticket
aggregation logic.
In `@src/components/Dashboard/OrdersView.jsx`:
- Around line 47-56: Clamp the ring values before calculating the SVG stroke
offsets in OrdersView so the circles never wrap past a full turn; the current
use of salesPct and orderPct in the strokeDashoffset math can go negative when
targets are exceeded. Update the percentage handling near the SVG circles to use
capped values for the geometry (100 max) while leaving the displayed label logic
based on displayPct/Math.round(salesPct) unchanged if it should still show
values above 100.
In `@src/components/Dashboard/shared/InactiveMenuModal.jsx`:
- Around line 8-10: Block item switching while the shared upload mutation is
pending in InactiveMenuModal. Use the existing isPending state from
useUpdateMenuItem alongside selectedItemId so other rows cannot trigger a new
selection or upload until updateMeal finishes, preventing the loading indicator
from moving to the wrong item. Update the row disable/interaction logic in
InactiveMenuModal and any related handlers that read selectedItemId so they
respect the pending state.
In `@src/components/Dashboard/shared/StatusBadge.jsx`:
- Line 18: The Queue badge style in StatusBadge should use a more legible
foreground against the yellow background. Update the Queue entry in the
status-to-class mapping to replace text-white with a darker text color or
otherwise soften the yellow background so the 11px label remains readable.
In `@src/services/mappers/dashboardMappers.js`:
- Around line 141-142: The `statusLabel` mapping in `mapDashboardOrder` is using
the raw `data.status` instead of the normalized fallback value, so missing
statuses don’t resolve to the expected label. Update the `status`/`statusLabel`
logic together so `statusLabel` is derived from the same normalized status value
used by the `status` field, ensuring the default `"PENDING"` maps to the
corresponding label in `ORDER_STATUS_LABELS`.
In `@src/utils/sortItems.js`:
- Around line 19-23: The parseNum helper in sortItems is only extracting the
leading numeric fragment, so values like "1.2k" are treated as 1.2 instead of
1200. Update parseNum to recognize common magnitude suffixes such as k, m, and b
before falling back to plain numeric parsing, and keep the sort logic in
sortItems aligned with the documented examples.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 9ab97c5c-26a4-401c-831d-0e642415b8af
📒 Files selected for processing (24)
src/components/Dashboard/ChefMenuView.jsxsrc/components/Dashboard/IngredientsView.jsxsrc/components/Dashboard/LiveKitchen/ChefManagement.jsxsrc/components/Dashboard/LiveKitchen/KitchenTicketsTable.jsxsrc/components/Dashboard/LiveKitchen/LiveIndicator.jsxsrc/components/Dashboard/LiveKitchen/OrderCards.jsxsrc/components/Dashboard/LiveKitchen/constants.jssrc/components/Dashboard/LiveKitchenView.jsxsrc/components/Dashboard/MenuManagementView.jsxsrc/components/Dashboard/OrdersView.jsxsrc/components/Dashboard/RecipeBuilderView.jsxsrc/components/Dashboard/shared/InactiveMenuModal.jsxsrc/components/Dashboard/shared/IngredientModal.jsxsrc/components/Dashboard/shared/MenuModal.jsxsrc/components/Dashboard/shared/MetricRingCard.jsxsrc/components/Dashboard/shared/StatusBadge.jsxsrc/hooks/dashboard/useKitchenOrders.jssrc/hooks/dashboard/useMenuItems.jssrc/mocks/dashboardMock.jssrc/mocks/handlers.jssrc/services/dashboardService.jssrc/services/mappers/dashboardMappers.jssrc/store/authStore.jssrc/utils/sortItems.js
💤 Files with no reviewable changes (1)
- src/components/Dashboard/shared/MenuModal.jsx
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.env:
- Line 7: The default environment value is enabling mock-backed API behavior,
which causes the app to bypass the real backend. Update the .env configuration
so mock mode is opt-in only, keeping the default off, and make sure any
references in src/services/api.js continue to read the flag without changing its
semantics for local development overrides.
In `@src/components/Dashboard/ChefMenuView.jsx`:
- Line 215: The keyboard handler on ChefMenuView’s item wrapper is also reacting
to Enter/Space events coming from the nested Edit/Delete action buttons, which
causes the details modal to open instead of the button action. Update the
onKeyDown logic around setViewingItem so it ignores bubbled events from
interactive children (for example by checking the event target/currentTarget
relationship or guarding against button-like descendants) before handling Enter
or Space.
In `@src/components/Dashboard/LiveKitchen/OrderCards.jsx`:
- Around line 48-54: The card keyboard handler is still firing on inner action
buttons, so Enter/Space on those buttons can also trigger onViewOrder. Update
the clickable controls inside OrderCards and DoneCard by stopping keydown
propagation on the inner buttons, not just click propagation, so the parent
card’s onKeyDown only runs when focus is on the card itself. Apply the fix to
the Undo/status action/Not Done buttons and keep onViewOrder isolated to the
card container.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: b555652a-78c8-43fc-a35c-5109627e47ce
📒 Files selected for processing (16)
.envsrc/components/Dashboard/ChefMenuView.jsxsrc/components/Dashboard/IngredientsView.jsxsrc/components/Dashboard/LiveKitchen/ChefManagement.jsxsrc/components/Dashboard/LiveKitchen/OrderCards.jsxsrc/components/Dashboard/LiveKitchen/constants.jssrc/components/Dashboard/LiveKitchenView.jsxsrc/components/Dashboard/MenuManagementView.jsxsrc/components/Dashboard/OrdersView.jsxsrc/components/Dashboard/shared/InactiveMenuModal.jsxsrc/components/Dashboard/shared/StatusBadge.jsxsrc/hooks/dashboard/useMenuItems.jssrc/mocks/handlers.jssrc/services/dashboardService.jssrc/services/mappers/dashboardMappers.jssrc/utils/sortItems.js
🚧 Files skipped from review as they are similar to previous changes (7)
- src/components/Dashboard/shared/StatusBadge.jsx
- src/components/Dashboard/LiveKitchen/constants.js
- src/hooks/dashboard/useMenuItems.js
- src/mocks/handlers.js
- src/services/mappers/dashboardMappers.js
- src/utils/sortItems.js
- src/components/Dashboard/MenuManagementView.jsx
Summary by CodeRabbit
New Features
Bug Fixes