-
-
Notifications
You must be signed in to change notification settings - Fork 26
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
Conversation
@@ -428,7 +421,7 @@ final class ChatListViewController: KeyboardObservingViewController { | |||
chatroom: chatroom, | |||
messageIdToShow: messageId | |||
) | |||
|
|||
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.
remove excessive changes
|
||
guard let result = result else { | ||
return | ||
} |
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.
Minor. If you can make code shorter — do it. guard let result = result else { return }
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.
or even guard let result = await chatsProvider.update(notifyState: true) else { return }
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.
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 { |
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.
Use guard
to reduce nesting
@@ -778,7 +772,7 @@ extension ChatListViewController: NSFetchedResultsControllerDelegate { | |||
break | |||
} | |||
|
|||
// MARK: Unread controller | |||
// MARK: Unread controller |
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.
excessive change
return mutable.attributedSubstring(from: NSRange(location: 0, length: mutable.length)) | ||
} else { | ||
return description | ||
} |
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.
incorrect formatting
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.
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) |
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.
incorrect formatting
replace UIRefreshControl with scrollViewDidEndDragging to remove extra space while TableView refreshing.
ScreenRecording_01-27-2025.12-25-15_1.mp4