Repository navigation
feat(booking): added my bookings - #383
Merged
Merged
Conversation
peng-0110
previously approved these changes
Nov 18, 2026
peng-0110
left a comment
Contributor
There was a problem hiding this comment.
Good work. Just a few things I noticed while reviewing the PR.
Must fix
- CI no longer compiles. The build now fails before any test runs: AppNavHostTest.kt:1074: Unresolved reference 'onAllNodesWithTag'. It's a missing import: import androidx.compose.ui.test.onAllNodesWithTag.
- The new retry test will likely fail once it compiles (BookingListScreensTest.kt, lenderBookingsScreen_retriesLoadAndCancelsBooking). It clicks Retry first and only then clears repository.loadFailure. The ViewModel probably starts the reload on the click itself, so the reload fails again and waitUntil times out. Clearing loadFailure = null before performClick() fixes it. I haven't run it, but the order is wrong either way.
- Finished bookings can be cancelled. Cancel shows on every booking that isn't already cancelled, and the rules accept it. A completed rental can be rewritten as cancelled, which corrupts the lender's history. Hide Cancel when all of a booking's days are before today, and ideally refuse it in the rules too.
- Lenders can't tell requests apart. Rows show only the dates and the status. A lender with two requests can't know which renter's booking they're cancelling. Showing the renter's name on the lender screen, and the listing title on "My bookings", fixes this.
Can fix (cheap)
5. Sort bookings by date. Right now they come back in Firestore document-ID order, which is effectively random.
6. Retry after a refused cancel only reloads the list. It doesn't retry the cancel. Either retry the cancel, or show a plain dismissable error for cancel failures.
peng-0110
requested changes
Nov 18, 2026
peng-0110
left a comment
Contributor
There was a problem hiding this comment.
Meant to Request Changes in previous Review
|
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 #361 and #362. Adds renter ("My bookings") and lender ("Booking requests") screens wired to
BookingViewModel, showing loading, cancellation and error states, with entry points from Profile and the owner's listing detail.What
BookingViewModel:loadListingBookings(listingId)for the lender, sharing one load path withloadRenterBookings.BookingListScreens.kt:RenterBookingsScreen,LenderBookingsScreenandBookingListContent, with an IDE preview. They show a loading spinner, an error banner with Retry, an empty state and a "Cancelling…" row state. A cancelled booking stays listed as cancelled, and a cancellation the server rejects is shown with the restored status and an error.renter_bookingsandlender_bookings/{listingId}inRoutesandAppNavHost.FakeBookingRepositorynow supports listing bookings.loadListingBookingsViewModel test andBookingListScreensTest(7 Compose tests for cancel, cancelling, cancelled, loading, error, and offline rejection).Why
Cancellation and loading existed in the ViewModel and repository but had no screen, so users could not see or cancel their bookings. Offline cancellations that the server rejects later must be visible to the user, not silently reverted.
Validation
./gradlew testDebugUnitTest --tests '*BookingListScreensTest' --tests '*BookingViewModelTest': passed (7 and 19 tests, 0 failures)../gradlew compileDebugKotlin: passed../gradlew ktfmtFormatrun.Follow-ups
AI use
Copilot wrote code. I reviewed it and tested it.