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

Filtering fixes #6184

Merged
merged 4 commits into from
May 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Riot/Modules/Common/Recents/RecentsViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -2274,7 +2274,8 @@ - (void)searchBarCancelButtonClicked:(UISearchBar *)searchBar
self.recentsTableView.contentOffset = CGPointMake(0, self.recentsSearchBar.frame.size.height);
self.recentsTableView.tableHeaderView = nil;
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[self refreshRecentsTable];
[self.recentsDataSource searchWithPatterns:nil];
[self.recentsSearchBar setText:nil];
});
}

Expand Down
2 changes: 1 addition & 1 deletion Riot/Modules/Home/HomeViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ - (void)viewWillAppear:(BOOL)animated
[recentsDataSource setDelegate:self andRecentsDataSourceMode:RecentsDataSourceModeHome];

// Reset filtering on the shared data source when switching tabs
[self searchBarCancelButtonClicked:self.recentsSearchBar];
[recentsDataSource searchWithPatterns:nil];
Copy link
Member Author

Choose a reason for hiding this comment

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

This basically makes it the same as all the other tabs in which it worked properly.

[self.recentsSearchBar setText:nil];
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,16 @@ class HomeViewControllerWithBannerWrapperViewController: UIViewController, MXKVi
view.backgroundColor = .clear

stackView = UIStackView()
stackView.translatesAutoresizingMaskIntoConstraints = false
stackView.axis = .vertical
stackView.distribution = .fill
stackView.alignment = .fill

view.vc_addSubViewMatchingParentSafeArea(stackView)
view.addSubview(stackView)
NSLayoutConstraint.activate([stackView.topAnchor.constraint(equalTo: self.view.safeAreaLayoutGuide.topAnchor),
Copy link
Member Author

Choose a reason for hiding this comment

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

Only caring about the top safe area layout guide as that's the place we show the version banner. The bottom one will be handled by the real homeVC.

stackView.leftAnchor.constraint(equalTo: self.view.leftAnchor),
stackView.rightAnchor.constraint(equalTo: self.view.rightAnchor),
stackView.bottomAnchor.constraint(equalTo: self.view.bottomAnchor)])

addChild(homeViewController)
stackView.addArrangedSubview(homeViewController.view)
Expand Down
1 change: 1 addition & 0 deletions changelog.d/6130.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed filtering search bar not resetting properly when cancelling or switching tabs.
1 change: 1 addition & 0 deletions changelog.d/pr-6184.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed home screen shrinking too much on opening the keyboard.
Copy link
Contributor

Choose a reason for hiding this comment

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

Will this differently named changelog be picked up?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep, it's part of our normal naming scheme - https://github.com/matrix-org/matrix-ios-sdk/blob/develop/CONTRIBUTING.md#changelog -> pr-[PRNumber].type for a PR with no related issue