Skip to content

[ui] add notification settings#309

Draft
capcom6 wants to merge 1 commit intomasterfrom
issue/304-sorce-sse
Draft

[ui] add notification settings#309
capcom6 wants to merge 1 commit intomasterfrom
issue/304-sorce-sse

Conversation

@capcom6
Copy link
Owner

@capcom6 capcom6 commented Jan 18, 2026

Summary by CodeRabbit

  • New Features

    • Added a notification mode preference in server settings with choices "Auto", "FCM Only", and "SSE Only".
    • Introduced a new notification icon for the preference UI.
  • New Resources

    • Added paired display titles and values backing the notification mode choices.
  • Style

    • Reflowed and reformatted several string and XML resources for readability; visible text unchanged.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 18, 2026

Walkthrough

Adds two string-array resources for notification mode titles and values, a notification vector drawable, and a ListPreference gateway.notification_mode; also reformats multiple strings and applies a minor whitespace fix in root preferences XML.

Changes

Cohort / File(s) Change Summary
Notification mode resources & preference
app/src/main/res/values/arrays.xml, app/src/main/res/xml/cloud_server_preferences.xml
Added notification_modes_titles and notification_modes_values string arrays; added a ListPreference with key gateway.notification_mode, default AUTO, entries/values from the new arrays, icon reference, and simple summary provider.
Notification icon drawable
app/src/main/res/drawable/ic_notifications.xml
Added a new 24×24 dp vector drawable ic_notifications.xml defining the notification icon using theme-aware fill color.
Strings reflow & additions
app/src/main/res/values/strings.xml
Reformatted several long string resources across lines; added notification-related strings (labels/descriptions) while keeping identifiers unchanged.
Preferences XML whitespace
app/src/main/res/xml/root_preferences.xml
Minor whitespace/formatting adjustment in MessagesSettingsFragment self-closing tag only.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 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
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title '[ui] add notification settings' accurately describes the main change: adding notification mode selection UI to cloud server preferences.

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

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch issue/304-sorce-sse

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

@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

🤖 Fix all issues with AI agents
In `@app/src/main/res/values/strings.xml`:
- Around line 70-79: The three description resources
(notification_mode_auto_description, notification_mode_fcm_only_description,
notification_mode_sse_only_description) are unused because the ListPreference in
notification_preferences.xml uses app:useSimpleSummaryProvider="true" which only
shows the selected title from notification_modes_titles; either remove the
unused strings or wire them into the UI: to wire them, replace
useSimpleSummaryProvider with an entrySummaries array (or set android:summary to
reference entrySummaries) that maps to these three description strings, or
implement a custom SummaryProvider in your PreferenceFragmentCompat (in the
fragment class that loads notification_preferences.xml) to set the
ListPreference summary based on the selected value and the corresponding
description resource; update the ListPreference declaration (same preference
key/name as the existing ListPreference) or the fragment's onCreatePreferences
logic to point to notification_mode_auto_description,
notification_mode_fcm_only_description, and
notification_mode_sse_only_description so they are actually displayed.

In `@app/src/main/res/xml/root_preferences.xml`:
- Around line 26-29: The Preference element for NotificationSettingsFragment
uses a hardcoded summary and lacks an icon; add a new string resource named
notification_delivery_mode_selection in strings.xml with the English text, then
update the Preference (the element with
app:fragment="me.capcom.smsgateway.ui.settings.NotificationSettingsFragment") to
use android:summary="@string/notification_delivery_mode_selection" and add the
same android:icon attribute pattern used by the other preferences (match their
drawable resource) so the preference is localizable and visually consistent.

Copy link

@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: 1

🤖 Fix all issues with AI agents
In `@app/src/main/res/xml/cloud_server_preferences.xml`:
- Around line 15-22: The ListPreference element using android:icon should be
changed to use the AndroidX attribute app:icon for consistency with other
preferences; locate the ListPreference with key "gateway.notification_mode" and
replace the android:icon attribute with app:icon="@drawable/ic_notifications" so
the Preference (ListPreference) uses the androidx preference attribute namespace
like the EditTextPreference entries.

@capcom6 capcom6 force-pushed the issue/304-sorce-sse branch from de5bcec to 6e0d6b5 Compare January 20, 2026 01:37
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