-
Notifications
You must be signed in to change notification settings - Fork 38
TW-2710: Add settings for displaying and managing contact info visibility #2711
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
hoangdat
merged 13 commits into
main
from
TW-2710-settings-to-display-or-hide-contact-info
Dec 12, 2025
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
601ca0e
TW-2710: Add settings for displaying and managing contact info visibi…
nqhhdev 867ee8e
TW-2710: Implement update user info visibility settings
nqhhdev f9433e7
TW-2710: Apply E2E for contacts visibility
nqhhdev b361cea
fixup! TW-2710: Apply E2E for contacts visibility
nqhhdev 6734384
fixup! fixup! TW-2710: Apply E2E for contacts visibility
nqhhdev dc3ee2f
fixup! fixup! fixup! TW-2710: Apply E2E for contacts visibility
nqhhdev 7776fc8
fixup! fixup! fixup! fixup! TW-2710: Apply E2E for contacts visibility
nqhhdev d1b1b9d
fixup! fixup! fixup! fixup! fixup! TW-2710: Apply E2E for contacts vi…
nqhhdev 4de4996
fixup! fixup! fixup! fixup! fixup! fixup! TW-2710: Apply E2E for cont…
nqhhdev f369c4e
fixup! fixup! fixup! fixup! fixup! fixup! fixup! TW-2710: Apply E2E f…
nqhhdev a7f9f44
fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! TW-2710: Appl…
nqhhdev fee2edd
fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! TW-271…
nqhhdev 121dcfc
fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup!…
nqhhdev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
127 changes: 127 additions & 0 deletions
127
integration_test/robots/setting/settings_contacts_visibility_robot.dart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,127 @@ | ||
| import 'package:fluffychat/domain/model/user_info/user_info_visibility.dart'; | ||
| import 'package:fluffychat/pages/settings_dashboard/settings_contacts_visibility/settings_contacts_visibility_enum.dart'; | ||
| import 'package:fluffychat/pages/settings_dashboard/settings_contacts_visibility/settings_contacts_visibility_view.dart'; | ||
| import 'package:flutter/material.dart'; | ||
| import 'package:patrol/patrol.dart'; | ||
| import '../home_robot.dart'; | ||
|
|
||
| class SettingsContactsVisibilityRobot extends HomeRobot { | ||
| SettingsContactsVisibilityRobot(super.$); | ||
|
|
||
| // Visibility option finders | ||
| PatrolFinder visibilityOption( | ||
| SettingsContactsVisibilityEnum visibilityOption, | ||
| ) { | ||
| return $(Key('visibility_option_${visibilityOption.name}')); | ||
| } | ||
|
|
||
| PatrolFinder visibilityOptionSelected( | ||
| SettingsContactsVisibilityEnum visibilityOption, | ||
| ) { | ||
| return $(Key('visibility_option_selected_${visibilityOption.name}')); | ||
| } | ||
|
|
||
| // Specific visibility options | ||
| PatrolFinder everyoneOption() { | ||
| return visibilityOption(SettingsContactsVisibilityEnum.public); | ||
| } | ||
|
|
||
| PatrolFinder contactsOption() { | ||
| return visibilityOption(SettingsContactsVisibilityEnum.contacts); | ||
| } | ||
|
|
||
| PatrolFinder nobodyOption() { | ||
| return visibilityOption(SettingsContactsVisibilityEnum.private); | ||
| } | ||
|
|
||
| // Selected state finders | ||
| PatrolFinder everyoneSelected() { | ||
| return visibilityOptionSelected(SettingsContactsVisibilityEnum.public); | ||
| } | ||
|
|
||
| PatrolFinder contactsSelected() { | ||
| return visibilityOptionSelected(SettingsContactsVisibilityEnum.contacts); | ||
| } | ||
|
|
||
| PatrolFinder nobodySelected() { | ||
| return visibilityOptionSelected(SettingsContactsVisibilityEnum.private); | ||
| } | ||
|
|
||
| // Visible field option finders | ||
| PatrolFinder visibleFieldOption(VisibleEnum visibleEnum) { | ||
| return $(Key('visible_field_option_${visibleEnum.name}')); | ||
| } | ||
|
|
||
| PatrolFinder visibleFieldOptionSelected(VisibleEnum visibleEnum) { | ||
| return $(Key('visible_field_option_selected_${visibleEnum.name}')); | ||
| } | ||
|
|
||
| // Specific visible field options | ||
| PatrolFinder emailFieldOption() { | ||
| return visibleFieldOption(VisibleEnum.email); | ||
| } | ||
|
|
||
| PatrolFinder phoneNumberFieldOption() { | ||
| return visibleFieldOption(VisibleEnum.phone); | ||
| } | ||
|
|
||
| // Selected state finders for fields | ||
| PatrolFinder emailFieldSelected() { | ||
| return visibleFieldOptionSelected(VisibleEnum.email); | ||
| } | ||
|
|
||
| PatrolFinder phoneNumberFieldSelected() { | ||
| return visibleFieldOptionSelected(VisibleEnum.phone); | ||
| } | ||
|
|
||
| // Actions | ||
| Future<void> selectEveryoneOption() async { | ||
| await everyoneOption().tap(); | ||
| await $.waitUntilVisible(everyoneSelected()); | ||
| } | ||
|
|
||
| Future<void> selectContactsOption() async { | ||
| await contactsOption().tap(); | ||
| await $.waitUntilVisible(contactsSelected()); | ||
| } | ||
|
|
||
| Future<void> selectNobodyOption() async { | ||
| await nobodyOption().tap(); | ||
| await $.waitUntilVisible(nobodySelected()); | ||
| } | ||
|
|
||
| Future<void> toggleEmailField() async { | ||
| await emailFieldOption().tap(); | ||
| await $.pumpAndSettle(); | ||
| } | ||
|
|
||
| Future<void> togglePhoneNumberField() async { | ||
| await phoneNumberFieldOption().tap(); | ||
| await $.pumpAndSettle(); | ||
| } | ||
|
|
||
| // Helper methods to check states | ||
| bool isEveryoneSelected() { | ||
| return everyoneSelected().exists; | ||
| } | ||
|
|
||
| bool isContactsSelected() { | ||
| return contactsSelected().exists; | ||
| } | ||
|
|
||
| bool isNobodySelected() { | ||
| return nobodySelected().exists; | ||
| } | ||
|
|
||
| bool isEmailFieldSelected() { | ||
| return emailFieldSelected().exists; | ||
| } | ||
|
|
||
| bool isPhoneNumberFieldSelected() { | ||
| return phoneNumberFieldSelected().exists; | ||
| } | ||
|
|
||
| Future<void> waitForView() async { | ||
| await $.waitUntilVisible($(SettingsContactsVisibilityView)); | ||
| } | ||
| } |
18 changes: 18 additions & 0 deletions
18
integration_test/robots/setting/settings_privacy_and_security_robot.dart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| import 'package:fluffychat/pages/settings_dashboard/settings_contacts_visibility/settings_contacts_visibility_view.dart'; | ||
| import 'package:flutter/cupertino.dart'; | ||
| import 'package:patrol/patrol.dart'; | ||
|
|
||
| import '../home_robot.dart'; | ||
|
|
||
| class SettingsPrivacyAndSecurityRobot extends HomeRobot { | ||
| SettingsPrivacyAndSecurityRobot(super.$); | ||
|
|
||
| PatrolFinder contactVisibilitySetting() { | ||
| return $(const Key('contacts_visibility_settings_item')); | ||
| } | ||
|
|
||
| Future<void> openContactVisibilitySetting() async { | ||
| await contactVisibilitySetting().tap(); | ||
| await $.waitUntilVisible($(SettingsContactsVisibilityView)); | ||
| } | ||
| } |
105 changes: 105 additions & 0 deletions
105
integration_test/tests/setting/settings_contacts_visibility_test.dart
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,105 @@ | ||
| import 'package:flutter_test/flutter_test.dart'; | ||
|
|
||
| import '../../base/test_base.dart'; | ||
| import '../../robots/home_robot.dart'; | ||
| import '../../robots/setting/settings_contacts_visibility_robot.dart'; | ||
| import '../../robots/setting/settings_privacy_and_security_robot.dart'; | ||
|
|
||
| void main() { | ||
| TestBase().twakePatrolTest( | ||
| description: | ||
| 'Open settings contact visibility screen test and verify everyone option is present', | ||
| test: ($) async { | ||
| final settingsRobot = await HomeRobot($).gotoSettingScreen(); | ||
|
|
||
| await settingsRobot.openPrivacyAndSecuritySetting(); | ||
|
|
||
| await SettingsPrivacyAndSecurityRobot($).openContactVisibilitySetting(); | ||
|
|
||
| final contactsVisibilityRobot = SettingsContactsVisibilityRobot($); | ||
| await contactsVisibilityRobot.waitForView(); | ||
|
|
||
| // Verify everyone option is present | ||
| await contactsVisibilityRobot.everyoneOption().waitUntilVisible(); | ||
|
|
||
| // Select every one option | ||
| await contactsVisibilityRobot.selectEveryoneOption(); | ||
|
|
||
| // Wait for UI to settle after selection | ||
| await $.pumpAndSettle(); | ||
|
|
||
| // Verify email and phone fields are NOT visible when everyone is selected | ||
| expect( | ||
| contactsVisibilityRobot.emailFieldOption(), | ||
| findsNothing, | ||
| ); | ||
| expect( | ||
| contactsVisibilityRobot.phoneNumberFieldOption(), | ||
| findsNothing, | ||
| ); | ||
| }, | ||
| ); | ||
|
|
||
| TestBase().twakePatrolTest( | ||
| description: | ||
| 'Open settings contact visibility screen test and my contacts option is present', | ||
| test: ($) async { | ||
| final settingsRobot = await HomeRobot($).gotoSettingScreen(); | ||
|
|
||
| await settingsRobot.openPrivacyAndSecuritySetting(); | ||
|
|
||
| await SettingsPrivacyAndSecurityRobot($).openContactVisibilitySetting(); | ||
|
|
||
| final contactsVisibilityRobot = SettingsContactsVisibilityRobot($); | ||
| await contactsVisibilityRobot.waitForView(); | ||
|
|
||
| // Verify contacts option is present | ||
| await contactsVisibilityRobot.contactsOption().waitUntilVisible(); | ||
|
|
||
| // Select contacts option | ||
| await contactsVisibilityRobot.selectContactsOption(); | ||
|
|
||
| // Wait for UI to settle after selection | ||
| await $.pumpAndSettle(); | ||
|
|
||
| // Verify email and phone visible fields are present | ||
| await contactsVisibilityRobot.emailFieldOption().waitUntilVisible(); | ||
|
|
||
| await contactsVisibilityRobot.phoneNumberFieldOption().waitUntilVisible(); | ||
| }, | ||
| ); | ||
|
|
||
| TestBase().twakePatrolTest( | ||
| description: | ||
| 'Open settings contact visibility screen test and nobody option is present', | ||
| test: ($) async { | ||
| final settingsRobot = await HomeRobot($).gotoSettingScreen(); | ||
|
|
||
| await settingsRobot.openPrivacyAndSecuritySetting(); | ||
|
|
||
| await SettingsPrivacyAndSecurityRobot($).openContactVisibilitySetting(); | ||
|
|
||
| final contactsVisibilityRobot = SettingsContactsVisibilityRobot($); | ||
| await contactsVisibilityRobot.waitForView(); | ||
|
|
||
| // Verify nobody option is present | ||
| await contactsVisibilityRobot.nobodyOption().waitUntilVisible(); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please verify no |
||
|
|
||
| // Select nobody option | ||
| await contactsVisibilityRobot.selectNobodyOption(); | ||
|
|
||
| // Wait for UI to settle after selection | ||
| await $.pumpAndSettle(); | ||
|
|
||
| // Verify email and phone fields are NOT visible when nobody is selected | ||
| expect( | ||
| contactsVisibilityRobot.emailFieldOption(), | ||
| findsNothing, | ||
| ); | ||
| expect( | ||
| contactsVisibilityRobot.phoneNumberFieldOption(), | ||
| findsNothing, | ||
| ); | ||
| }, | ||
| ); | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| /// Route path constants for the application. | ||
| /// | ||
| /// This file contains all route paths used in go_router configuration | ||
| /// and navigation calls to ensure consistency and prevent typos. | ||
| abstract class AppRoutePaths { | ||
| // Security routes | ||
| static const String roomsSecurityFull = '/rooms/security'; | ||
| static const String contactsVisibilitySegment = 'contactsVisibility'; | ||
| static const String contactsVisibilityFull = | ||
| '$roomsSecurityFull/$contactsVisibilitySegment'; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,14 @@ | ||
| import 'package:fluffychat/domain/model/user_info/user_info.dart'; | ||
| import 'package:fluffychat/domain/model/user_info/user_info_visibility.dart'; | ||
| import 'package:fluffychat/domain/model/user_info/user_info_visibility_request.dart'; | ||
|
|
||
| abstract class UserInfoDatasource { | ||
| Future<UserInfo> getUserInfo(String userId); | ||
|
|
||
| Future<UserInfoVisibility> getUserVisibility(String userId); | ||
|
|
||
| Future<UserInfoVisibility> updateUserInfoVisibility( | ||
| String userId, | ||
| UserInfoVisibilityRequest userInfoVisibility, | ||
| ); | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please verify no
fieldsdisplay when useeveryoneoption