Skip to content

Fix report issue button#257

Merged
caleb-bit merged 4 commits intomainfrom
Caleb/report-icon
Apr 28, 2026
Merged

Fix report issue button#257
caleb-bit merged 4 commits intomainfrom
Caleb/report-icon

Conversation

@caleb-bit
Copy link
Copy Markdown
Contributor

@caleb-bit caleb-bit commented Apr 28, 2026

Overview

This PR fixes the report issue icon and the button shape.

Related PRs or Issues

Summary by CodeRabbit

  • Style
    • Standardized "Report an issue" button appearance and icon across detail and support screens for a consistent look and feel.
  • New Features
    • Introduced a unified report button component used throughout the app, preserving the tap action to open the report sheet.
  • Bug Fixes
    • FAQ and menu actions now reliably close menus before invoking actions, improving interaction behavior.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 28, 2026

📝 Walkthrough

Walkthrough

A reusable ReportIssueButton composable and a new ic_report vector drawable are added; existing inline report buttons in EateryDetailScreen and SupportScreen are refactored to use the new component and related handlers updated.

Changes

Cohort / File(s) Summary
New Report Button Component
app/src/main/java/com/cornellappdev/android/eatery/ui/components/general/ReportIssueButton.kt
Adds ReportIssueButton composable with configurable shape, typography, icon modifier, optional containerColor/contentColor, and onClick wiring.
Screen Integrations & UI updates
app/src/main/java/com/cornellappdev/android/eatery/ui/screens/EateryDetailScreen.kt, app/src/main/java/com/cornellappdev/android/eatery/ui/screens/SupportScreen.kt
Replaces inline Material Button/Icons.Default.Report usages with ReportIssueButton; SupportScreen updates ReportButton signature to accept onClick, adjusts FAQ action slot to action(onClick), and ensures dropdown menu items call setExpanded(false) then the action.
Icon Resource
app/src/main/res/drawable/ic_report.xml
Adds new vector drawable ic_report.xml (16dp viewport) used by the new button.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested reviewers

  • AndrewCheung360

Poem

🐰 I hopped through code to tidy a spot,
A tiny report button, rounded a lot.
Now icons align and actions are neat,
One little component makes screens complete.
🌿✨

🚥 Pre-merge checks | ✅ 4 | ❌ 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 (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Fix report issue button' clearly and concisely summarizes the main change of refactoring the report issue button component and fixing its appearance to match design specifications.
Description check ✅ Passed The description adequately covers the overview of changes and links to the related issue #249; while template sections like 'Changes Made' and 'Test Coverage' are not fully detailed, the essential information is provided.
Linked Issues check ✅ Passed The PR successfully addresses issue #249 by extracting the report button into a dedicated, reusable ReportIssueButton component with configurable styling and introducing a new ic_report drawable resource for consistent icon rendering across screens.
Out of Scope Changes check ✅ Passed All changes are directly related to fixing the report issue button UI to match design specifications; refactoring in SupportScreen.kt is part of integrating the new component and involves no extraneous modifications.

✏️ 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 Caleb/report-icon

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.

🧹 Nitpick comments (1)
app/src/main/java/com/cornellappdev/android/eatery/ui/screens/SupportScreen.kt (1)

289-305: Optional simplification: remove redundant Row wrapper around ReportIssueButton.

Line 290-305 can be flattened with no behavior change, reducing layout noise.

♻️ Suggested simplification
 `@Composable`
 private fun ReportButton(onClick: () -> Unit) {
-    Row(
-        modifier = Modifier
-            .height(34.dp)
-            .fillMaxWidth()
-            .background(color = currentColors.backgroundDefault),
-        horizontalArrangement = Arrangement.Start
-    ) {
-        ReportIssueButton(
-            modifier = Modifier.fillMaxHeight(),
-            onClick = onClick,
-            textStyle = EateryBlueTypography.button,
-            containerColor = currentColors.accentPrimary,
-            contentColor = currentColors.textPrimary,
-        )
-    }
+    ReportIssueButton(
+        modifier = Modifier
+            .height(34.dp)
+            .fillMaxWidth(),
+        onClick = onClick,
+        textStyle = EateryBlueTypography.button,
+        containerColor = currentColors.accentPrimary,
+        contentColor = currentColors.textPrimary,
+    )
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@app/src/main/java/com/cornellappdev/android/eatery/ui/screens/SupportScreen.kt`
around lines 289 - 305, The Row wrapper around ReportIssueButton is redundant;
remove the Row and apply its layout modifiers directly to ReportIssueButton so
the visual behavior stays identical: set ReportIssueButton's modifier to
Modifier.height(34.dp).fillMaxWidth().background(currentColors.backgroundDefault)
(and keep the original Modifier.fillMaxHeight behavior if needed by using
height/fill as appropriate), preserving existing props textStyle =
EateryBlueTypography.button, containerColor = currentColors.accentPrimary, and
contentColor = currentColors.textPrimary in the ReportButton function.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In
`@app/src/main/java/com/cornellappdev/android/eatery/ui/screens/SupportScreen.kt`:
- Around line 289-305: The Row wrapper around ReportIssueButton is redundant;
remove the Row and apply its layout modifiers directly to ReportIssueButton so
the visual behavior stays identical: set ReportIssueButton's modifier to
Modifier.height(34.dp).fillMaxWidth().background(currentColors.backgroundDefault)
(and keep the original Modifier.fillMaxHeight behavior if needed by using
height/fill as appropriate), preserving existing props textStyle =
EateryBlueTypography.button, containerColor = currentColors.accentPrimary, and
contentColor = currentColors.textPrimary in the ReportButton function.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e57e8117-8b28-4705-a702-ddc9c4c3cdbd

📥 Commits

Reviewing files that changed from the base of the PR and between 2be3fc6 and e34401d.

📒 Files selected for processing (4)
  • app/src/main/java/com/cornellappdev/android/eatery/ui/components/general/ReportIssueButton.kt
  • app/src/main/java/com/cornellappdev/android/eatery/ui/screens/EateryDetailScreen.kt
  • app/src/main/java/com/cornellappdev/android/eatery/ui/screens/SupportScreen.kt
  • app/src/main/res/drawable/ic_report.xml

action = {
Row {
action = { onClick ->
Row(modifier = Modifier.clickable { onClick() }) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nit: was probably there before, but we can use TextButton instead of clickable rows

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.

LGTM. minor comment about TextButton from code that was there before.

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.

🧹 Nitpick comments (1)
app/src/main/java/com/cornellappdev/android/eatery/ui/screens/SupportScreen.kt (1)

236-263: De-duplicate repeated report action lambdas.

The three FAQ entries use the same action lambda. Consider extracting one shared local lambda to reduce repetition.

Refactor sketch
+        val reportFaqAction: `@Composable` ((() -> Unit) -> Unit) = { onClick ->
+            ReportButton(onClick = onClick)
+        }
+
         FAQCreation(
             title = stringResource(R.string.support_faq_wrong_menus_title),
             dropdownText = stringResource(id = R.string.wrong_empty_menus),
-            action = { onClick ->
-                ReportButton(onClick = onClick)
-            }
+            action = reportFaqAction
         ) {
             issue = Issue.ITEM
             showReportSheet = true
         }

         FAQCreation(
             title = stringResource(R.string.support_faq_closed_hours_title),
             dropdownText = stringResource(id = R.string.eatery_closed_when_open),
-            action = { onClick ->
-                ReportButton(onClick = onClick)
-            }
+            action = reportFaqAction
         ) {
             issue = Issue.HOURS
             showReportSheet = true
         }

         FAQCreation(
             title = stringResource(R.string.support_faq_wait_times_title),
             dropdownText = stringResource(id = R.string.wait_time_longer),
-            action = { onClick ->
-                ReportButton(onClick = onClick)
-            }
+            action = reportFaqAction
         ) {
             issue = Issue.WAIT_TIMES
             showReportSheet = true
         }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@app/src/main/java/com/cornellappdev/android/eatery/ui/screens/SupportScreen.kt`
around lines 236 - 263, Extract the repeated ReportButton-producing lambda into
a single local val (e.g., reportAction) and reuse it for each FAQCreation call
instead of repeating the same inline lambda; specifically create a local lambda
that accepts onClick and returns ReportButton(onClick = onClick), then replace
the three FAQCreation action = { onClick -> ReportButton(onClick = onClick) }
occurrences with action = reportAction while keeping the rest of each block
(setting issue = Issue.ITEM/HOURS/... and showReportSheet = true) unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In
`@app/src/main/java/com/cornellappdev/android/eatery/ui/screens/SupportScreen.kt`:
- Around line 236-263: Extract the repeated ReportButton-producing lambda into a
single local val (e.g., reportAction) and reuse it for each FAQCreation call
instead of repeating the same inline lambda; specifically create a local lambda
that accepts onClick and returns ReportButton(onClick = onClick), then replace
the three FAQCreation action = { onClick -> ReportButton(onClick = onClick) }
occurrences with action = reportAction while keeping the rest of each block
(setting issue = Issue.ITEM/HOURS/... and showReportSheet = true) unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 72b5a8ab-c50a-4ab3-b3f9-1c5fdca9cb8a

📥 Commits

Reviewing files that changed from the base of the PR and between e34401d and 95996ee.

📒 Files selected for processing (1)
  • app/src/main/java/com/cornellappdev/android/eatery/ui/screens/SupportScreen.kt

@caleb-bit caleb-bit merged commit 60e7ed4 into main Apr 28, 2026
3 checks passed
@caleb-bit caleb-bit deleted the Caleb/report-icon branch April 28, 2026 22:22
caleb-bit added a commit that referenced this pull request Apr 29, 2026
* Add Display settings with dark mode toggle and settings access from login

- Add DisplayBottomSheet with Light / Dark / Device Theme radio options
- Add Display row to SettingsScreen wired to ThemeViewModel
- Expose isLoggedIn from ThemeViewModel; hide logout button when not logged in
- Make settings list scrollable to prevent logout button from squishing
- Add settings icon to LoginPage header so unauthenticated users can access settings
- Add settings_display_* string resources

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* Add spacing below filter row in UpcomingMenuScreen

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* Address CodeRabbit review comments

- Use collectAsStateWithLifecycle() instead of collectAsState() for lifecycle-aware state collection
- Set logout icon contentDescription to null to avoid TalkBack reading redundant icon label alongside visible "Log out" text

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* Refactor theme state to ThemePreference enum; move isLoggedIn to SettingsViewModel

- Add ThemePreference enum (LIGHT/DARK/SYSTEM) to data/models
- Expose themePreferenceFlow from UserPreferencesRepository instead of nullable Boolean
- Replace isDarkMode: StateFlow<Boolean?> with themePreference: StateFlow<ThemePreference> in ThemeViewModel; drop isLoggedIn
- Add isLoggedIn: StateFlow<Boolean> to SettingsViewModel (injecting UserPreferencesRepository)
- Update rememberResolvedDarkMode in Theme.kt to switch on ThemePreference enum
- Update DisplayBottomSheet to accept ThemePreference param directly, removing private DisplayTheme enum
- Update SettingsScreen to use ThemePreference and collect isLoggedIn from settingsViewModel

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* Fix report issue button (#257)

* Delayed nit fixes (#258)

* Bump versions for patch release (#259)

* Bump version

* Update whatsnew

---------

Co-authored-by: Andrew Cheung <andrewcheung360@gmail.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

Report Issue Button UI Mismatch

2 participants