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.
|
- [ ] Activity rows have the correct icon, repository, summary, and date.
|
||||||
- [ ] The compact icon row below the activity graph sits flat on the normal
|
- [ ] 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
|
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
|
issue and pull-request icons in turn; each shows only matching recent
|
||||||
recent activity or the native empty state, then the clock restores all rows.
|
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
|
- [ ] Tap repository, issue, pull-request, and commit activity. Each opens the
|
||||||
matching native tab and destination.
|
matching native tab and destination.
|
||||||
- [ ] Non-linkable server activity does not navigate or appear tappable.
|
- [ ] 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())?
|
.map_err(|error| error.to_string())?
|
||||||
.login
|
.login
|
||||||
.ok_or("The server account has no username.")?;
|
.ok_or("The server account has no username.")?;
|
||||||
|
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(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!(
|
let (activities, heatmap) = tokio::join!(
|
||||||
apis::user_api::user_list_activity_feeds(
|
activities,
|
||||||
&configuration,
|
|
||||||
&login,
|
|
||||||
Some(true),
|
|
||||||
None,
|
|
||||||
Some(1),
|
|
||||||
Some(40),
|
|
||||||
),
|
|
||||||
apis::user_api::user_get_heatmap_data(&configuration, &login),
|
apis::user_api::user_get_heatmap_data(&configuration, &login),
|
||||||
);
|
);
|
||||||
Ok(HomeData {
|
Ok(HomeData {
|
||||||
activities: activities.map_err(|error| error.to_string())?,
|
activities: activities?,
|
||||||
heatmap: heatmap.map_err(|error| error.to_string())?,
|
heatmap: heatmap.map_err(|error| error.to_string())?,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -303,7 +303,6 @@ final class HomeViewController: RefreshingTableViewController {
|
|||||||
case all
|
case all
|
||||||
case issues
|
case issues
|
||||||
case pulls
|
case pulls
|
||||||
case milestones
|
|
||||||
|
|
||||||
func includes(_ row: ActivityRow) -> Bool {
|
func includes(_ row: ActivityRow) -> Bool {
|
||||||
switch self {
|
switch self {
|
||||||
@@ -313,12 +312,6 @@ final class HomeViewController: RefreshingTableViewController {
|
|||||||
return row.icon.contains("issue")
|
return row.icon.contains("issue")
|
||||||
case .pulls:
|
case .pulls:
|
||||||
return row.icon.contains("pull")
|
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"),
|
("clock", "clock.fill", "All activity"),
|
||||||
("exclamationmark.circle", "exclamationmark.circle.fill", "Issues"),
|
("exclamationmark.circle", "exclamationmark.circle.fill", "Issues"),
|
||||||
("arrow.triangle.pull", "arrow.triangle.pull", "Pull requests"),
|
("arrow.triangle.pull", "arrow.triangle.pull", "Pull requests"),
|
||||||
("flag", "flag.fill", "Milestones"),
|
|
||||||
]
|
]
|
||||||
for (index, item) in filterItems.enumerated() {
|
for (index, item) in filterItems.enumerated() {
|
||||||
let button = UIButton(type: .custom, primaryAction: UIAction { action in
|
let button = UIButton(type: .custom, primaryAction: UIAction { action in
|
||||||
|
|||||||
Reference in New Issue
Block a user