Skip to content
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

[MBL-1027] Blocked User Messages UI #1887

Merged
merged 11 commits into from Nov 29, 2023
Merged

Conversation

scottkicks
Copy link
Contributor

@scottkicks scottkicks commented Nov 22, 2023

πŸ“² What

If a user has blocked someone that they have a message thread with we need to disable the Reply button and inform users that they have blocked said user

πŸ€” Why

If a user has blocked someone they will no longer receive new messages or be able to message them.

πŸ›  How

Uses the same design that we had for the creator dashboard deprecation warning banner to inform users.
The isBlocked value is being hardcoded for now but this will be updated so that we get the isBlocked status from the backend instead in MBL-1024.

πŸ‘€ See

| After πŸ¦‹ |
| Simulator Screen Recording - iPhone 15 Pro - 2023-11-22 at 12 53 28 |

βœ… Acceptance criteria

  • banner should show when the participant isBlocked
  • banner should not cover any of the existing message thread

⏰ TODO

  • get isBlocked status from the backend. MBL-1024

@scottkicks scottkicks self-assigned this Nov 22, 2023
@scottkicks scottkicks added this to the release-5.11.0 milestone Nov 22, 2023

userBlockedBannerView.tag = -99
tabController.addChild(userBlockedBannerHostingController)
tabController.view.addSubview(userBlockedBannerView)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

adding the banner to the tabController rather than the ViewController directly. This helped to avoid some more specific styling that we would need to do in order to have this banner sit above the tab bar and not block the ViewController's content.

With this approach, we can simply call updateTableViewBottomContentInset on viewDidAppear.

@kickstarter kickstarter deleted a comment from codecov bot Nov 27, 2023
@scottkicks scottkicks marked this pull request as ready for review November 27, 2023 16:38
@scottkicks scottkicks requested review from amy-at-kickstarter and ifosli and removed request for amy-at-kickstarter November 27, 2023 16:39
Copy link

codecov bot commented Nov 27, 2023

Codecov Report

Attention: 24 lines in your changes are missing coverage. Please review.

Comparison is base (1156229) 83.74% compared to head (4fc4112) 83.73%.

Files Patch % Lines
...s/Messages/Controller/MessagesViewController.swift 0.00% 16 Missing ⚠️
...anner/Controller/MessageBannerViewController.swift 45.45% 3 Missing and 3 partials ⚠️
Library/ViewModels/MessagesViewModel.swift 80.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1887      +/-   ##
==========================================
- Coverage   83.74%   83.73%   -0.01%     
==========================================
  Files        1222     1222              
  Lines      111440   111501      +61     
  Branches    29644    29665      +21     
==========================================
+ Hits        93322    93363      +41     
- Misses      17101    17118      +17     
- Partials     1017     1020       +3     

β˜” View full report in Codecov by Sentry.
πŸ“’ Have feedback on the report? Share it here.

Copy link
Contributor

@amy-at-kickstarter amy-at-kickstarter left a comment

Choose a reason for hiding this comment

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

There are a couple things in here I have questions about before merging. My specific comments are inline in the code, but here are the three things I'd like to see addressed:

  1. New banner view, vs. re-using old banner view
  2. Suggestions for improving the code to display a banner from the tab bar controller
  3. Clarifying participantIsBlocked vs. userHasBeenBlocked signals

@scottkicks
Copy link
Contributor Author

@amy-at-kickstarter using the existing uikit banner. had to do some rework to control the dismissal of the banner, but i think I've addressed everything now.

Copy link
Contributor

@ifosli ifosli left a comment

Choose a reason for hiding this comment

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

I didn't run and test this, but looks good apart from the spelling error! (And you can already use the isBlocked field on the creator if you'd like to.)

Copy link
Contributor

@amy-at-kickstarter amy-at-kickstarter left a comment

Choose a reason for hiding this comment

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

LGTM. I also like @ifosli's suggestions!

@scottkicks scottkicks merged commit a164c48 into main Nov 29, 2023
7 checks passed
@scottkicks scottkicks deleted the scott/blocked-messages-ui branch November 29, 2023 18:29
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.

None yet

3 participants