Skip to content

Community Guidelines#140

Merged
martindsq merged 25 commits intomainfrom
264/community-guidelines
Apr 8, 2025
Merged

Community Guidelines#140
martindsq merged 25 commits intomainfrom
264/community-guidelines

Conversation

@martindsq
Copy link
Copy Markdown
Contributor

@martindsq martindsq commented Apr 2, 2025

Issues covered

#264

Description

A description of the changes proposed in the pull request. Explain what it does to give the reviewer some context for what they're reviewing.

How to test

  1. Navigate to admin panel
  2. Tap on Community Guidelines
  3. Edit the community guidelines there

Screenshots/Video

Post screenshots or video showing your changes, ideally showing how the app worked before and after these changes. Delete this section if this PR contains no visual changes.

Before After
Simulator Screenshot - iPhone SE (3rd generation) - 2025-04-07 at 16 35 38

@Chardot Please review these UI changes to be sure they match the design.

Summary by CodeRabbit

  • New Features

    • Introduced a Community Guidelines feature for groups, including a dedicated screen for viewing and editing.
    • Added a new navigation option from the group admin interface to directly access Community Guidelines.
    • Enhanced support for multiple languages with updated English and Spanish labels and messages.
    • Updated release notes to reflect the addition of Community Guidelines for groups.
  • Bug Fixes

    • Improved error handling and user prompts related to saving community guidelines.
  • Documentation

    • Added documentation comments for new constants and methods related to community guidelines.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 2, 2025

Walkthrough

This pull request introduces support for managing community guidelines for groups. It includes new UI components, controllers, and data repositories to fetch, display, and update guidelines. Changes encompass routing, localization, and group metadata to fully integrate the community guidelines feature. Additionally, a new entry has been added to the changelog.

Changes

File Path(s) Summary of Changes
CHANGELOG.md Added new release note entry for "Community Guidelines to groups" (issue #264).
lib/consts/router_path.dart, lib/main.dart, lib/router/.../group_admin_screen.dart Added new route constant (communityGuidelines), mapped the route to CommunityGuidelinesScreen, and inserted a new navigation row in the group admin screen.
lib/data/group_metadata_repository.dart, packages/nostr_sdk/lib/nip29/group_metadata.dart Introduced GroupMetadataRepository for fetching/updating group metadata; updated GroupMetadata to include an optional communityGuidelines property.
lib/features/community_guidelines/community_guidelines_controller.dart, lib/features/community_guidelines/community_guidelines_screen.dart Added new controller (CommunityGuidelinesController) and screen (CommunityGuidelinesScreen) to display and manage community guidelines.
lib/l10n/intl_en.arb, lib/l10n/intl_es.arb Added new localization keys for error messages and community guidelines prompts in both English and Spanish.

Sequence Diagram(s)

sequenceDiagram
    participant UA as User
    participant GA as Group Admin Screen
    participant CGS as Community Guidelines Screen
    participant CGC as Community Guidelines Controller
    participant GMR as Group Metadata Repository
    participant Nostr as Nostr SDK

    UA ->> GA: Tap "Community Guidelines"
    GA ->> CGS: Navigate to CommunityGuidelinesScreen (with groupId)
    CGS ->> CGC: Request current guidelines
    CGC ->> GMR: Fetch group metadata for groupId
    GMR ->> Nostr: Query event for metadata
    Nostr -->> GMR: Return metadata (incl. guidelines)
    GMR -->> CGC: Provide metadata
    CGC -->> CGS: Supply guidelines data
    UA ->> CGS: Edit guidelines and tap Save
    CGS ->> CGC: Invoke save(new guidelines)
    CGC ->> GMR: Update metadata with new guidelines
    GMR ->> Nostr: Send update event
    Nostr -->> GMR: Acknowledge update
    GMR -->> CGC: Confirm success
    CGC -->> CGS: Refresh UI with updated guidelines
Loading

Suggested labels

Skip-Changelog

Suggested reviewers

  • joshuatbrown
  • pelumy
  • bryanmontz

Poem

I'm a rabbit with a hop in my stride,
Celebrating guidelines now bona fide.
New routes and screens, a flow so sweet,
Metadata and updates make our work complete.
With a twitch of my nose, I cheer the new beat!
Here's to changes that make our app neat!


🪧 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.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • 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 generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

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 resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @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.

@martindsq martindsq changed the base branch from main to 261/cache-group-metadata-events April 2, 2025 20:49
Base automatically changed from 261/cache-group-metadata-events to main April 8, 2025 11:23
@martindsq martindsq marked this pull request as ready for review April 8, 2025 13:58
@martindsq
Copy link
Copy Markdown
Contributor Author

The lint checker is complaining about constants in router_consts I didn't modify. I could fix them anyway here, but @bryanmontz already addressed this issue in a different PR. So, let's ignore the failing check.

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: 4

🧹 Nitpick comments (4)
lib/features/community_guidelines/community_guidelines_screen.dart (4)

23-27: Consider adding documentation for the TextEditingController

The controller is correctly defined, but adding a brief comment about its lifecycle management would improve maintainability.


28-44: Use more descriptive variable names for route arguments

The generic variable names arg and id could be more descriptive to enhance readability.

-    var arg = RouterUtil.routerArgs(context);
-    if (arg == null || arg is! GroupIdentifier) {
-      RouterUtil.back(context);
-      return Container();
-    }
-    final id = arg;
+    var groupArg = RouterUtil.routerArgs(context);
+    if (groupArg == null || groupArg is! GroupIdentifier) {
+      RouterUtil.back(context);
+      return Container();
+    }
+    final groupId = groupArg;

48-74: Consider extracting AppBar to a separate method for better readability

The AppBar configuration is quite lengthy and could be extracted to a dedicated method to improve code organization.

-      appBar: AppBar(
-        leading: const AppbarBackBtnWidget(),
-        bottom: const AppBarBottomBorder(),
-        title: Text(
-          localization.Community_Guidelines,
-          style: TextStyle(
-            fontSize: bodyLargeFontSize,
-            fontWeight: FontWeight.bold,
-          ),
-        ),
-        actions: [
-          TextButton(
-            onPressed: isSaveDisabled ? null : () => _save(id),
-            style: TextButton.styleFrom(
-              foregroundColor: accentColor,
-              disabledForegroundColor: accentColor.withOpacity(0.4),
-            ),
-            child: Text(
-              localization.Save,
-              style: const TextStyle(
-                fontSize: 18,
-              ),
-            ),
-          ),
-        ],
-      ),
+      appBar: _buildAppBar(localization, bodyLargeFontSize, accentColor, isSaveDisabled, id),

And then add this method:

PreferredSizeWidget _buildAppBar(S localization, double? bodyLargeFontSize, Color accentColor, bool isSaveDisabled, GroupIdentifier id) {
  return AppBar(
    leading: const AppbarBackBtnWidget(),
    bottom: const AppBarBottomBorder(),
    title: Text(
      localization.Community_Guidelines,
      style: TextStyle(
        fontSize: bodyLargeFontSize,
        fontWeight: FontWeight.bold,
      ),
    ),
    actions: [
      TextButton(
        onPressed: isSaveDisabled ? null : () => _save(id),
        style: TextButton.styleFrom(
          foregroundColor: accentColor,
          disabledForegroundColor: accentColor.withOpacity(0.4),
        ),
        child: Text(
          localization.Save,
          style: const TextStyle(
            fontSize: 18,
          ),
        ),
      ),
    ],
  );
}

75-117: Consider extracting the form into a separate method

The form UI in the body is quite lengthy and could be extracted to a dedicated method for better readability.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between fa864b4 and e9e7907.

⛔ Files ignored due to path filters (3)
  • lib/generated/intl/messages_en.dart is excluded by !**/generated/**
  • lib/generated/intl/messages_es.dart is excluded by !**/generated/**
  • lib/generated/l10n.dart is excluded by !**/generated/**
📒 Files selected for processing (10)
  • CHANGELOG.md (1 hunks)
  • lib/consts/router_path.dart (1 hunks)
  • lib/data/group_metadata_repository.dart (1 hunks)
  • lib/features/community_guidelines/community_guidelines_controller.dart (1 hunks)
  • lib/features/community_guidelines/community_guidelines_screen.dart (1 hunks)
  • lib/l10n/intl_en.arb (2 hunks)
  • lib/l10n/intl_es.arb (4 hunks)
  • lib/main.dart (2 hunks)
  • lib/router/group/group_admin/group_admin_screen.dart (1 hunks)
  • packages/nostr_sdk/lib/nip29/group_metadata.dart (4 hunks)
🧰 Additional context used
🪛 GitHub Actions: Analyze Project
lib/consts/router_path.dart

[warning] 40-40: The constant name 'QRSCANNER' isn't a lowerCamelCase identifier.


[warning] 41-41: The constant name 'WEBUTILS' isn't a lowerCamelCase identifier.


[warning] 42-42: The constant name 'RELAY_INFO' isn't a lowerCamelCase identifier.


[warning] 43-43: The constant name 'FOLLOWED_TAGS_LIST' isn't a lowerCamelCase identifier.


[warning] 44-44: The constant name 'COMMUNITY_DETAIL' isn't a lowerCamelCase identifier.


[warning] 45-45: The constant name 'FOLLOWED_COMMUNITIES' isn't a lowerCamelCase identifier.


[warning] 46-46: The constant name 'FOLLOWED' isn't a lowerCamelCase identifier.


[warning] 47-47: The constant name 'BOOKMARK' isn't a lowerCamelCase identifier.


[warning] 48-48: The constant name 'FOLLOW_SET_LIST' isn't a lowerCamelCase identifier.


[warning] 49-49: The constant name 'FOLLOW_SET_DETAIL' isn't a lowerCamelCase identifier.


[warning] 50-50: The constant name 'FOLLOW_SET_FEED' isn't a lowerCamelCase identifier.


[warning] 51-51: The constant name 'NWC_SETTING' isn't a lowerCamelCase identifier.


[warning] 52-52: The constant name 'GROUP_ADMIN' isn't a lowerCamelCase identifier.


[warning] 53-53: The constant name 'GROUP_LIST' isn't a lowerCamelCase identifier.


[warning] 54-54: The constant name 'GROUP_DETAIL' isn't a lowerCamelCase identifier.


[warning] 55-55: The constant name 'GROUP_EDIT' isn't a lowerCamelCase identifier.


[warning] 56-56: The constant name 'GROUP_MEMBERS' isn't a lowerCamelCase identifier.


[warning] 57-57: The constant name 'GROUP_INFO' isn't a lowerCamelCase identifier.

🔇 Additional comments (17)
CHANGELOG.md (1)

22-22: Good addition to the changelog

The new entry correctly documents the addition of Community Guidelines to groups and includes the appropriate issue reference.

lib/consts/router_path.dart (1)

37-38:

Details

✅ Verification successful

Good implementation of new route path

The new constant is properly documented and follows the same pattern as other recent additions to the file like onboarding and pushNotificationTest.

I notice there's a mix of naming conventions in this file (some constants use UPPER_SNAKE_CASE while newer ones use lowerCamelCase). This is confirmed by the lint warnings. While your addition follows the newer convention correctly, you might want to consider a future task to standardize these constants.


🏁 Script executed:

#!/bin/bash
# Count the number of constants using each naming convention
echo "Constants using UPPER_SNAKE_CASE:"
grep -E 'static const String [A-Z_]+' lib/consts/router_path.dart | wc -l

echo "Constants using lowerCamelCase:"
grep -E 'static const String [a-z][a-zA-Z]*' lib/consts/router_path.dart | wc -l

Length of output: 313


New Route Constant Approved – Note on Naming Conventions

  • The new communityGuidelines constant is documented and implemented correctly following the lowerCamelCase style, similar to other recent additions like onboarding and pushNotificationTest.
  • Verification shows that while only 3 constants use lowerCamelCase, there are 39 legacy constants in UPPER_SNAKE_CASE, which explains the lint warnings.
  • Consider scheduling a future task to standardize naming conventions across the file.
lib/main.dart (2)

63-63: Good import for the new screen

The import statement is properly placed with the other feature imports.


467-469: Good implementation of route handler

The route is properly registered and follows the same pattern as other routes in the application.

lib/router/group/group_admin/group_admin_screen.dart (1)

216-223:

Details

✅ Verification successful

Good implementation of navigation to Community Guidelines

The navigation row is implemented correctly and follows the same pattern as the existing Members navigation row. The groupId is properly passed to the new route.

Let's verify that the localization key for "Community_Guidelines" exists in the localization files:


🏁 Script executed:

#!/bin/bash
# Check if the Community_Guidelines localization key exists
echo "Checking for Community_Guidelines in English localization file:"
grep -r "Community_Guidelines" lib/l10n/

echo "Checking other Community_ related strings:"
grep -r "Community_" lib/l10n/

Length of output: 1219


Navigation to Community Guidelines Verified

The localization key "Community_Guidelines" is confirmed to exist (in both intl_en.arb and intl_es.arb), and the navigation row in lib/router/group/group_admin/group_admin_screen.dart (lines 216-223) is implemented consistently with the Members navigation row. The group identifier (groupId) is correctly passed to the new route.

lib/features/community_guidelines/community_guidelines_screen.dart (2)

1-21: LGTM: Clean implementation of the CommunityGuidelinesScreen class

The ConsumerStatefulWidget implementation is well structured with appropriate imports and documentation.


121-153: Well-implemented save method with proper error handling

Good job on implementing comprehensive error handling with appropriate user feedback and retry options.

lib/l10n/intl_en.arb (3)

4-5: LGTM: Properly added error handling localizations

These new keys for error handling will ensure a consistent user experience during error scenarios.


7-7: LGTM: Properly added Community Guidelines localization

The localization key for the screen title is correctly defined.


335-338: LGTM: Properly added input and error localizations

The localization keys for the input hint and save error messages are correctly defined.

lib/l10n/intl_es.arb (3)

33-33: LGTM: Spanish translation for Community Guidelines added

The Spanish translation for the Community Guidelines title has been correctly added.


64-64: LGTM: Spanish translations for description and guidelines properly added

The translations for Description and Community Guidelines input are properly implemented.

Also applies to: 72-73


181-181: LGTM: Spanish translations for action buttons and errors added

The translations for Retry, Save, and Save failed messages are correctly implemented.

Also applies to: 190-191

packages/nostr_sdk/lib/nip29/group_metadata.dart (2)

11-13: LGTM: Well-documented new property for community guidelines

The community guidelines property is properly documented with clear purpose.


25-25: LGTM: Constructor updated to include community guidelines parameter

The constructor has been properly updated to accept the new property.

lib/features/community_guidelines/community_guidelines_controller.dart (1)

36-39: Consider handling potential exceptions during build.

The build method directly calls _fetchCommunityGuidelines(arg) without any error handling. If the repository throws an exception, it will propagate unhandled. You might want to wrap this in a try/catch or rely on Riverpod's error state to provide a more informative UI message for the user.

lib/data/group_metadata_repository.dart (1)

68-82: Verify handling of marker collisions.

You're slicing the about field at the first occurrence of # Community Guidelines. If the marker appears multiple times, only the first section is assigned to about and the remainder to communityGuidelines. Confirm whether this is intentional or if additional occurrences need processing.

Comment thread packages/nostr_sdk/lib/nip29/group_metadata.dart
Comment thread lib/features/community_guidelines/community_guidelines_controller.dart Outdated
Comment thread lib/data/group_metadata_repository.dart
@Chardot
Copy link
Copy Markdown

Chardot commented Apr 8, 2025

Screenshots/Video

Post screenshots or video showing your changes, ideally showing how the app worked before and after these changes. Delete this section if this PR contains no visual changes.

Before After
Simulator Screenshot - iPhone SE (3rd generation) - 2025-04-07 at 16 35 38
@Chardot Please review these UI changes to be sure they match the design.

@martindsq Could you update the placeholder text to use the "Dimmed" color variable, which is #8D7EAB on dark and #A68782 on light mode?

@martindsq
Copy link
Copy Markdown
Contributor Author

@martindsq Could you update the placeholder text to use the "Dimmed" color variable, which is #8D7EAB on dark and #A68782 on light mode?

Done. Here's an updated screenshot.

Simulator Screenshot - iPhone SE (3rd generation) - 2025-04-08 at 13 04 45

  • 2025-04-08 at 13.04.45.png…]()

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

🧹 Nitpick comments (2)
lib/features/community_guidelines/community_guidelines_screen.dart (2)

42-45: Consider adding a check for unsaved changes when navigating back

When the user navigates back without saving changes, there's no confirmation dialog to warn them of potential data loss.

Consider overriding the back button behavior in the app bar or wrapping the Scaffold with a WillPopScope to check for unsaved changes:

  if (arg == null || arg is! GroupIdentifier) {
-    RouterUtil.back(context);
+    // Consider checking for unsaved changes before navigating back
+    _handleBackNavigation();
    return Container();
  }

Then add a method to handle back navigation:

void _handleBackNavigation() {
  final String currentText = _descriptionController.text;
  final String originalText = ref.read(communityGuidelinesControllerProvider(id)).value ?? '';
  
  if (currentText != originalText) {
    // Show confirmation dialog
    showDialog(
      context: context,
      builder: (context) => AlertDialog.adaptive(
        title: Text(S.of(context).Unsaved_Changes),
        content: Text(S.of(context).Discard_Changes_Confirmation),
        actions: [
          TextButton(
            child: Text(S.of(context).Discard),
            onPressed: () {
              Navigator.of(context).pop();
              RouterUtil.back(context);
            },
          ),
          TextButton(
            child: Text(S.of(context).Cancel),
            onPressed: () => Navigator.of(context).pop(),
          ),
        ],
      ),
    );
  } else {
    RouterUtil.back(context);
  }
}

Note: This would require adding the appropriate localization strings.


133-153: Enhance error feedback with more specific details

The current error dialog just shows a generic "Save failed" message without providing details about what went wrong.

Consider passing the error details from the controller to the UI:

-    final result = await controller.save(_descriptionController.text);
+    final saveResult = await controller.save(_descriptionController.text);
     if (!mounted) return;
-    if (result) {
+    if (saveResult.success) {
       RouterUtil.back(context);
     } else {
       showDialog(
         context: context,
         barrierDismissible: true,
         builder: (context) => AlertDialog.adaptive(
           title: Text(localization.Error),
-          content: Text(localization.Save_failed),
+          content: Text(saveResult.errorMessage ?? localization.Save_failed),
           actions: [

This assumes you modify the controller to return a result object with success and error message fields rather than just a boolean.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 3b5d32f and a26db29.

📒 Files selected for processing (1)
  • lib/features/community_guidelines/community_guidelines_screen.dart (1 hunks)
🔇 Additional comments (2)
lib/features/community_guidelines/community_guidelines_screen.dart (2)

104-105: LGTM! Correct use of dimmed color for hint text

The hint text correctly uses the dimmed color as requested in the PR comments. This provides proper contrast and follows the design specifications.


1-156: Overall the implementation is well-structured and follows good practices

The code is well-organized, properly documented, and follows Flutter best practices. The separation of UI and business logic (via the controller) is well done, and the handling of different states (loading, error, data) is appropriate.

Comment thread lib/features/community_guidelines/community_guidelines_screen.dart
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: 0

♻️ Duplicate comments (1)
lib/features/community_guidelines/community_guidelines_screen.dart (1)

123-127: TextEditingController properly disposed

Great job implementing the dispose method to clean up the TextEditingController, preventing potential memory leaks. This follows Flutter best practices.

🧹 Nitpick comments (1)
lib/features/community_guidelines/community_guidelines_screen.dart (1)

28-121: Consider refactoring the build method for better readability

The build method is quite long (90+ lines). Consider breaking it down into smaller widget methods for better readability and maintainability, such as:

  • _buildAppBar()
  • _buildContentBody(String value)
  • _buildForm(String value)

This would make the code more modular and easier to maintain.

Example refactoring:

@override
Widget build(BuildContext context) {
  // Theme setup and arg validation code
  final id = arg;
  final controller = ref.watch(communityGuidelinesControllerProvider(id));
  
  return Scaffold(
    appBar: _buildAppBar(controller.isLoading || controller.hasError, id),
    body: controller.when(
      data: (value) => _buildContentBody(value),
      error: (error, stackTrace) => Center(child: ErrorWidget(error)),
      loading: () => const Center(child: CircularProgressIndicator()),
    ),
  );
}

PreferredSizeWidget _buildAppBar(bool isSaveDisabled, GroupIdentifier id) {
  // Existing app bar code
}

Widget _buildContentBody(String value) {
  _descriptionController.text = value;
  return SingleChildScrollView(
    child: Column(
      // Existing column code
    ),
  );
}
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between c1255f7 and cb56db6.

📒 Files selected for processing (1)
  • lib/features/community_guidelines/community_guidelines_screen.dart (1 hunks)
🔇 Additional comments (3)
lib/features/community_guidelines/community_guidelines_screen.dart (3)

23-27: TextEditingController properly initialized

Good job on implementing the TextEditingController with a descriptive comment. I see you've also added the dispose method as suggested in the previous review.


129-161: Robust error handling in save method

The _save method handles errors appropriately by:

  1. Checking if the widget is still mounted after the async operation
  2. Providing a user-friendly error dialog
  3. Offering retry functionality
  4. Including proper navigation in success and failure cases

This shows good attention to user experience and robustness.


1-162: Overall implementation is well-structured and functional

The CommunityGuidelinesScreen implementation is well-structured with:

  • Clear separation of UI and logic
  • Proper state management with Riverpod
  • Appropriate error handling and loading states
  • Good use of localization
  • Responsive UI that adapts to theme settings

The code follows Flutter best practices and provides a good user experience for managing community guidelines.

@martindsq martindsq added skip-linting Tells CI not to run the linting comparison against the main branch. and removed skip-linting Tells CI not to run the linting comparison against the main branch. labels Apr 8, 2025
@pelumy
Copy link
Copy Markdown
Contributor

pelumy commented Apr 8, 2025

👀

Copy link
Copy Markdown
Contributor

@pelumy pelumy left a comment

Choose a reason for hiding this comment

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

Thanks for doing thia Martin! A lot of code improvements in this PR. I also love the feature folder.

The PR works great. Only UI issue I found is that there should be a line between the menus.
Figma: https://www.figma.com/design/MB4AOVkZ2wt3IfI4aMAusZ/Plur?node-id=618-3261&m=dev

It currently looks like:
Screenshot 2025-04-08 at 7 37 44 pm

But I don't think it is a blocker.

@martindsq martindsq merged commit 9c52e96 into main Apr 8, 2025
7 of 8 checks passed
@martindsq martindsq deleted the 264/community-guidelines branch April 8, 2025 18:47
rabble pushed a commit that referenced this pull request May 16, 2025
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