Repository navigation
Restyle the loan request sheet after the web's loan calendar - #46
Conversation
The sheet is a plain dialog instead of DatePickerDialog, which capped its height and cut the month in half: 20dp corners, a Fraunces title, confirm and cancel stacked at full width in the app's button styles. The month follows the web: a free day is a plain number, limited and unavailable days keep their tint with a faint rule of their own colour, today has an accent ring and the chosen day takes the theme's button colour. The legend uses dots. When availability cannot be loaded, the fallback Material picker takes the sheet's side padding too: on a 360dp phone its seventh column was otherwise cut in half. LoanRequestSheetUiTest covers the buttons, the pre-selected earliest day, the disabled states and the seventh column at 360dp (verified to fail without the fix). DESIGN.md documents the sheet.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
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 |
There was a problem hiding this comment.
ℹ️ No critical issues. One device test doesn't exercise what it claims to.
Reviewed changes
Reviewed the single commit that restyles the loan request sheet and its calendar after the web version.
- Sheet container:
DatePickerDialogis replaced by a plainDialog+Surface(20dp corners, 8dp side margin, max 480dp, scrollable), with atitleLarge(Fraunces) title and full-widthPrimaryButton/SecondaryButton. - Fallback picker bleed: the new
Modifier.bleedHorizontally(Spacing.lg)lets Material'sDatePickeruse the sheet's side padding so its seventh column fits on narrow phones. - Calendar tints: free days are untinted. Limited and unavailable days keep their tint plus a ring mixed from their own text colour. The selected day uses the theme's
button/buttonText, and the legend switches to dots. - Tests and docs:
LoanRequestSheetUiTestadds 4 device tests (androidTest now totals 26, which matchesSTATUS.md), andDESIGN.mddocuments the sheet.
claude-opus-5-5 | 𝕏
The test forced a 360dp density around LoanRequestSheet, but a Dialog is a window of its own and takes the device density: on a 411dp emulator the days measured 42dp instead of 48dp, so the test only held on an emulator that was already 360dp wide. The sheet's content moves into LoanRequestSheetContent, which the Dialog wraps; the test lays it out in a 360dp Box at the device density. It fails without the bleed (24dp of a 40dp day in view) and passes with it on both a 360dp and a 411dp emulator.
There was a problem hiding this comment.
✅ No new issues found. The column test now really lays the sheet out at 360dp on any emulator.
Reviewed changes
Reviewed the one commit pushed since the prior review. It fixes the device test that couldn't force a 360dp width.
- Split the sheet from its window:
LoanRequestSheetnow only wraps the newinternalLoanRequestSheetContentin theDialog. TheSurface, theselectedIsostate and the buttons moved over unchanged, so the app behaves the same. - Rewrote the 360dp column test:
fallbackPickerKeepsItsSeventhColumnInsideTheSheetrendersLoanRequestSheetContentdirectly in aBox(Modifier.width(360.dp)). It converts pixels withcompose.density, which is correct because no separateDialogwindow is involved any more. It also drops theLocalDensityoverride and thedisplayMetricspixel factor.
claude-opus-5-5 | 𝕏
There was a problem hiding this comment.
ℹ️ No critical issues. The merge keeps the sheet styling on top of main's calendar. One small fix to
STATUS.mdinline.
Reviewed changes
Reviewed the merge of current main and the new regression tests pushed since the last review.
- Took main's fallback grid: Material's
DatePicker,FallbackDatePickerandbleedHorizontallyare gone. With no availability data, the sheet now showsLoanCalendar(AvailabilityCalendar(), anyFutureDay = true)plus the error note, and keeps the 20dpSurface,titleLargetitle and full-widthPrimaryButton/SecondaryButton. - Kept the
loan-dialogtag for main's tests:LoanRequestSheetwraps the content in aBox(Modifier.testTag("loan-dialog")), soCalendarLayoutTeststill finds the dialog bounds. The stale@OptIn(ExperimentalMaterial3Api::class)annotations are also removed. - Styled main's
DayCellandLegend: free days are untinted, partial and full days get aruled()ring, today has aprimaryring and the selected day usesbutton/buttonText. The legend in main'sFlowRownow shows dots, and the free-day key is a surface dot with anoutlinering. - Pointed the 360dp device test at the grid:
fallbackGridKeepsItsSeventhColumnInsideTheSheetnow reads thecalendar-day-*tags. It still checks that no day overflows the sheet. - Added
LoanCalendarRegressionTest: 15 Robolectric tests cover selectability (free, partial, full,unavailableDates,available = 0, outside the window, past days), the fallback (selectable, no legend), app-locale month names (atsdk = 32), and sheet state (loading, late-arriving availability, the reader's pick, fallback ISO output, a 320×240dp viewport). It uses the sameRuleChainactivity registration as the other tests, sotestReleaseUnitTestpasses as well. - Updated
DESIGN.md: the fallback bullet now describes the shared month grid, not the bledDatePicker.
claude-opus-5-5 | 𝕏
The merge of main had changed the historical 1.6.2 line and its repeat to 26.

The loan request sheet on the book screen now matches the web's loan request.
DatePickerDialog, which capped its height at 568dp and cut the month in half. 20dp corners, 8dp from the screen edges, at most 480dp wide, a Fraunces title, confirm (filled) and cancel (outline) stacked at full width in the app's button styles. It scrolls only on a screen too short for it.button/buttonText. The legend uses dots.DESIGN.mddocuments the sheet and the shared fallback calendar.No API change; works with any Pinakes server that already serves the availability calendar.
Integration and verification
Merged current
mainand resolved both calendar conflicts in favour of its newer fallback, responsive-grid and locale behaviour, keeping the sheet styling. PR #51 builds on this resolution and retains its configured return-date hint; merge #46 before #51.Added 15 JVM/Compose regression tests for availability, disabled days, fallback selection, app locale, loading, selected dates and a short/narrow viewport. Updated the existing instrumented fallback-grid assertion for the shared calendar.
compileDebugAndroidTestKotlinpassed. The instrumented suite was compiled, not rerun on a device during this review.