Skip to content

Restyle the loan request sheet after the web's loan calendar - #46

Merged
fabiodalez-dev merged 4 commits into
mainfrom
fix/loan-calendar-style
Oct 21, 2026
Merged

fabiodalez-dev merged 4 commits into
mainfrom
fix/loan-calendar-style

Conversation

@fabiodalez-dev

@fabiodalez-dev fabiodalez-dev commented Oct 13, 2026 •

Copy link
Copy Markdown
Owner

The loan request sheet on the book screen now matches the web's loan request.

  • Sheet: a plain dialog instead of 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.
  • Month: a free day is a plain number instead of a green tile; limited (amber) and unavailable (error container) days keep their tint, ringed by a faint rule of their own text colour. Today has an accent ring, the chosen day takes the theme's button / buttonText. The legend uses dots.
  • Fallback calendar: keep main's newer responsive month grid, with every future day selectable when availability cannot be fetched. Its availability legend is hidden and a warning explains that the server checks the request. Weekday/month names follow the chosen app language; the legend wraps on narrow screens.
  • DESIGN.md documents 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 main and 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.

  • This branch: 404 debug unit tests passed, no failures or skips.
  • All four open Android PRs combined: 411 debug and 411 release unit tests passed, no failures or skips.
  • compileDebugAndroidTestKotlin passed. The instrumented suite was compiled, not rerun on a device during this review.

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.
@coderabbitai

coderabbitai Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4d7f8928-0ef8-440e-a698-5f964fe29c18
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ 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: DatePickerDialog is replaced by a plain Dialog + Surface (20dp corners, 8dp side margin, max 480dp, scrollable), with a titleLarge (Fraunces) title and full-width PrimaryButton / SecondaryButton.
  • Fallback picker bleed: the new Modifier.bleedHorizontally(Spacing.lg) lets Material's DatePicker use 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: LoanRequestSheetUiTest adds 4 device tests (androidTest now totals 26, which matches STATUS.md), and DESIGN.md documents the sheet.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using claude-opus-5-5 | 𝕏

Comment thread app/src/androidTest/java/com/pinakes/app/LoanRequestSheetUiTest.kt Outdated
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.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ 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: LoanRequestSheet now only wraps the new internal LoanRequestSheetContent in the Dialog. The Surface, the selectedIso state and the buttons moved over unchanged, so the app behaves the same.
  • Rewrote the 360dp column test: fallbackPickerKeepsItsSeventhColumnInsideTheSheet renders LoanRequestSheetContent directly in a Box(Modifier.width(360.dp)). It converts pixels with compose.density, which is correct because no separate Dialog window is involved any more. It also drops the LocalDensity override and the displayMetrics pixel factor.

Pullfrog  | View workflow run | Using claude-opus-5-5 | 𝕏

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ No critical issues. The merge keeps the sheet styling on top of main's calendar. One small fix to STATUS.md inline.

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, FallbackDatePicker and bleedHorizontally are gone. With no availability data, the sheet now shows LoanCalendar(AvailabilityCalendar(), anyFutureDay = true) plus the error note, and keeps the 20dp Surface, titleLarge title and full-width PrimaryButton / SecondaryButton.
  • Kept the loan-dialog tag for main's tests: LoanRequestSheet wraps the content in a Box(Modifier.testTag("loan-dialog")), so CalendarLayoutTest still finds the dialog bounds. The stale @OptIn(ExperimentalMaterial3Api::class) annotations are also removed.
  • Styled main's DayCell and Legend: free days are untinted, partial and full days get a ruled() ring, today has a primary ring and the selected day uses button / buttonText. The legend in main's FlowRow now shows dots, and the free-day key is a surface dot with an outline ring.
  • Pointed the 360dp device test at the grid: fallbackGridKeepsItsSeventhColumnInsideTheSheet now reads the calendar-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 (at sdk = 32), and sheet state (loading, late-arriving availability, the reader's pick, fallback ISO output, a 320×240dp viewport). It uses the same RuleChain activity registration as the other tests, so testReleaseUnitTest passes as well.
  • Updated DESIGN.md: the fallback bullet now describes the shared month grid, not the bled DatePicker.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using claude-opus-5-5 | 𝕏

Comment thread STATUS.md Outdated
The merge of main had changed the historical 1.6.2 line and its repeat to 26.
fabiodalez-dev added a commit that referenced this pull request Oct 21, 2026
Bumps the version and records in STATUS what 1.9.0 brings: closed digital files with their reason and signed-link renewal (#50), the restyled loan request sheet (#46), the return date from the server's loan duration (#51) and the wanted-title receive action (#49).
@fabiodalez-dev
fabiodalez-dev merged commit c6ea0f2 into main Oct 21, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant