Repository navigation
feat: driver assignment drag-and-drop, load matching board, dispute resolution portal, dispute service - #916
Merged
johdanike merged 2 commits intoOct 5, 2026
Conversation
…hing board, dispute portal, dispute service Implements four assigned issues following the Component -> Hook -> Service layering used elsewhere in the app: - DriverAssignmentPanel (SwiftChainn#834): drag-and-drop interface for assigning pending shipments to drivers, built on @dnd-kit/core (added as a dependency, named in the issue's technical scope but not previously installed). Dropping a shipment card on a driver opens a confirmation modal before the assignment API call fires; a success notification appears afterward. Falls back to a stacked list layout on mobile instead of the drag-and-drop grid. - BiddingBoard (SwiftChainn#838): board of bulk delivery contracts with cargo type, route, timeline, and base rate, a custom bid form with numeric validation, and a cargo type/region/rate-range filter bar. The underlying TanStack Query hook uses keepPreviousData so the filter bar and existing results stay visible while a new filter combination loads, rather than the whole board unmounting to a loading state on every keystroke. - DisputeResolutionPortal and EvidenceDropzone (SwiftChainn#842): multi-step dispute filing flow (issue selection, evidence upload, confirmation) using react-dropzone (already a declared dependency, not yet installed) for drag-and-drop or click-to-upload of images and video up to 10MB, with previews and per-file removal. Shows an escrow-freeze warning before submission and the assigned case ID afterward. - disputeService (SwiftChainn#845): fileDispute, uploadEvidence (with axios onUploadProgress wired to a 0-100 percentage callback), freezeEscrow, getDisputeStatus, and resolveDispute, each typed and each rejecting with a normalized APIError ({ message, statusCode, code }) instead of a raw axios error. Also fixes components/ui/ThemeToggle.tsx, the same pre-existing break found and fixed in a companion PR on this same upstream repo: it imported the broken custom hooks/useTheme.ts (which calls methods that don't exist on services/themeService.ts, and whose own return shape doesn't match what ThemeToggle destructures), which broke app/layout.tsx and therefore every route in both dev and prod. Redirected it to next-themes' own useTheme, which is what components/shared/ThemeProvider.tsx already uses elsewhere in the app. hooks/useTheme.ts and services/themeService.ts are untouched and still orphaned, dead code; out of scope here. Pre-existing, unrelated to this PR: app/page.tsx has an unbalanced JSX tag that fails both `next build` and `tsc --noEmit`, blocking production builds repo-wide even after the ThemeToggle fix above. Reproduced on a clean checkout of this branch's base commit. escrow/DisputeForm.tsx, hooks/useDisputeForm.ts, and services/escrowService.ts also remain broken (escrowService.ts imports the uninstalled stellar-sdk package); the new dispute-resolution code in this PR does not build on that precedent. 62 new tests across 9 suites, 97%+ statement coverage on all new files. Closes SwiftChainn#834 Closes SwiftChainn#838 Closes SwiftChainn#842 Closes SwiftChainn#845
|
@theladyanina Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Contributor
|
Multiple merge conflicts, please resolve. |
…uilt features at colliding paths Three different contributors independently built real, non-overlapping features and happened to name components identically, producing 5 add/add conflicts: - components/fleet/DriverAssignmentPanel.tsx, hooks/useDriverAssignment.ts, services/driverAssignmentService.ts: this branch's version implements real drag-and-drop via @dnd-kit/core, the literal requirement of issue SwiftChainn#834. The version already on main (from an earlier, different PR) used click-to-assign as a stated workaround for dnd-kit not being a dependency at the time. Kept this branch's version; removed its now-superseded test at the old click-to-assign API shape. - components/driver/BiddingBoard.tsx and components/escrow/ DisputeResolutionPortal.tsx: these paths collided with a different, already-merged feature (by a third contributor, closing different issues SwiftChainn#840/SwiftChainn#846) that is functionally unrelated to this branch's bulk-contract load-matching board (SwiftChainn#838) and dispute-case portal (SwiftChainn#842). Restored the already-merged versions at their original paths (byte-identical to upstream/main) and renamed this branch's versions to LoadMatchingBoard.tsx / DisputeCasePortal.tsx (plus their co-located tests) so both real features coexist. Their supporting hooks/services/types (useLoadMatching, useDisputeCase, loadMatchingService, disputeService, types/loadMatching, types/dispute) were already uniquely named and merged without conflict. Verified: the 4 directly affected test suites (LoadMatchingBoard, DisputeCasePortal, DriverAssignmentPanel, and the restored DisputeResolutionPortal) pass in full (47/47). Remaining typecheck/test failures elsewhere in the repo are pre-existing on upstream/main, confirmed unrelated to any file this resolution touched.
johdanike
approved these changes
Oct 5, 2026
johdanike
left a comment
Contributor
There was a problem hiding this comment.
extensive work done, thanks for contributing to Swiftchainn
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
Closes #834
Closes #838
Closes #842
Closes #845
Implements four assigned issues following this repo's Component -> Hook -> Service layering.
#834: DriverAssignmentPanel (drag-and-drop shipment assignment)
types/driverAssignment.ts,services/driverAssignmentService.ts,hooks/useDriverAssignment.ts,components/fleet/DriverAssignmentPanel.tsx@dnd-kit/core(added as a dependency; named in the issue's technical scope but not previously installed). Pending shipments render as draggable cards, drivers as drop zones. Dropping a shipment on a driver opens a confirmation modal before the assignment API call fires, and a success notification appears afterward. Falls back to a stacked list layout on mobile (lg:hidden/hidden lg:grid) instead of the drag-and-drop grid.#838: BiddingBoard (courier load matching with bid negotiation)
types/loadMatching.ts,services/loadMatchingService.ts,hooks/useLoadMatching.ts,components/driver/BiddingBoard.tsxkeepPreviousData, so the filter bar and existing results stay visible while a new filter combination loads rather than the whole board unmounting to a loading state on every filter change. Once a bid exists for a contract, its status badge (submitted/accepted/rejected/expired) replaces the bid form.#842: DisputeResolutionPortal + EvidenceDropzone (evidence upload media dropzone)
components/escrow/DisputeResolutionPortal.tsx,components/escrow/EvidenceDropzone.tsxreact-dropzone(already a declared dependency in package.json, just not yet installed) for drag-and-drop or click-to-upload of images and video up to 10MB, with previews and per-file removal. Shows a prominent escrow-freeze warning before submission and the assigned case ID afterward.#845: disputeService
types/dispute.ts,services/disputeService.ts,hooks/useDisputeCase.tsfileDispute,uploadEvidence(axiosonUploadProgresswired to a 0-100 percentage callback),freezeEscrow,getDisputeStatus,resolveDispute, each typed and each rejecting with a normalizedAPIError({ message, statusCode, code }) instead of a raw axios error, per the issue's acceptance criteria.Also included: ThemeToggle fix (blocking issue for screenshots)
components/ui/ThemeToggle.tsximportedhooks/useTheme.ts, which calls methods that don't exist onservices/themeService.ts, and whose own return shape doesn't match whatThemeToggledestructures. SinceThemeToggleis rendered fromapp/layout.tsx, this broke every route in both dev and prod. RedirectedThemeToggleto importuseThemefrom thenext-themespackage instead, matching whatcomponents/shared/ThemeProvider.tsxalready uses elsewhere in the app.hooks/useTheme.tsandservices/themeService.tsthemselves are untouched; they're orphaned, dead code and fixing them is out of scope here. (This is the same fix as a companion PR on this same upstream repo, since both hit the identical pre-existing break.)Pre-existing issues found (not fixed, out of scope for this PR)
app/page.tsxhas an unbalanced JSX tag that fails bothnext buildandtsc --noEmit, blocking production builds for the entire repo even after the ThemeToggle fix above. Reproduced on a clean checkout of this branch's base commit, unrelated to any file touched here.escrow/DisputeForm.tsx/hooks/useDisputeForm.ts/services/escrowService.tsare broken due to a missingstellar-sdkdependency. The new dispute-resolution code in this PR does not build on that precedent.Test plan
npx jeston all new/touched test files: 9 suites, 62 tests passing, 97%+ statement coverage across all new filesnpx tsc --noEmit: no new errors (only the pre-existing, unrelatedapp/page.tsxandCheckoutFlow.keyboard.test.tsxfailures noted above)npx eslint: 0 errors on all touched files (a few pre-existing-style warnings from an unused-vars rule flagging documentation-only parameter names in function-type signatures)git stashagainst a clean checkout, not introduced by this PRScreenshots
Test suite passing (62/62, coverage table):
Components rendered (DriverAssignmentPanel, BiddingBoard, DisputeResolutionPortal):