refactor(order-detail): split OrderDetail into Vue-native components with parity to main - #534
Merged
Merged
Conversation
- Introduce domain models in src/types/orderDetail.ts - Create pure enrichment pipeline in src/utils/orderDetailEnrichment.ts - Add enrichedOrderByOrderId and loadOrderAggregate to orderDetail store - Extract distance and geocoding logic to src/composables/useOrderDistances.ts - Extract order mutation actions and workflows to src/composables/useOrderActions.ts - Streamline OrderDetail.vue to focus on rendering (-746 lines) - Fix missing IonNote import in OrderItemListRow.vue - Add unit tests for enriched store getters
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6fbd21d0a5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…grate transformations
…ensure 1:1 parity with main
Resolve the OrderDetail.vue header conflict with #551 by keeping the OrderSummaryHeader component and porting its anchor-to-ion-button change into that component. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tive The decomposition copied logic between files instead of consolidating it and drifted from main in several places. This reworks it so each fact has one owner and the page behaves exactly as main does. Behaviour restored to main: - Carrier and shipping method selects were always disabled: the precomputed ship group capabilities called the validator with action ids it does not define. Gating now has one path (useOrderActions), used by both the disabled state and the click handler, with selection narrowing restored. - Ship group distances never computed: the composable could not read the getter it was given. It now takes MaybeRefOrGetter and reads coordinates from the enriched ship-to address. - Timeline: item cancellation/rejection and First Brokered entries are back, approved/completed use the earliest status, return links respect the return-view permission, exchange links keep the current route prefix. - Inventory transfer requests pass productStoreId, destinationFacilityId and the open quantity again, honour the selection, and toast on confirm. - Ship group edits surface failures instead of reporting success; the unavailable-action notice is a toast again; customer contact fallback matches purposeTypeIds; brokered dates fall back to the raw facility change rows; attribute rows and the totals card markup match main. - Styles moved with the markup (the parent's scoped CSS no longer reached the children), unchanged from main; the card header grid is shared via a scoped style src. - Issuance labels stay untranslated keys until render, so es-ES keeps the "On hand at sale" note. - Loading fetches issuance only for POS orders and risk only for risk-flagged orders, and no longer blocks product data on the auxiliary sources. Structure: - Children take order/shipGroup props, derive with computed, report intent with defineEmits, and import translate and the formatters. - Selection flows through v-model instead of accessor objects mutated by children; card modal state is per card. - The enrichment builds on the store's existing getters (totals, statuses, events, adjustments) and drops unused dual fields; date, adjustment and product-identity helpers each live in one module. - Dead code, unused imports and the unscoped timeline duplicates are gone. src: 37,722 -> 35,822 lines (main is 36,347). vue-tsc: 57 -> 34 errors (main: 50). Tests: 84 files / 495 passing, with behavioural specs for the enrichment, gating and distances. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Sep 24, 2026
…ions and dead code
- POS issuance: read each line's inventory item from oms/productFacilities, then
its issuance rows from oms/inventoryItem/{id}/detail?orderId=. The order-wide
list main called is not mounted (405), so the badge never rendered.
- Shopify Admin link: drop the oms/orders/{id}/shopifyShopOrder lookup, which
404s on every load (hotwax/oms#798 and #800 closed unmerged). The product-store
inference is now the only path.
- Footer: remove the Return, Appeasement, Reship and Clone modelling. None of
them could render. CloneOrderModal, utils/cloneOrder and its spec go too.
Tracked in #6, #554, #555 and #556.
- Validator: remove the unused discovery helpers and ctx.allItems.
- Store: remove the unused current-order getters, currentOrderId, the
work-effort fetch, the commEvents mirror and the unread risk error state.
- useOrderActions: park, pull back and release share one selection flow; the
allocation call and the task payload are shared too.
- Items tab: item rows bind from one object and the row renders its own
Request transfer and Cancel buttons.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…re the row actions slot - OrderShipGroupCard no longer saves. It keeps its drafts and emits save-fields / save-address; useOrderActions performs the write, shows the toast and reloads, like every other action on the page. - useOrderActions owns which ship group editor is open (v-model:editor on the card), so an editor closes only once its save succeeds and a failed save keeps the draft on screen, as on main. The address save now asks the validator again, like the other handlers. - Every editor's save button is disabled while a save from that card is in flight; the card's close buttons go through one closeEditor method. - OrderItemListRow goes back to its actions slot instead of carrying canTransfer / canCancel props; the items segment still binds each row's props and listeners from one object. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The page read the store's state directly in four places. They now go through getters, so the page no longer depends on how the store lays out its entries: - pendingById: one definition of "not answered yet" (never requested, idle or in flight). The Source card used its own inline version of this, which differed from loadingById. - commEventsForOrder / riskAssessmentsForOrder: the lists, defaulting to []. - The exchange return links use the existing orderById. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dt2patel
added a commit
to AmoghParmar/order-manager
that referenced
this pull request
Sep 26, 2026
main split OrderDetail.vue into components (hotwax#534), so the conflict resolves to main's version; the change is re-applied in the new components in the next commit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Sep 26, 2026
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.
Summary
Splits the 4,081-line
OrderDetail.vueinto a composition shell plus focused, Vue-native pieces, with no behaviour change frommainapart from the bug fixes listed below.views/OrderDetail.vue(364 lines)components/orders/OrderSummaryHeader.vuecomponents/orders/OrderItemsSegment.vuecomponents/orders/OrderShipGroupCard.vuecomponents/orders/OrderHoldsSegment.vue,OrderCommsSegment.vuecomposables/useOrderActions.tscomposables/useOrderDistances.tsutils/orderDetailEnrichment.tsChildren take
order/shipGroupprops, derive withcomputed, report intent withdefineEmits, and importtranslateand the formatters. Selection flows throughv-model. Date, adjustment and product-identity helpers each live in one module (utils/orderDetailDates.ts,utils/orderAdjustments.ts,composables/useProductIdentity.ts), and the card-header grid is shared via<style scoped src>.src/goes from 36,347 lines onmainto 34,987.Deliberate differences from
main(bug fixes)oms/inventoryItem/detail?orderId=, which is not mounted (405), so a POS-completed item never showed whether inventory left the books.oms/productFacilities, then its issuance rows fromoms/inventoryItem/{id}/detail?orderId=. No backend change is needed.oms/orders/{id}/shopifyShopOrderlookup 404'd on every order load: hotwax/oms#798 and #800 closed unmerged, and hotwax/mantle-shopify-connector#381 is open.·is removed from the ship group summary and the hold-task ship group labels, per the AccxUI rules. Time-difference units and the "Customer name" placeholder are now translated.Removed: unreachable footer actions and dead code
HIDE_SHOPIFY_UNSYNCED_ACTIONS, Appeasement and Reship had no handler, and Clone was hidden in 469a024.CloneOrderModal.vue,utils/cloneOrder.tsand its spec.POST oms/returns/appeasementReturn. See Offer Appeasement from the order detail footer #554.getFooterActions,getShipGroupActions,getItemActions,getBulkSelectableItems,isItemSelectable,hasAnyCompletedItem,ctx.allItems).currentOrderIdand 22 unscoped getters that only tests read), plus the order work-effort fetch, thecommEventsmirror and the unread risk error state.useOrderActions(validate, pick the eligible items, prompt, call, clear the selection, toast, reload). The allocation call and the task payload are shared too.actionsslot.save-fields/save-address;useOrderActionssaves, toasts and reloads like every other action, and owns which editor is open (v-model:editor), so an editor closes only when its save succeeds and a failed save keeps the draft on screen, as on main. The address save re-checks the validator like the other handlers, and each editor's Save button is disabled while a save is in flight.pendingByIdgives one definition of "not answered yet" (the exchange Source card had its own inline version, which differed fromloadingById);commEventsForOrderandriskAssessmentsForOrderreturn[]when nothing is loaded; the exchange return links use the existingorderById.Behaviour compared against
mainon rails-uatThe same 16 orders were loaded in both builds side by side and compared section by section (header, Items, Shipgroups, Holds, Comms, footer, and the enabled/disabled state of every control). Every section matched except the
·separator. The orders covered:Also verified:
admin.shopify.com/store/rails-25/orders/7163180122281for 115548.itemAssocs;pendingByIdis equivalent to the inline check it replaces because every store entry is created with a status.Checks
vitest: 85 files / 495 tests pass. The count dropped because the Clone spec was removed with the feature; new specs cover the issuance lookup and the selection actions.vue-tsc --ignoreDeprecations 6.0: 34 errors (main: 50), none in the files this PR touches.vite buildpasses.Not verifiable on rails-uat: distances, because no facility there has a postal address. The new unit test covers it.
🤖 Generated with Claude Code