Expand activity strip to nine months
This commit is contained in:
@@ -6,11 +6,10 @@ Use the `tea` command-line tool as the preferred way to list, inspect, create,
|
|||||||
and update Gitea issues. Run it from the repository root so it can use the
|
and update Gitea issues. Run it from the repository root so it can use the
|
||||||
configured remote, for example `tea issues` or `tea issues 1`.
|
configured remote, for example `tea issues` or `tea issues 1`.
|
||||||
|
|
||||||
Run issue-detail commands directly, for example `tea issues 7`. When invoking
|
Run issue-detail commands directly, for example `tea issues 7`. In a sandboxed
|
||||||
`tea` through an automated shell runner, allocate a pseudo-terminal (PTY);
|
runner, grant network access before invoking `tea`. Without DNS/network access,
|
||||||
interactive terminal use needs no extra flag. The detail command's terminal
|
the current `tea` detail path may panic inside Gitea SDK version handling
|
||||||
rendering is unreliable without a PTY and may panic inside Gitea SDK version
|
instead of returning the underlying connection error.
|
||||||
handling.
|
|
||||||
|
|
||||||
## Required pre-commit gates
|
## Required pre-commit gates
|
||||||
|
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ xcrun simctl launch booted de.rfc1437.gotcha
|
|||||||
|
|
||||||
## Home
|
## Home
|
||||||
|
|
||||||
- [ ] Home shows the selected server name, contribution total, six labeled
|
- [ ] Home shows the selected server name, contribution total, nine labeled
|
||||||
months with gaps between them, and recent activity.
|
months with gaps between them, and recent activity.
|
||||||
- [ ] Activity rows have the correct icon, repository, summary, and date.
|
- [ ] Activity rows have the correct icon, repository, summary, and date.
|
||||||
- [ ] Tap repository, issue, pull-request, and commit activity. Each opens the
|
- [ ] Tap repository, issue, pull-request, and commit activity. Each opens the
|
||||||
|
|||||||
@@ -587,7 +587,7 @@ fn activity_detail(activity: &models::Activity) -> String {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn heat_cells(data: &[models::UserHeatmapData]) -> (Vec<HeatCell>, i64) {
|
fn heat_cells(data: &[models::UserHeatmapData]) -> (Vec<HeatCell>, i64) {
|
||||||
const DAYS: i64 = 6 * 31;
|
const DAYS: i64 = 9 * 31;
|
||||||
let latest = data
|
let latest = data
|
||||||
.iter()
|
.iter()
|
||||||
.filter_map(|entry| entry.timestamp)
|
.filter_map(|entry| entry.timestamp)
|
||||||
@@ -771,13 +771,13 @@ mod tests {
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
let (cells, total) = heat_cells(&heatmap);
|
let (cells, total) = heat_cells(&heatmap);
|
||||||
assert_eq!((cells.len(), total), (186, 5));
|
assert_eq!((cells.len(), total), (279, 5));
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
(
|
(
|
||||||
cells[184].level,
|
cells[277].level,
|
||||||
cells[184].timestamp,
|
cells[277].timestamp,
|
||||||
cells[184].contributions,
|
cells[277].contributions,
|
||||||
cells[185].level,
|
cells[278].level,
|
||||||
),
|
),
|
||||||
(1, 100 * 86_400, 1, 4)
|
(1, 100 * 86_400, 1, 4)
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -414,7 +414,7 @@ final class HeatmapView: UIView {
|
|||||||
) ?? latest
|
) ?? latest
|
||||||
let firstMonth = Calendar(identifier: .gregorian).date(
|
let firstMonth = Calendar(identifier: .gregorian).date(
|
||||||
byAdding: .month,
|
byAdding: .month,
|
||||||
value: -5,
|
value: -8,
|
||||||
to: latestMonth
|
to: latestMonth
|
||||||
) ?? latestMonth
|
) ?? latestMonth
|
||||||
cells = page.heatCells.filter {
|
cells = page.heatCells.filter {
|
||||||
@@ -423,7 +423,7 @@ final class HeatmapView: UIView {
|
|||||||
super.init(frame: CGRect(x: 0, y: 0, width: 0, height: 132))
|
super.init(frame: CGRect(x: 0, y: 0, width: 0, height: 132))
|
||||||
backgroundColor = .systemBackground
|
backgroundColor = .systemBackground
|
||||||
let title = UILabel(frame: CGRect(x: 16, y: 12, width: 300, height: 22))
|
let title = UILabel(frame: CGRect(x: 16, y: 12, width: 300, height: 22))
|
||||||
title.text = "Activity · last 6 months"
|
title.text = "Activity · last 9 months"
|
||||||
title.font = .preferredFont(forTextStyle: .subheadline)
|
title.font = .preferredFont(forTextStyle: .subheadline)
|
||||||
title.textColor = .secondaryLabel
|
title.textColor = .secondaryLabel
|
||||||
addSubview(title)
|
addSubview(title)
|
||||||
|
|||||||
Reference in New Issue
Block a user