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

[trello.com/c/qTdMgopE] UI: Remove excessive spinner on pull down in Chats screen #673

Closed
wants to merge 5 commits into from

Conversation

vovameister
Copy link
Member

replace UIRefreshControl with scrollViewDidEndDragging to remove extra space while TableView refreshing.

ScreenRecording_01-27-2025.12-25-15_1.mp4

@@ -428,7 +421,7 @@ final class ChatListViewController: KeyboardObservingViewController {
chatroom: chatroom,
messageIdToShow: messageId
)

Copy link
Member

Choose a reason for hiding this comment

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

remove excessive changes


guard let result = result else {
return
}
Copy link
Member

Choose a reason for hiding this comment

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

Minor. If you can make code shorter — do it. guard let result = result else { return }

Copy link
Member

Choose a reason for hiding this comment

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

or even guard let result = await chatsProvider.update(notifyState: true) else { return }

Copy link
Member

Choose a reason for hiding this comment

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

Or do so

private func handleRefresh() async {
    switch await chatsProvider.update(notifyState: true) {
    case .some(.success):
        tableView.reloadData()
    case .some(.failure(let error)):
        dialogService.showRichError(error: error)
    case .none:
        return
    }
}

@@ -594,6 +581,13 @@ extension ChatListViewController: UITableViewDelegate, UITableViewDataSource {
let offsetY = scrollView.contentOffset.y + scrollView.safeAreaInsets.top
scrollUpButton.isHidden = offsetY < cellHeight * 0.75
}
func scrollViewDidEndDragging(_ scrollView: UIScrollView, willDecelerate decelerate: Bool) {
if scrollView.contentOffset.y <= 0 && scrollView.contentOffset.y < -100 {
Copy link
Member

Choose a reason for hiding this comment

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

Use guard to reduce nesting

@@ -778,7 +772,7 @@ extension ChatListViewController: NSFetchedResultsControllerDelegate {
break
}

// MARK: Unread controller
// MARK: Unread controller
Copy link
Member

Choose a reason for hiding this comment

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

excessive change

return mutable.attributedSubstring(from: NSRange(location: 0, length: mutable.length))
} else {
return description
}
Copy link
Member

Choose a reason for hiding this comment

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

incorrect formatting

Copy link
Member

@just-software-dev just-software-dev left a comment

Choose a reason for hiding this comment

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

too many excessive changes

@@ -1408,14 +1402,14 @@ extension ChatListViewController {

private func chatControllerIndexPath(tableViewIndexPath: IndexPath) -> IndexPath {
isBusy && tableViewIndexPath.row >= (lastSystemChatPositionRow ?? 0)
? IndexPath(row: tableViewIndexPath.row - 1, section: 0)
: tableViewIndexPath
? IndexPath(row: tableViewIndexPath.row - 1, section: 0)
Copy link
Member

Choose a reason for hiding this comment

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

incorrect formatting

@vovameister vovameister deleted the trello.com/c/qTdMgopE branch January 29, 2025 12:25
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