Skip to content

added calendar icon and wire up availability sheet#91

Open
dannym231 wants to merge 1 commit intomainfrom
danny/availability-sheet
Open

added calendar icon and wire up availability sheet#91
dannym231 wants to merge 1 commit intomainfrom
danny/availability-sheet

Conversation

@dannym231
Copy link
Copy Markdown

@dannym231 dannym231 commented Apr 15, 2026

Overview

Added the calendar icon to the profile screen header and wired it up to open the availability bottom sheet.

Changes Made

  • Replaced ic_calendar.xml drawable with the new icon exported from Figma.
  • Added onCalendarPressed() to ProfileViewModel, which calls RootNavigationSheetRepository.showBottomSheet() with a RootSheet.Availability.
  • Injected RootNavigationSheetRepository into ProfileViewModel.
  • Wired onRightPressed on ProfileHeader in ProfileScreen to call profileViewModel.onCalendarPressed().

Test Coverage

Verified the new calendar icon renders correctly in the ProfileScreenPreview Compose preview and in the emulator. Was unable to fully test the bottom sheet flow end-to-end because the sign-in flow is currently broken on my setup, so the availability sheet trigger has not been verified on a running app.

Screenshots

Calendar icon in profile header Screenshot 2026-04-15 at 5 51 19 PM

Summary by CodeRabbit

Release Notes

  • New Features

    • Added calendar icon to profile screen header
    • Users can now access an availability selection interface from their profile
  • UI/Style

    • Updated calendar icon design and dimensions for improved visual consistency

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 15, 2026

📝 Walkthrough

Walkthrough

The changes add a calendar availability feature to the profile screen by introducing a new calendar icon button, wiring it to a ViewModel handler that displays a bottom-sheet for availability selection using GridSelectionType.PROPOSAL, and adding a Preview composable for testing.

Changes

Cohort / File(s) Summary
Profile Screen UI
app/src/main/java/com/cornellappdev/resell/android/ui/screens/main/ProfileScreen.kt
Repositioned settings icon from rightIcon to leftIcon, added new ic_calendar as rightIcon, wired distinct click handlers (onLeftPressed/onRightPressed), and added a ProfileScreenPreview composable with shimmer composition local configuration.
Profile ViewModel Logic
app/src/main/java/com/cornellappdev/resell/android/viewmodel/main/ProfileViewModel.kt
Injected RootNavigationSheetRepository dependency, introduced onCalendarPressed() function to display availability bottom-sheet with GridSelectionType.PROPOSAL and title/description/button configuration, and added supporting imports.
Calendar Icon Resource
app/src/main/res/drawable/ic_calendar.xml
Consolidated multi-path vector into a single path definition, updated viewport dimensions from 18×17 to 20×19, and replaced stroke-based styling with solid fill.

Sequence Diagram

sequenceDiagram
    actor User
    participant ProfileScreen
    participant ProfileViewModel
    participant RootNavigationSheetRepository
    participant BottomSheet

    User->>ProfileScreen: Taps calendar icon (rightIcon)
    ProfileScreen->>ProfileViewModel: onRightPressed() / onCalendarPressed()
    ProfileViewModel->>RootNavigationSheetRepository: showBottomSheet(RootSheet.Availability)
    RootNavigationSheetRepository->>BottomSheet: Display with GridSelectionType.PROPOSAL
    BottomSheet->>User: Show availability selection interface
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

📅 A calendar blooms upon the profile screen,
With icons switched and handlers in between,
The rabbit hops from ViewModel to Sheet,
Where availability times and proposals meet!
A preview gleams, new paths are drawn so clean. 🐰✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main changes: adding a calendar icon and wiring it to the availability sheet.
Description check ✅ Passed The description covers all essential sections with sufficient detail: Overview, Changes Made, Test Coverage, and Screenshots; it follows the template structure and provides actionable information.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch danny/availability-sheet

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 and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
app/src/main/java/com/cornellappdev/resell/android/viewmodel/main/ProfileViewModel.kt (1)

38-38: Remove temporary inline comment in constructor.

At Line 38, // add this looks like a transient PR note and should be removed before merge.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@app/src/main/java/com/cornellappdev/resell/android/viewmodel/main/ProfileViewModel.kt`
at line 38, Remove the transient inline comment "// add this" from the
constructor field declaration for rootNavigationSheetRepository in
ProfileViewModel (the private val rootNavigationSheetRepository:
RootNavigationSheetRepository line); keep the field declaration unchanged
otherwise so the constructor and class compile without the PR note.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@app/src/main/java/com/cornellappdev/resell/android/ui/screens/main/ProfileScreen.kt`:
- Around line 45-48: ProfileHeader is using a hardcoded contentDescription
"search" for the right icon causing the calendar button in ProfileScreen (where
rightIcon = R.drawable.ic_calendar and onRightPressed =
profileViewModel.onCalendarPressed) to be announced incorrectly; update
ProfileHeader to accept a configurable contentDescription parameter (e.g.,
rightIconContentDescription) and use it instead of the hardcoded string, then
pass a calendar-specific string (or string resource like "Availability") from
ProfileScreen when constructing ProfileHeader so the right icon is accessible
and correctly labeled.

In
`@app/src/main/java/com/cornellappdev/resell/android/viewmodel/main/ProfileViewModel.kt`:
- Around line 93-102: The Availability sheet opened in onCalendarPressed uses
RootSheet.Availability with callback = { /* TODO */ }, leaving the Propose
action as a no-op; replace this no-op with a real handler that accepts the
selected times, e.g. validate/format the times, persist them to the chosen layer
(call your ProfileRepository.updateAvailability(...) or update local ViewModel
state), close the sheet via rootNavigationSheetRepository.dismissBottomSheet()
and surface success/error to the UI, or if you cannot implement persistence yet,
disable or hide the primary button on RootSheet.Availability until a proper
callback is provided.

---

Nitpick comments:
In
`@app/src/main/java/com/cornellappdev/resell/android/viewmodel/main/ProfileViewModel.kt`:
- Line 38: Remove the transient inline comment "// add this" from the
constructor field declaration for rootNavigationSheetRepository in
ProfileViewModel (the private val rootNavigationSheetRepository:
RootNavigationSheetRepository line); keep the field declaration unchanged
otherwise so the constructor and class compile without the PR note.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: c0bd5ff7-8f8d-437d-b35f-135f9e4c357e

📥 Commits

Reviewing files that changed from the base of the PR and between 09f546e and d562505.

📒 Files selected for processing (3)
  • app/src/main/java/com/cornellappdev/resell/android/ui/screens/main/ProfileScreen.kt
  • app/src/main/java/com/cornellappdev/resell/android/viewmodel/main/ProfileViewModel.kt
  • app/src/main/res/drawable/ic_calendar.xml

Comment on lines +45 to +48
rightIcon = R.drawable.ic_calendar,
onTabSelected = { profileViewModel.onTabSelected(it) },
onRightPressed = { profileViewModel.onSettingsPressed() },
)
onLeftPressed = { profileViewModel.onSettingsPressed() },
onRightPressed = { profileViewModel.onCalendarPressed() },
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Calendar button is likely announced with the wrong accessibility label.

With rightIcon = R.drawable.ic_calendar at Line 45, the current ProfileHeader implementation (see app/src/main/java/com/cornellappdev/resell/android/ui/components/profile/ProfileHeader.kt:73-88) still uses a hardcoded contentDescription = "search" for the right icon. This is an accessibility defect for screen-reader users.

Consider making icon descriptions configurable from ProfileScreen or updating ProfileHeader to use calendar-specific text in this path.

Suggested direction
- Icon(
-     painter = painterResource(id = rightIcon),
-     contentDescription = "search",
+ Icon(
+     painter = painterResource(id = rightIcon),
+     contentDescription = rightIconContentDescription,
      modifier = Modifier
          .size(25.dp)
          .clickableNoIndication { onRightPressed() }
 )

Then pass "Availability" (or a string resource) from ProfileScreen.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@app/src/main/java/com/cornellappdev/resell/android/ui/screens/main/ProfileScreen.kt`
around lines 45 - 48, ProfileHeader is using a hardcoded contentDescription
"search" for the right icon causing the calendar button in ProfileScreen (where
rightIcon = R.drawable.ic_calendar and onRightPressed =
profileViewModel.onCalendarPressed) to be announced incorrectly; update
ProfileHeader to accept a configurable contentDescription parameter (e.g.,
rightIconContentDescription) and use it instead of the hardcoded string, then
pass a calendar-specific string (or string resource like "Availability") from
ProfileScreen when constructing ProfileHeader so the right icon is accessible
and correctly labeled.

Comment on lines +93 to +102
fun onCalendarPressed() {
rootNavigationSheetRepository.showBottomSheet(
RootSheet.Availability(
buttonString = "Propose",
title = "Availability",
description = "Propose a time to meet",
initialTimes = listOf(),
gridSelectionType = GridSelectionType.PROPOSAL,
callback = { /* TODO: handle selected times */ }
)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Propose action is wired to a no-op callback.

At Line 101, the availability sheet’s primary action currently does nothing (callback = { /* TODO... */ }). This creates a dead-end flow after user selection. Please either implement handling of selected times now or hide/disable this action until behavior is ready.

Would you like me to draft a concrete callback implementation once you confirm the intended persistence path (local state vs API update)?

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@app/src/main/java/com/cornellappdev/resell/android/viewmodel/main/ProfileViewModel.kt`
around lines 93 - 102, The Availability sheet opened in onCalendarPressed uses
RootSheet.Availability with callback = { /* TODO */ }, leaving the Propose
action as a no-op; replace this no-op with a real handler that accepts the
selected times, e.g. validate/format the times, persist them to the chosen layer
(call your ProfileRepository.updateAvailability(...) or update local ViewModel
state), close the sheet via rootNavigationSheetRepository.dismissBottomSheet()
and surface success/error to the UI, or if you cannot implement persistence yet,
disable or hide the primary button on RootSheet.Availability until a proper
callback is provided.

Copy link
Copy Markdown
Member

@AndrewCheung360 AndrewCheung360 left a comment

Choose a reason for hiding this comment

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

So far LGTM, remember to address the coderabbit comments as well (eg. reply and/or resolve if it doesn't make sense or you fix it)

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.

2 participants