Skip to content

Improve dark mode for profiles screen#137

Open
Sickjuicy wants to merge 27 commits intonetbirdio:mainfrom
Sickjuicy:main
Open

Improve dark mode for profiles screen#137
Sickjuicy wants to merge 27 commits intonetbirdio:mainfrom
Sickjuicy:main

Conversation

@Sickjuicy
Copy link
Copy Markdown
Contributor

@Sickjuicy Sickjuicy commented Feb 7, 2026

This PR improves the color contrast and accessibility of the profile cards in dark mode.
A ThemeOverlay.MaterialComponents.Dark theme overlay is now applied to the cards, which ensures all buttons render with proper contrast and makes the UI more accessible and user-friendly.
grafik

grafik

Summary by CodeRabbit

  • Style
    • Redesigned profile card for clearer visual hierarchy, improved spacing and button arrangement, and updated text/icon styling for better readability.
  • New Features
    • Added matching day/night card themes and new background/card colors for consistent appearance in light and dark modes.
  • Chore
    • Consolidated profile name text appearance into a reusable style for consistent sizing and weight.

Sickjuicy and others added 24 commits July 8, 2025 21:46
# Conflicts:
#	app/src/main/res/values-night/colors.xml
Improves the color contrast and accessibility of the profile cards in dark mode by applying a theme overlay. This ensures all buttons render correctly with proper contrast.
Copilot AI review requested due to automatic review settings February 7, 2026 14:23
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Feb 7, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 697b80f4-47fe-4d0c-baee-c430f738602b

📥 Commits

Reviewing files that changed from the base of the PR and between c1c7a37 and 7efbc84.

📒 Files selected for processing (2)
  • app/src/main/res/layout/list_item_profile.xml
  • app/src/main/res/values-night/colors.xml
✅ Files skipped from review due to trivial changes (1)
  • app/src/main/res/values-night/colors.xml
🚧 Files skipped from review as they are similar to previous changes (1)
  • app/src/main/res/layout/list_item_profile.xml

📝 Walkthrough

Walkthrough

Updated profile list item layout to use a themed MaterialCardView, refactored text/button styling and constraints, and added matching light/dark color and theme resources including a profile name text appearance and Theme.NetBird.Card.

Changes

Cohort / File(s) Summary
Profile Layout Styling
app/src/main/res/layout/list_item_profile.xml
Applied android:theme="@style/Theme.NetBird.Card" and app:cardBackgroundColor="@color/profile_card_background" on MaterialCardView; replaced explicit text attributes with TextAppearance.NetBird.ProfileName; adjusted constraints for icon_profile, text_profile_name, and badge_active; standardized style attributes and constraint ordering for btn_switch, btn_logout, and btn_remove.
Light Theme Colors & Styles
app/src/main/res/values/colors.xml, app/src/main/res/values/themes.xml
Added profile_background (#F2F2F2) and profile_card_background (@color/white); added Theme.NetBird.Card (parent ThemeOverlay.MaterialComponents.Light) and TextAppearance.NetBird.ProfileName (parent TextAppearance.MaterialComponents.Body1, 18sp, bold, @color/nb_txt).
Dark Theme Colors & Styles
app/src/main/res/values-night/colors.xml, app/src/main/res/values-night/themes.xml
Added night color entries: profile_background -> @color/nb_bg, profile_card_background -> @color/nb_gray_light; added Theme.NetBird.Card (parent ThemeOverlay.MaterialComponents.Dark).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐇 I hopped through XML, crisp and quick,
Dressed cards in day and dressed them for night,
Names stand proud, buttons lined up slick,
A tiny hop of styling delight! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title "Improve dark mode for profiles screen" accurately and specifically describes the main change—adding dark mode theming improvements to the profiles screen UI component.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR aims to improve dark-mode contrast/accessibility on the Profiles screen by introducing dedicated profile card/background colors and applying a MaterialComponents dark theme overlay to the profile card so Material buttons render with appropriate contrast.

Changes:

  • Add new profile_background and profile_card_background color resources for day/night.
  • Introduce Theme.NetBird.Card (night variant) based on ThemeOverlay.MaterialComponents.Dark.
  • Update list_item_profile.xml to apply the card theme overlay, set the card background color, and use Material button styles.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
app/src/main/res/values/colors.xml Adds default (day) colors for profile background and card background.
app/src/main/res/values-night/colors.xml Adds night colors for profile background and card background.
app/src/main/res/values-night/themes.xml Adds Theme.NetBird.Card style in the night configuration.
app/src/main/res/layout/list_item_profile.xml Applies the new card theme + background color and updates button styling/ordering.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:theme="@style/Theme.NetBird.Card"
Copy link

Copilot AI Feb 7, 2026

Choose a reason for hiding this comment

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

android:theme references @style/Theme.NetBird.Card, but that style is only defined in values-night/themes.xml. In light mode this style won't resolve at runtime (and can also break resource linking), causing the profile list item to fail to inflate. Add a non-night definition of Theme.NetBird.Card in app/src/main/res/values/themes.xml (likely using a light/neutral ThemeOverlay), keeping the dark parent only in the values-night variant.

Suggested change
android:theme="@style/Theme.NetBird.Card"

Copilot uses AI. Check for mistakes.
Comment on lines +39 to +44
app:layout_constraintBottom_toBottomOf="@+id/icon_profile"
app:layout_constraintEnd_toStartOf="@id/badge_active"
app:layout_constraintHorizontal_bias="0"
app:layout_constraintHorizontal_chainStyle="packed" />
app:layout_constraintHorizontal_chainStyle="packed"
app:layout_constraintStart_toEndOf="@id/icon_profile"
app:layout_constraintTop_toTopOf="@+id/icon_profile"
Copy link

Copilot AI Feb 7, 2026

Choose a reason for hiding this comment

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

Constraint references use @+id/icon_profile even though the id is already declared on the ImageView. Prefer @id/icon_profile for references to avoid creating/looking like a new id and to prevent lint warnings.

Copilot uses AI. Check for mistakes.
Comment on lines +60 to +64
app:layout_constraintBottom_toBottomOf="@+id/icon_profile"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0" />
app:layout_constraintHorizontal_bias="0"
app:layout_constraintStart_toEndOf="@id/text_profile_name"
app:layout_constraintTop_toTopOf="@+id/icon_profile"
Copy link

Copilot AI Feb 7, 2026

Choose a reason for hiding this comment

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

Same as above: use @id/icon_profile instead of @+id/icon_profile when constraining badge_active to icon_profile to avoid lint warnings and keep id usage consistent.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor

@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/values-night/themes.xml`:
- Around line 60-61: Theme.NetBird.Card is only defined for night mode and is
referenced by list_item_profile.xml, causing crashes in light mode; add a
day-mode definition for Theme.NetBird.Card in the app's day themes resource
(values/themes.xml) mirroring the night variant but inheriting from
ThemeOverlay.MaterialComponents.Light so the style resolves during layout
inflation. Ensure the new entry uses the exact style name "Theme.NetBird.Card"
and parent "ThemeOverlay.MaterialComponents.Light" to match usage in
list_item_profile.xml and the existing night definition.
🧹 Nitpick comments (2)
app/src/main/res/values-night/colors.xml (1)

29-30: New profile colors duplicate existing values.

profile_background (#181A1D) is identical to nb_bg, and profile_card_background (#32363D) is identical to nb_gray_light. Consider referencing the existing colors (e.g., @color/nb_bg) to avoid drift, unless you intentionally want these to evolve independently.

app/src/main/res/layout/list_item_profile.xml (1)

36-44: Hardcoded textColor, textSize, and textStyle on the profile name.

These attributes are set directly on the view rather than via a TextAppearance style. This works but means any future typography changes must be applied in every layout file that uses similar headings. Consider extracting a reusable text appearance style if this pattern is used in multiple places.

Comment thread app/src/main/res/values-night/themes.xml
@pappz
Copy link
Copy Markdown
Collaborator

pappz commented Mar 21, 2026

Thank you for the PR! Please consider the comments from RabbitAI.

@pappz
Copy link
Copy Markdown
Collaborator

pappz commented Apr 7, 2026

Thank you for the PR! Please consider the comments from RabbitAI.

@Sickjuicy The copilot found some issues. Do you plan to fix them?

@Sickjuicy
Copy link
Copy Markdown
Contributor Author

@pappz Yes, I’ve seen it. I just don’t have time right now, but I’ll take care of it.

Sickjuicy and others added 3 commits April 11, 2026 21:23
- Include values-night/colors.xml and list_item_profile.xml changes only as requested by user.
Copy link
Copy Markdown
Contributor

@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/res/values/themes.xml (1)

68-73: Apply the new TextAppearance.NetBird.ProfileName in the profile item layout to remove duplication.

The style is defined here, but app/src/main/res/layout/list_item_profile.xml (Line 28-39 in provided snippet) still hardcodes the same text attributes on text_profile_name.

Suggested follow-up diff (in app/src/main/res/layout/list_item_profile.xml)
 <TextView
     android:id="@+id/text_profile_name"
     android:layout_width="0dp"
     android:layout_height="wrap_content"
     android:layout_marginStart="16dp"
     android:layout_marginEnd="8dp"
     android:ellipsize="end"
     android:maxLines="1"
-    android:textColor="@color/nb_txt"
-    android:textSize="18sp"
-    android:textStyle="bold"
+    style="@style/TextAppearance.NetBird.ProfileName"
     app:layout_constraintBottom_toBottomOf="@+id/icon_profile"
     app:layout_constraintEnd_toStartOf="@id/badge_active"
     app:layout_constraintHorizontal_bias="0"
     app:layout_constraintHorizontal_chainStyle="packed"
     app:layout_constraintStart_toEndOf="@id/icon_profile"
     app:layout_constraintTop_toTopOf="@+id/icon_profile"
     tools:text="default" />
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@app/src/main/res/values/themes.xml` around lines 68 - 73, Replace the
hardcoded text attributes on the TextView with id text_profile_name by removing
android:textColor, android:textSize and android:textStyle and instead apply the
new TextAppearance by adding
android:textAppearance="@style/TextAppearance.NetBird.ProfileName" to that
TextView (so it uses the defined TextAppearance.NetBird.ProfileName).
🤖 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/res/values/themes.xml`:
- Around line 68-73: Replace the hardcoded text attributes on the TextView with
id text_profile_name by removing android:textColor, android:textSize and
android:textStyle and instead apply the new TextAppearance by adding
android:textAppearance="@style/TextAppearance.NetBird.ProfileName" to that
TextView (so it uses the defined TextAppearance.NetBird.ProfileName).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 422dbfb4-0c6f-4379-803a-e600a2aebfbb

📥 Commits

Reviewing files that changed from the base of the PR and between 00f3321 and c1c7a37.

📒 Files selected for processing (1)
  • app/src/main/res/values/themes.xml

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.

3 participants