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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mark as unread #2519

Merged
merged 16 commits into from Mar 6, 2023
Merged

Mark as unread #2519

merged 16 commits into from Mar 6, 2023

Conversation

polqf
Copy link
Contributor

@polqf polqf commented Mar 2, 2023

馃敆 Issue Links

https://github.com/GetStream/ios-issues-tracking/issues/285

馃幆 Goal

This PR adds an option to mark as unread a chat starting from a particular message

馃摑 Summary

Now it is possible to select a particular message, and mark the channel as unread starting from that message.

馃洜 Implementation

ChannelController exposes the first unread message id, and this one is used in the UI to show a banner (not part of this PR) to visually distinguish new messages

馃И Manual Testing Notes

  1. Open a channel
  2. Long press on a message
  3. Select "Mark As Unread"

Expected result:

  • The channel should be marked as unread starting from that message

鈽戯笍 Contributor Checklist

  • I have signed the Stream CLA (required)
  • This change follows zero 鈿狅笍 policy (required)
  • This change should be manually QAed
  • Changelog is updated with client-facing changes
  • New code is covered by unit tests
  • Comparison screenshots added for visual changes
  • Affected documentation updated (docusaurus, tutorial, CMS)

馃巵 Meme

@github-actions
Copy link

github-actions bot commented Mar 2, 2023

1 Warning
鈿狅笍 Big PR
1 Message
馃摉 There seems to be app changes but CHANGELOG wasn't modified.
Please include an entry if the PR includes user-facing changes.
You can find it at CHANGELOG.md.

Generated by 馃毇 Danger

Copy link
Contributor

@martinmitrevski martinmitrevski left a comment

Choose a reason for hiding this comment

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

Looks great so far 馃憤 We miss the WS event handling and the UI part, anything else?

Sources/StreamChatUI/Appearance+Images.swift Outdated Show resolved Hide resolved
@@ -434,6 +450,8 @@ open class ChatMessageListVC: _ViewController,
cell.setDecoration(for: .header, decorationView: delegate?.chatMessageListVC(self, headerViewForMessage: message, at: indexPath))
cell.setDecoration(for: .footer, decorationView: delegate?.chatMessageListVC(self, footerViewForMessage: message, at: indexPath))

// TODO: Add logic to show/hide separator based on `firstUnreadMessageId`
Copy link
Contributor

Choose a reason for hiding this comment

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

This logic should be in the ChatChannelVC, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

After the rebase with develop, yeah! Did not see that your changes were applied 馃槃


// THEN
XCTAssertEqual(database.writeSessionCounter, 1)
XCTAssertNotNil(readDTO(cid: cid, userId: userId))
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want to check here the unreadCount to ensure that nothing is being updated?

@ipavlidakis
Copy link
Contributor

It looks great 馃敟馃敟馃敟

@polqf polqf marked this pull request as ready for review March 3, 2023 19:26
@polqf polqf requested a review from a team as a code owner March 3, 2023 19:26
Copy link
Contributor

@ipavlidakis ipavlidakis left a comment

Choose a reason for hiding this comment

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

LGTM!

@testableapple
Copy link
Contributor

Is 6.0% Duplication some sort of false-positive thingy?

@sonarcloud
Copy link

sonarcloud bot commented Mar 6, 2023

SonarCloud Quality Gate failed.聽 聽 Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

85.2% 85.2% Coverage
6.0% 6.0% Duplication

Copy link
Contributor

@martinmitrevski martinmitrevski left a comment

Choose a reason for hiding this comment

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

great work @polqf 馃憦

@polqf polqf merged commit 999b5aa into develop Mar 6, 2023
@polqf polqf deleted the feature/mark-as-unread branch March 6, 2023 16:15
@nuno-vieira nuno-vieira mentioned this pull request Mar 17, 2023
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.

None yet

4 participants