Skip to content

Conversation

@Quwaysim
Copy link
Contributor

@Quwaysim Quwaysim commented Aug 21, 2025

Description

Fixes #491
Replaced all replaceable pngs with their corresponding svgs

Type of Change

  • ✨ New feature (non-breaking change which adds functionality)
  • 🛠️ Bug fix (non-breaking change which fixes an issue)
  • ❌ Breaking change (fix or feature that would cause existing functionality to change)
  • 🧹 Code refactor
  • ✅ Build configuration change
  • 📝 Documentation
  • 🗑️ Chore
  • 🧪 Tests

Checklist

  • Run just precommit to ensure that formatting and linting are correct
  • Run just check-flutter-coverage to ensure that flutter coverage rules are passing
  • Updated the CHANGELOG.md file with your changes (if they affect the user experience)

Summary by CodeRabbit

  • New Features

    • Updated default avatar shown in chat header when no image is provided.
    • Added new SVG icons for chats and checkmarks.
  • Refactor

    • Migrated several icons from PNG to SVG for sharper visuals.
    • Updated icon rendering to use SVGs throughout the chat list.
  • Chores

    • Temporarily disabled group image upload in the group creation sheet; camera icon shown as a placeholder.

@Quwaysim Quwaysim linked an issue Aug 21, 2025 that may be closed by this pull request
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 21, 2025

Walkthrough

Migrates several app icons from PNG to SVG, adds new SVG asset constants, switches image rendering to SvgPicture, changes chat header fallback to the user SVG, and removes the group-image upload toggle (leaving a TODO/no-op).

Changes

Cohort / File(s) Summary
Assets constants migration
lib/ui/core/themes/assets.dart
Added SVG constants (icAddNewChat, icOffChat, icCheckmarkSolid, icCheckmarkFilled) and removed multiple PNG constants (including icImage, groupLogo, icAvatar, various checkmarks); several icons re-pointed from PNG to SVG.
Chat header default image
lib/ui/chat/widgets/chat_header_widget.dart
Updated StringExtension.orDefault to return AssetsPaths.icUser instead of the removed AssetsPaths.icImage when the string is null/empty.
Group details image UI
lib/ui/contact_list/group_chat_details_sheet.dart
Removed _hasGroupImage state and conditional rendering; image area always shows camera icon and onTap replaced with TODO/no-op.
Chat list icon rendering
lib/ui/contact_list/chat_list_screen.dart
Replaced Image.asset usage with SvgPicture.asset for an IconButton, applying tint via colorFilter to preserve existing color logic.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Data as Image URL (String?)
  participant Ext as StringExtension.orDefault
  participant UI as ChatHeader
  Data->>Ext: provide nullable/empty string
  alt null or empty
    Ext-->>UI: AssetsPaths.icUser
  else has value
    Ext-->>UI: original string
  end
  UI-->>UI: render avatar using provided path (SvgPicture or Image)
Loading
sequenceDiagram
  autonumber
  actor User
  participant UI as GroupChatDetailsSheet
  Note over UI: Image area always shows camera icon
  User->>UI: tap image area
  UI-->>UI: no-op / TODO (upload not implemented)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Assessment against linked issues

Objective (issue) Addressed Explanation
Replace PNG icons with SVGs [#491]
Remove unused PNG constants and re-point used names to SVGs [#491]

Out-of-scope changes

Code Change Explanation
Removed group image upload state and disabled upload tap (lib/ui/contact_list/group_chat_details_sheet.dart) Functional removal of group-image upload UI/behavior is not part of the asset-replacement objectives in #491.

Possibly related PRs

Suggested reviewers

  • josefinalliende
  • untreu2

Poem

A rabbit hops with a tiny cheer,
PNGs hop out, SVGs appear.
Header wears a user face so bright,
Group pic waits till next moonlight.
For now I twitch a hopeful ear. 🥕✨

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 491-replace-png-icons-with-svgs

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

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

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@Quwaysim Quwaysim changed the title 491 replace png icons with svgs Replace png icons with svgs Aug 21, 2025
Copy link
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: 0

🧹 Nitpick comments (1)
lib/ui/contact_list/group_chat_details_sheet.dart (1)

219-221: Complete group image upload feature implementation or track as issue.

The TODO comment indicates incomplete functionality. Consider either implementing the group image upload feature as part of this refactor or creating a proper issue to track this work.

Would you like me to help create a GitHub issue to track the group image upload feature implementation?

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between d1d80ec and 5140654.

⛔ Files ignored due to path filters (17)
  • assets/pngs/group_logo.png is excluded by !**/*.png
  • assets/pngs/hands.png is excluded by !**/*.png
  • assets/pngs/ic_add_chat.png is excluded by !**/*.png
  • assets/pngs/ic_avatar.png is excluded by !**/*.png
  • assets/pngs/ic_checkmark_dashed.png is excluded by !**/*.png
  • assets/pngs/ic_checkmark_filled.png is excluded by !**/*.png
  • assets/pngs/ic_checkmark_solid.png is excluded by !**/*.png
  • assets/pngs/ic_image.png is excluded by !**/*.png
  • assets/pngs/ic_notification_muted.png is excluded by !**/*.png
  • assets/pngs/ic_off_chat.png is excluded by !**/*.png
  • assets/pngs/ic_whitenoise.png is excluded by !**/*.png
  • assets/pngs/login_splash.png is excluded by !**/*.png
  • assets/pngs/profile_background.png is excluded by !**/*.png
  • assets/svgs/ic_add_new_chat.svg is excluded by !**/*.svg
  • assets/svgs/ic_checkmark_solid.svg is excluded by !**/*.svg
  • assets/svgs/ic_off_chat.svg is excluded by !**/*.svg
  • pubspec.lock is excluded by !**/*.lock
📒 Files selected for processing (3)
  • lib/ui/chat/widgets/chat_header_widget.dart (1 hunks)
  • lib/ui/contact_list/group_chat_details_sheet.dart (2 hunks)
  • lib/ui/core/themes/assets.dart (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.dart

📄 CodeRabbit inference engine (.cursor/rules/flutter.mdc)

**/*.dart: Always declare the type of each variable and function (parameters and return value). Avoid using 'any'. Create necessary types.
Don't leave blank lines within a function.
One export per file.
Use PascalCase for classes.
Use camelCase for variables, functions, and methods.
Use underscores_case for file and directory names.
Use UPPERCASE for environment variables. Avoid magic numbers and define constants.
Start each function with a verb.
Use verbs for boolean variables. Example: isLoading, hasError, canDelete, etc.
Use complete words instead of abbreviations and correct spelling, except for standard and well-known abbreviations (API, URL, i, j, err, ctx, req, res, next).
Write short functions with a single purpose. Less than 20 instructions.
Name functions with a verb and something else. If it returns a boolean, use isX or hasX, canX, etc. If it doesn't return anything, use executeX or saveX, etc.
Avoid nesting blocks by early checks and returns, or extraction to utility functions.
Use higher-order functions (map, filter, reduce, etc.) to avoid function nesting. Use arrow functions for simple functions (less than 3 instructions). Use named functions for non-simple functions.
Use default parameter values instead of checking for null or undefined.
Reduce function parameters using RO-RO: use an object to pass multiple parameters and to return results. Declare necessary types for input arguments and output.
Use a single level of abstraction in functions.
Don't abuse primitive types and encapsulate data in composite types.
Avoid data validations in functions and use classes with internal validation.
Prefer immutability for data. Use readonly for data that doesn't change. Use 'as const' for literals that don't change.
Declare interfaces to define contracts.
Write small classes with a single purpose. Less than 200 instructions, less than 10 public methods, less than 10 properties.
Use exceptions to handle errors you don't expect. If you catch an exception, it sh...

Files:

  • lib/ui/chat/widgets/chat_header_widget.dart
  • lib/ui/contact_list/group_chat_details_sheet.dart
  • lib/ui/core/themes/assets.dart
🔇 Additional comments (4)
lib/ui/chat/widgets/chat_header_widget.dart (1)

208-208: Updated fallback asset path looks correct.

The change from AssetsPaths.icImage to AssetsPaths.icUser as the fallback when the string is null or empty appears appropriate for a user-related context. This aligns with the PR objective of migrating from PNG to SVG assets.

lib/ui/contact_list/group_chat_details_sheet.dart (1)

230-238: icCamera SVG asset verified

  • Confirmed the SVG file exists at assets/svgs/ic_camera.svg.
  • The constant is correctly defined in lib/ui/core/themes/assets.dart as
    static const String icCamera = '$_svgsDir/ic_camera.svg';
  • Usage in lib/ui/contact_list/group_chat_details_sheet.dart is valid with SvgPicture.asset(AssetsPaths.icCamera).

No further changes required.

lib/ui/core/themes/assets.dart (2)

72-75: All migrated SVG assets verified

  • The four new SVG files (ic_add_new_chat.svg, ic_off_chat.svg, ic_checkmark_solid.svg, ic_checkmark_filled.svg) are present under assets/svgs/
  • No remaining references to the old PNG assets were found in the Dart code
  • pubspec.yaml includes the assets/svgs/ directory, so all SVGs will be bundled

No further changes needed.


77-82: All removed PNG assets are unused or have SVG replacements – safe to remove

  • A project-wide search found no references to the old PNG constants (icImage, groupLogo, loginSplash, profileBackground, avatarPlaceholder, hands, icNotificationMuted, icCheckmarkDashed, icAvatar).
  • The only match for icWhiteNoise now points to AssetsPaths.icWhiteNoiseSvg, confirming migration to SVG.
  • The only remaining PNGs in assets.dart are the four intentional ones (blueHoodie, purpleWoman, greenBird, login).

No breaking changes detected; removal of the other PNG constants is safe.

Copy link
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: 0

🧹 Nitpick comments (2)
lib/ui/contact_list/chat_list_screen.dart (2)

339-351: Add accessible labels for the icon (a11y/UX)

The icon is unlabeled when read by assistive tech since IconButton has no tooltip and the SVG lacks a semanticsLabel. Add a label so VO/TalkBack announce it meaningfully.

Apply within this block:

- icon: SvgPicture.asset(
+ icon: SvgPicture.asset(
+   semanticsLabel: 'New chat',
    notAllRelayTypesConnected
        ? AssetsPaths.icOffChat
        : AssetsPaths.icAddNewChat,
    width: 21.w,
    height: 21.w,
    colorFilter: ColorFilter.mode(
      context.colors.solidNeutralWhite.withValues(
        alpha: notAllRelayTypesConnected ? 0.5 : 1.0,
      ),
      BlendMode.srcIn,
    ),
  ),

And (outside this range) consider adding a tooltip on the IconButton:

IconButton(
  tooltip: notAllRelayTypesConnected ? 'No relays connected' : 'Start a new chat',
  onPressed: ...
  icon: ...
)

345-349: Consider withOpacity for wider Flutter compatibility

Color.withValues(...) is available on newer Flutter/Dart SDKs. If your minimum Flutter version predates this API, use withOpacity(...) to avoid build breaks. Functionally equivalent here since only alpha changes.

- colorFilter: ColorFilter.mode(
-   context.colors.solidNeutralWhite.withValues(
-     alpha: notAllRelayTypesConnected ? 0.5 : 1.0,
-   ),
-   BlendMode.srcIn,
- ),
+ colorFilter: ColorFilter.mode(
+   context.colors.solidNeutralWhite.withOpacity(
+     notAllRelayTypesConnected ? 0.5 : 1.0,
+   ),
+   BlendMode.srcIn,
+ ),

If you’re certain the repo targets a Flutter version that supports withValues, feel free to keep as-is.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 5140654 and 867081d.

📒 Files selected for processing (1)
  • lib/ui/contact_list/chat_list_screen.dart (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.dart

📄 CodeRabbit inference engine (.cursor/rules/flutter.mdc)

**/*.dart: Always declare the type of each variable and function (parameters and return value). Avoid using 'any'. Create necessary types.
Don't leave blank lines within a function.
One export per file.
Use PascalCase for classes.
Use camelCase for variables, functions, and methods.
Use underscores_case for file and directory names.
Use UPPERCASE for environment variables. Avoid magic numbers and define constants.
Start each function with a verb.
Use verbs for boolean variables. Example: isLoading, hasError, canDelete, etc.
Use complete words instead of abbreviations and correct spelling, except for standard and well-known abbreviations (API, URL, i, j, err, ctx, req, res, next).
Write short functions with a single purpose. Less than 20 instructions.
Name functions with a verb and something else. If it returns a boolean, use isX or hasX, canX, etc. If it doesn't return anything, use executeX or saveX, etc.
Avoid nesting blocks by early checks and returns, or extraction to utility functions.
Use higher-order functions (map, filter, reduce, etc.) to avoid function nesting. Use arrow functions for simple functions (less than 3 instructions). Use named functions for non-simple functions.
Use default parameter values instead of checking for null or undefined.
Reduce function parameters using RO-RO: use an object to pass multiple parameters and to return results. Declare necessary types for input arguments and output.
Use a single level of abstraction in functions.
Don't abuse primitive types and encapsulate data in composite types.
Avoid data validations in functions and use classes with internal validation.
Prefer immutability for data. Use readonly for data that doesn't change. Use 'as const' for literals that don't change.
Declare interfaces to define contracts.
Write small classes with a single purpose. Less than 200 instructions, less than 10 public methods, less than 10 properties.
Use exceptions to handle errors you don't expect. If you catch an exception, it sh...

Files:

  • lib/ui/contact_list/chat_list_screen.dart
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Flutter CI
🔇 Additional comments (2)
lib/ui/contact_list/chat_list_screen.dart (2)

339-351: Migration to SvgPicture and colorFilter looks correct

Switching to SvgPicture.asset with ColorFilter.mode(..., BlendMode.srcIn) preserves the previous tint behavior and correctly handles the disabled state via alpha. Asset constants (icOffChat, icAddNewChat) align with the PR’s SVG migration. Nice work.


339-351: The above script will confirm whether any legacy PNG versions of the chat icons remain under assets/pngs. Once you have the results, we can determine if you need to remove those files and update the pubspec accordingly.

untreu2
untreu2 previously approved these changes Aug 24, 2025
codeswot
codeswot previously approved these changes Aug 25, 2025
@Quwaysim Quwaysim dismissed stale reviews from codeswot and untreu2 via 926c136 August 25, 2025 14:04
Copy link
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

🧹 Nitpick comments (3)
lib/ui/core/themes/assets.dart (3)

72-75: Avoid duplicate constants for the same asset; alias and deprecate the old name.

You already have icCheckmarkFilledSvg (Line 49) pointing to the same file. Adding icCheckmarkFilled with an identical path creates two source-of-truths and invites drift. Alias the new preferred name to the old one, and deprecate the old constant to guide callers.

Apply this diff to the changed lines:

-  static const String icCheckmarkFilled = '$_svgsDir/ic_checkmark_filled.svg';
+  // Preferred name (aliases the legacy *Svg name).
+  static const String icCheckmarkFilled = icCheckmarkFilledSvg;

Outside the changed hunk (no diff here, illustrative only), consider marking the legacy constant as deprecated to steer usage:

@Deprecated('Use AssetsPaths.icCheckmarkFilled instead')
static const String icCheckmarkFilledSvg = '$_svgsDir/ic_checkmark_filled.svg';

80-85: Remaining PNG assets verified and in use
All four assets (blue_hoodie.png, purple_woman.png, green_bird.png, login.png) are present under assets/pngs/ and are referenced in the code as follows:

  • AssetsPaths.login used in lib/ui/auth_flow/login_screen.dart (Image.asset call)
  • AssetsPaths.blueHoodie, AssetsPaths.purpleWoman, AssetsPaths.greenBird used in lib/ui/auth_flow/info_screen.dart via FeatureItem widgets

These files appear to be intentionally raster images, not simple icons or line art. If they truly represent photo-style or complex bitmap content, it’s fine to keep them as PNGs. If any are simpler illustrations that would benefit from being vectorized, consider converting them to SVG and swapping the calls from Image.asset to SvgPicture.asset.


36-38: Asset filename typo confirmed; consider renaming for clarity

The asset file on disk is indeed named ic_mute_notfication.svg, matching the code’s reference, so nothing is broken at runtime. However, the word “notfication” is misspelled. To improve clarity and consistency, please rename the file and update the constant:

• Rename on disk:
­– assets/svgs/ic_mute_notfication.svg
+– assets/svgs/ic_mute_notification.svg

• Update constant in lib/ui/core/themes/assets.dart:

- static const String icMutedNotification = '$_svgsDir/ic_mute_notfication.svg';
+ static const String icMutedNotification = '$_svgsDir/ic_mute_notification.svg';

No changes are necessary in pubspec.yaml (the assets/svgs/ directory is already included).

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 867081d and 926c136.

📒 Files selected for processing (1)
  • lib/ui/core/themes/assets.dart (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.dart

📄 CodeRabbit inference engine (.cursor/rules/flutter.mdc)

**/*.dart: Always declare the type of each variable and function (parameters and return value). Avoid using 'any'. Create necessary types.
Don't leave blank lines within a function.
One export per file.
Use PascalCase for classes.
Use camelCase for variables, functions, and methods.
Use underscores_case for file and directory names.
Use UPPERCASE for environment variables. Avoid magic numbers and define constants.
Start each function with a verb.
Use verbs for boolean variables. Example: isLoading, hasError, canDelete, etc.
Use complete words instead of abbreviations and correct spelling, except for standard and well-known abbreviations (API, URL, i, j, err, ctx, req, res, next).
Write short functions with a single purpose. Less than 20 instructions.
Name functions with a verb and something else. If it returns a boolean, use isX or hasX, canX, etc. If it doesn't return anything, use executeX or saveX, etc.
Avoid nesting blocks by early checks and returns, or extraction to utility functions.
Use higher-order functions (map, filter, reduce, etc.) to avoid function nesting. Use arrow functions for simple functions (less than 3 instructions). Use named functions for non-simple functions.
Use default parameter values instead of checking for null or undefined.
Reduce function parameters using RO-RO: use an object to pass multiple parameters and to return results. Declare necessary types for input arguments and output.
Use a single level of abstraction in functions.
Don't abuse primitive types and encapsulate data in composite types.
Avoid data validations in functions and use classes with internal validation.
Prefer immutability for data. Use readonly for data that doesn't change. Use 'as const' for literals that don't change.
Declare interfaces to define contracts.
Write small classes with a single purpose. Less than 200 instructions, less than 10 public methods, less than 10 properties.
Use exceptions to handle errors you don't expect. If you catch an exception, it sh...

Files:

  • lib/ui/core/themes/assets.dart
🔇 Additional comments (2)
lib/ui/core/themes/assets.dart (2)

1-85: Sweep completed: no stale PNG references found
A global search for the removed/renamed PNG constants (icImage, groupLogo, loginSplash, non-SVG icWhiteNoise, profileBackground, avatarPlaceholder, hands, icNotificationMuted, icCheckmarkDashed, icAvatar) returned zero matches—everything now points to the updated SVG constants. No further action needed.


72-75: ✅ All SVG assets verified and pubspec declarations present
All four SVGs exist under assets/svgs/, and pubspec.yaml includes the entire assets/svgs/ directory (line 111). No further changes needed.

Comment on lines +72 to +74
static const String icAddNewChat = '$_svgsDir/ic_add_new_chat.svg';
static const String icOffChat = '$_svgsDir/ic_off_chat.svg';
static const String icCheckmarkSolid = '$_svgsDir/ic_checkmark_solid.svg';
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Clarify coexistence of icAddNewChat vs icNewChat.

There are now two “new chat” icons: icNewChat (Line 26) and icAddNewChat (Line 72). If both are intentional variants, add brief doc comments describing when each should be used. If not, consolidate to one name and migrate call sites.

Optionally add short docs on the new constants:

-  static const String icAddNewChat = '$_svgsDir/ic_add_new_chat.svg';
+  /// "Add new chat" (plus badge) – use on actions that create a chat.
+  static const String icAddNewChat = '$_svgsDir/ic_add_new_chat.svg';
-  static const String icOffChat = '$_svgsDir/ic_off_chat.svg';
+  /// "Chat off/disabled" state icon.
+  static const String icOffChat = '$_svgsDir/ic_off_chat.svg';

Run to verify distinct usage:


🏁 Script executed:

#!/bin/bash
# Expect: Both used intentionally in different contexts (review call sites).
rg -nP --type=dart -C2 'AssetsPaths\.(icAddNewChat|icNewChat)\b'

Length of output: 529


To confirm whether icNewChat is actually referenced anywhere, let’s search the entire codebase:


🏁 Script executed:

#!/bin/bash
# Check for any usage of the older `icNewChat` constant
rg -nP --type=dart '\bAssetsPaths\.icNewChat\b'

Length of output: 49


🏁 Script executed:

#!/bin/bash
# Locate the definition and context of the `icNewChat` constant in the assets file
rg -nP --type=dart 'icNewChat' -C3 lib/ui

Length of output: 742


Remove the unused icNewChat constant and document the new icons

Verified that icNewChat is defined in assets.dart (line 26) but is never referenced in the codebase. To avoid confusion and dead code, remove it, and add short doc comments to the remaining new-chat and off-chat icons:

• In lib/ui/core/themes/assets.dart
– Remove the unused line:
dart static const String icNewChat = '$_svgsDir/ic_new_chat.svg';
• In the same file at lines 72–74—replace with:
diff - static const String icAddNewChat = '$_svgsDir/ic_add_new_chat.svg'; + /// "Add new chat" (plus badge) – use on actions that create a chat. + static const String icAddNewChat = '$_svgsDir/ic_add_new_chat.svg'; - static const String icOffChat = '$_svgsDir/ic_off_chat.svg'; + /// "Chat off/disabled" state icon. + static const String icOffChat = '$_svgsDir/ic_off_chat.svg';

🤖 Prompt for AI Agents
In lib/ui/core/themes/assets.dart around line 26 and lines 72–74, remove the
dead unused constant `static const String icNewChat =
'$_svgsDir/ic_new_chat.svg';` (line ~26) and add short Dart doc comments to the
remaining chat-related icon constants at lines 72–74 (icAddNewChat, icOffChat,
icCheckmarkSolid) describing their purpose (e.g., /// Icon for adding a new
chat, /// Icon for toggling chat off, /// Solid checkmark icon) so the file has
no unused constants and the new icons are documented.

@untreu2 untreu2 self-requested a review August 26, 2025 12:39
@Quwaysim Quwaysim merged commit b1b6c7d into master Aug 26, 2025
2 checks passed
@Quwaysim Quwaysim deleted the 491-replace-png-icons-with-svgs branch August 26, 2025 20:56
@coderabbitai coderabbitai bot mentioned this pull request Aug 26, 2025
11 tasks
@coderabbitai coderabbitai bot mentioned this pull request Oct 14, 2025
11 tasks
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.

Replace png icons with svgs

4 participants