Skip to content

Conversation

@JatsuAkaYashvant
Copy link
Member

@JatsuAkaYashvant JatsuAkaYashvant commented Aug 5, 2025

Fixes #389

Describe the changes you have made in this PR -

  • I have added a share button in the featured circuit card

Screenshots of the changes (If any) -

WhatsApp Image 2025-08-05 at 17 09 00_060d6f42

Note: Please check Allow edits from maintainers. if you would like us to assist in the PR.

Summary by CodeRabbit

  • New Features

    • Added a share button to featured project cards, allowing users to share project links directly.
    • Project tags are now displayed in the project details view with styled tag chips.
    • Tags input in the project editing view now includes a hint to guide users on tag formatting.
  • Improvements

    • Enhanced localization support for English, Arabic, and Hindi, including new strings for tag hints and featured project actions.
    • Project access type selection in the edit view now uses localized display values and improved mapping.
  • UI Updates

    • Reduced font size for project description headers and content for better readability.

@coderabbitai
Copy link

coderabbitai bot commented Aug 5, 2025

Walkthrough

This change introduces two new localization string keys—edit_project_tag_hint and featured_projects_card_view—across English, Arabic, and Hindi ARB files and their Dart implementations. The UI for editing and viewing projects is updated to use these localized strings, improves tag input with hints, adds a share button to featured project cards, and displays project tags in the project details view.

Changes

Cohort / File(s) Change Summary
Localization Dart Classes
lib/gen_l10n/app_localizations.dart, lib/gen_l10n/app_localizations_en.dart, lib/gen_l10n/app_localizations_ar.dart, lib/gen_l10n/app_localizations_hi.dart
Added new abstract and concrete getters for edit_project_tag_hint and featured_projects_card_view to support localization in English, Arabic, and Hindi.
Localization ARB Files
lib/l10n/app_en.arb, lib/l10n/app_ar.arb, lib/l10n/app_hi.arb
Added new keys and values for edit_project_tag_hint and featured_projects_card_view (with translations and metadata) in English, Arabic, and Hindi resource files.
Featured Project Card UI
lib/ui/views/projects/components/featured_project_card.dart
Added a share button with share functionality using the share_plus package. Replaced hardcoded "VIEW" label with localized string.
Edit Project View UI
lib/ui/views/projects/edit_project_view.dart
Switched from initialValue to TextEditingController for name and tags fields. Added hint below tags input using localization. Updated project access dropdown to use localized values and improved mapping logic.
Project Details View UI
lib/ui/views/projects/project_details_view.dart
Reduced font size for description, added a new widget to display project tags as styled chips below the description.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~15 minutes

Assessment against linked issues

Objective (Issue #) Addressed Explanation
Project Cards Redesign (#389)

Assessment against linked issues: Out-of-scope changes

No out-of-scope changes found.

Possibly related PRs

Suggested labels

released

Suggested reviewers

  • tachyons
  • hardik17771

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.
    • Explain this complex logic.
    • 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. Examples:
    • @coderabbitai explain this code block.
  • 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 src/utils.ts and explain its main purpose.
    • @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 comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

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

Documentation and Community

  • 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.

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

🧹 Nitpick comments (3)
lib/l10n/app_en.arb (2)

378-379: Improve wording & follow existing style guide for hints
The phrase "Enter your Project Tags divided by comma[,]" is grammatically awkward, differs from the earlier "…separated by comma" pattern (see Line 363), and hard-codes the comma symbol redundantly inside [,].

-  "edit_project_tag_hint": "Enter your Project Tags divided by comma[,]",
+  "edit_project_tag_hint": "Enter project tags separated by comma",

• Keeps wording consistent with other hints
• Drops unnecessary capital letters and [,] marker
• Easier to translate downstream


380-382: Inconsistent casing & missing metadata entry
"featured_projects_card_view": "VIEW" is all caps while similar keys (group_member_card_view, assignment_card_view, etc.) use "View". This breaks visual consistency in the UI.

-  "featured_projects_card_view": "VIEW",
+  "featured_projects_card_view": "View",

Also consider adding a @featured_projects_card_view metadata block with a short description to aid translators:

"@featured_projects_card_view": {
  "description": "Button label on the Featured Project card that opens the project"
},
lib/ui/views/projects/components/featured_project_card.dart (1)

100-105: Good implementation but consider URL construction consistency.

The _getProjectUrl method constructs a shareable embed URL properly. However, this logic duplicates the URL base construction pattern from _getImageUrl() method.

Consider extracting the base URL construction into a private helper method to reduce duplication:

+  String _getBaseUrl() {
+    return Uri.parse(EnvironmentConfig.CV_API_BASE_URL)
+        .replace(pathSegments: [])
+        .toString()
+        .replaceAll(RegExp(r'\/+$'), '');
+  }
+
  String _getProjectUrl() {
-    final base = Uri.parse(
-      EnvironmentConfig.CV_API_BASE_URL,
-    ).replace(pathSegments: []).toString().replaceAll(RegExp(r'\/+$'), '');
-    return '$base/simulator/embed/${widget.project.id}';
+    return '${_getBaseUrl()}/simulator/embed/${widget.project.id}';
  }
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 0a7d26f and 482ebde.

📒 Files selected for processing (10)
  • lib/gen_l10n/app_localizations.dart (1 hunks)
  • lib/gen_l10n/app_localizations_ar.dart (1 hunks)
  • lib/gen_l10n/app_localizations_en.dart (1 hunks)
  • lib/gen_l10n/app_localizations_hi.dart (1 hunks)
  • lib/l10n/app_ar.arb (1 hunks)
  • lib/l10n/app_en.arb (1 hunks)
  • lib/l10n/app_hi.arb (1 hunks)
  • lib/ui/views/projects/components/featured_project_card.dart (3 hunks)
  • lib/ui/views/projects/edit_project_view.dart (6 hunks)
  • lib/ui/views/projects/project_details_view.dart (2 hunks)
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: JatsuAkaYashvant
PR: CircuitVerse/mobile-app#381
File: lib/gen_l10n/app_localizations_en.dart:797-811
Timestamp: 2025-06-17T13:37:11.440Z
Learning: When fixing localization issues in Flutter, always fix the source ARB files (like app_en.arb, app_hi.arb) rather than the generated Dart files (like app_localizations_en.dart). The generated localization files are auto-generated from ARB files and any manual changes to them will be overwritten when the localization files are regenerated.
Learnt from: JatsuAkaYashvant
PR: CircuitVerse/mobile-app#381
File: lib/gen_l10n/app_localizations_en.dart:766-796
Timestamp: 2025-06-17T13:38:03.098Z
Learning: In Flutter localization, ARB files (like app_en.arb) are the source files that get compiled into generated localization classes (like app_localizations_en.dart). Issues with incorrect language content should be fixed in the source ARB files rather than the generated files.
📚 Learning: in flutter localization, arb files (like app_en.arb) are the source files that get compiled into gen...
Learnt from: JatsuAkaYashvant
PR: CircuitVerse/mobile-app#381
File: lib/gen_l10n/app_localizations_en.dart:766-796
Timestamp: 2025-06-17T13:38:03.098Z
Learning: In Flutter localization, ARB files (like app_en.arb) are the source files that get compiled into generated localization classes (like app_localizations_en.dart). Issues with incorrect language content should be fixed in the source ARB files rather than the generated files.

Applied to files:

  • lib/l10n/app_ar.arb
  • lib/l10n/app_en.arb
  • lib/gen_l10n/app_localizations_ar.dart
  • lib/l10n/app_hi.arb
  • lib/gen_l10n/app_localizations.dart
  • lib/gen_l10n/app_localizations_en.dart
📚 Learning: when fixing localization issues in flutter, always fix the source arb files (like app_en.arb, app_hi...
Learnt from: JatsuAkaYashvant
PR: CircuitVerse/mobile-app#381
File: lib/gen_l10n/app_localizations_en.dart:797-811
Timestamp: 2025-06-17T13:37:11.440Z
Learning: When fixing localization issues in Flutter, always fix the source ARB files (like app_en.arb, app_hi.arb) rather than the generated Dart files (like app_localizations_en.dart). The generated localization files are auto-generated from ARB files and any manual changes to them will be overwritten when the localization files are regenerated.

Applied to files:

  • lib/l10n/app_ar.arb
  • lib/l10n/app_en.arb
  • lib/gen_l10n/app_localizations_ar.dart
  • lib/l10n/app_hi.arb
  • lib/gen_l10n/app_localizations_hi.dart
  • lib/gen_l10n/app_localizations.dart
  • lib/gen_l10n/app_localizations_en.dart
🔇 Additional comments (18)
lib/gen_l10n/app_localizations_hi.dart (1)

1075-1081: Don't commit manual edits to generated localization files

The two new getters look correct, but remember that any direct change under lib/gen_l10n/ will be overwritten the next time flutter gen-l10n runs.
Double-check that the real source ARB file (lib/l10n/app_hi.arb) already contains the keys "edit_project_tag_hint" and "featured_projects_card_view"; if not, move the strings there and re-generate.

lib/gen_l10n/app_localizations_en.dart (1)

1067-1073: Verify ARB source before merging

As with the Hindi file, these getters should come only from the generator. Please confirm that app_en.arb was updated and committed; otherwise this addition will disappear on the next localization build.

Also, consider re-phrasing the hint to Enter your project tags separated by commas (,) for slightly clearer English.

lib/l10n/app_ar.arb (1)

379-382: LGTM! Arabic localization additions are correctly formatted.

The new localization keys are properly structured with appropriate Arabic translations:

  • edit_project_tag_hint provides clear instructions for tag input
  • featured_projects_card_view correctly translates "View"
  • Metadata entry follows ARB format conventions
lib/l10n/app_hi.arb (1)

376-379: LGTM! Hindi localization additions are correctly implemented.

The new localization keys follow proper ARB format and provide accurate Hindi translations:

  • edit_project_tag_hint gives clear guidance for tag input with proper Hindi translation
  • featured_projects_card_view correctly translates to "देखें" (View)
  • Metadata entry is properly formatted
lib/ui/views/projects/components/featured_project_card.dart (4)

6-7: LGTM! Appropriate imports for new functionality.

The share_plus package import enables the sharing functionality, and app_localizations import supports the localization of the VIEW button text.


107-115: Well-implemented sharing functionality with proper error handling.

The _shareProject method correctly uses the share_plus package and includes appropriate error handling with debug logging. The async implementation is proper.


199-209: Excellent addition of share functionality with good UX.

The share IconButton is well-positioned, properly styled to match the design system, and includes a helpful tooltip. The placement next to the VIEW button creates a logical action group.


216-218: Perfect localization implementation.

The replacement of the hardcoded "VIEW" string with AppLocalizations.of(context)!.featured_projects_card_view properly internationalizes the UI. This aligns with the localization keys added in the ARB files.

lib/ui/views/projects/project_details_view.dart (4)

234-235: LGTM! Improved font size consistency.

The font size reduction from 18 to 16 creates better visual hierarchy and consistency with other UI elements.


239-240: LGTM! Consistent font sizing.

The HTML body font size now matches the header, creating visual consistency in the project description section.


725-725: LGTM! Logical placement of tags widget.

The tags display is appropriately positioned after the project description, following a natural information hierarchy.


247-296: Localization key verified and code approved

I’ve confirmed that edit_project_tags_list is defined in all ARB files (app_en.arb, app_ar.arb, app_hi.arb) with appropriate translations. The _buildProjectTags() and _buildTagChip() methods are well-structured, handle empty states correctly, and follow the app’s design system and localization practices.

– No further changes needed.

lib/ui/views/projects/edit_project_view.dart (6)

34-34: Excellent form state management improvement.

The addition of TextEditingController instances for name and tags fields, along with proper disposal, provides better control over form state compared to using initialValue. The resource cleanup in dispose() prevents memory leaks.

Also applies to: 39-41, 47-49


58-67: LGTM! Proper controller initialization.

The controllers are correctly initialized with existing project data, and the QuillController properly handles existing description content. The lazy initialization pattern is appropriate.


72-72: LGTM! Consistent controller usage.

Using _nameController instead of initialValue is consistent with the improved form state management approach.


114-175: Excellent localization implementation for access types.

The comprehensive localization of the access type dropdown is well-implemented with:

  • Clean separation between internal API values and localized display strings
  • Proper two-way conversion via getCurrentValue() helper function
  • Consistent handling of all access type options

This follows internationalization best practices and maintains API compatibility.


191-192: LGTM! Proper form value capture.

Using controller values directly in form submission ensures the current state is properly captured, which is the correct approach when using TextEditingController.


87-110: Localization key verified and UX improvement approved

  • Confirmed that edit_project_tag_hint exists in all ARB files under lib/l10n/:
    • app_en.arb
    • app_hi.arb
    • app_ar.arb
  • No further changes needed. This hint text enhancement can be merged as is.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 16757055814

Details

  • 28 of 95 (29.47%) changed or added relevant lines in 6 files are covered.
  • 7 unchanged lines in 4 files lost coverage.
  • Overall coverage decreased (-0.2%) to 54.773%

Changes Missing Coverage Covered Lines Changed/Added Lines %
lib/gen_l10n/app_localizations_en.dart 1 2 50.0%
lib/gen_l10n/app_localizations_ar.dart 0 2 0.0%
lib/gen_l10n/app_localizations_hi.dart 0 2 0.0%
lib/ui/views/projects/project_details_view.dart 20 22 90.91%
lib/ui/views/projects/components/featured_project_card.dart 7 15 46.67%
lib/ui/views/projects/edit_project_view.dart 0 52 0.0%
Files with Coverage Reduction New Missed Lines %
lib/gen_l10n/app_localizations_ar.dart 1 0.0%
lib/gen_l10n/app_localizations_en.dart 1 58.55%
lib/gen_l10n/app_localizations_hi.dart 1 0.0%
lib/ui/views/projects/edit_project_view.dart 4 0.0%
Totals Coverage Status
Change from base Build 16628654821: -0.2%
Covered Lines: 4791
Relevant Lines: 8747

💛 - Coveralls

@hardik17771 hardik17771 merged commit 8550baf into CircuitVerse:master Aug 6, 2025
8 checks passed
@github-actions
Copy link
Contributor

🎉 This PR is included in version 1.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Project Cards Redesign

3 participants