Fix home pull activity filtering
This commit is contained in:
@@ -117,8 +117,10 @@ xcrun simctl launch booted de.rfc1437.gotcha
|
||||
- [ ] Activity rows have the correct icon, repository, summary, and date.
|
||||
- [ ] The compact icon row below the activity graph sits flat on the normal
|
||||
background with no border or pill and defaults to the clock. Select the
|
||||
issue, pull-request, and milestone icons in turn; each shows only matching
|
||||
recent activity or the native empty state, then the clock restores all rows.
|
||||
issue and pull-request icons in turn; each shows only matching recent
|
||||
activity or the native empty state, then the clock restores all rows.
|
||||
- [ ] Pull-request activity includes older creation and close events beyond the
|
||||
first activity-feed page.
|
||||
- [ ] Tap repository, issue, pull-request, and commit activity. Each opens the
|
||||
matching native tab and destination.
|
||||
- [ ] Non-linkable server activity does not navigate or appear tappable.
|
||||
|
||||
@@ -690,19 +690,34 @@ pub async fn load_home(server: &Server) -> Result<HomeData, String> {
|
||||
.map_err(|error| error.to_string())?
|
||||
.login
|
||||
.ok_or("The server account has no username.")?;
|
||||
let (activities, heatmap) = tokio::join!(
|
||||
apis::user_api::user_list_activity_feeds(
|
||||
&configuration,
|
||||
&login,
|
||||
let activity_configuration = configuration.clone();
|
||||
let activity_login = login.clone();
|
||||
let activities = async move {
|
||||
let mut activities = Vec::new();
|
||||
for page in 1.. {
|
||||
let batch = apis::user_api::user_list_activity_feeds(
|
||||
&activity_configuration,
|
||||
&activity_login,
|
||||
Some(true),
|
||||
None,
|
||||
Some(1),
|
||||
Some(40),
|
||||
),
|
||||
Some(page),
|
||||
Some(100),
|
||||
)
|
||||
.await
|
||||
.map_err(|error| error.to_string())?;
|
||||
if batch.is_empty() {
|
||||
break;
|
||||
}
|
||||
activities.extend(batch);
|
||||
}
|
||||
Ok::<_, String>(activities)
|
||||
};
|
||||
let (activities, heatmap) = tokio::join!(
|
||||
activities,
|
||||
apis::user_api::user_get_heatmap_data(&configuration, &login),
|
||||
);
|
||||
Ok(HomeData {
|
||||
activities: activities.map_err(|error| error.to_string())?,
|
||||
activities: activities?,
|
||||
heatmap: heatmap.map_err(|error| error.to_string())?,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -303,7 +303,6 @@ final class HomeViewController: RefreshingTableViewController {
|
||||
case all
|
||||
case issues
|
||||
case pulls
|
||||
case milestones
|
||||
|
||||
func includes(_ row: ActivityRow) -> Bool {
|
||||
switch self {
|
||||
@@ -313,12 +312,6 @@ final class HomeViewController: RefreshingTableViewController {
|
||||
return row.icon.contains("issue")
|
||||
case .pulls:
|
||||
return row.icon.contains("pull")
|
||||
case .milestones:
|
||||
// ponytail: Gitea has no milestone event type; use related issue text until it does.
|
||||
return row.icon.contains("milestone")
|
||||
|| row.icon.contains("issue")
|
||||
&& (row.title.localizedCaseInsensitiveContains("milestone")
|
||||
|| row.detail.localizedCaseInsensitiveContains("milestone"))
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -484,7 +477,6 @@ final class HeatmapView: UIView {
|
||||
("clock", "clock.fill", "All activity"),
|
||||
("exclamationmark.circle", "exclamationmark.circle.fill", "Issues"),
|
||||
("arrow.triangle.pull", "arrow.triangle.pull", "Pull requests"),
|
||||
("flag", "flag.fill", "Milestones"),
|
||||
]
|
||||
for (index, item) in filterItems.enumerated() {
|
||||
let button = UIButton(type: .custom, primaryAction: UIAction { action in
|
||||
|
||||
Reference in New Issue
Block a user