Expand activity strip to nine months

This commit is contained in:
Georg Bauer
2026-07-31 10:56:44 +02:00
parent 82fadda983
commit 4e4dfb0db9
4 changed files with 13 additions and 14 deletions

View File

@@ -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
configured remote, for example `tea issues` or `tea issues 1`.
Run issue-detail commands directly, for example `tea issues 7`. When invoking
`tea` through an automated shell runner, allocate a pseudo-terminal (PTY);
interactive terminal use needs no extra flag. The detail command's terminal
rendering is unreliable without a PTY and may panic inside Gitea SDK version
handling.
Run issue-detail commands directly, for example `tea issues 7`. In a sandboxed
runner, grant network access before invoking `tea`. Without DNS/network access,
the current `tea` detail path may panic inside Gitea SDK version handling
instead of returning the underlying connection error.
## Required pre-commit gates

View File

@@ -108,7 +108,7 @@ xcrun simctl launch booted de.rfc1437.gotcha
## 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.
- [ ] Activity rows have the correct icon, repository, summary, and date.
- [ ] Tap repository, issue, pull-request, and commit activity. Each opens the

View File

@@ -587,7 +587,7 @@ fn activity_detail(activity: &models::Activity) -> String {
}
fn heat_cells(data: &[models::UserHeatmapData]) -> (Vec<HeatCell>, i64) {
const DAYS: i64 = 6 * 31;
const DAYS: i64 = 9 * 31;
let latest = data
.iter()
.filter_map(|entry| entry.timestamp)
@@ -771,13 +771,13 @@ mod tests {
},
];
let (cells, total) = heat_cells(&heatmap);
assert_eq!((cells.len(), total), (186, 5));
assert_eq!((cells.len(), total), (279, 5));
assert_eq!(
(
cells[184].level,
cells[184].timestamp,
cells[184].contributions,
cells[185].level,
cells[277].level,
cells[277].timestamp,
cells[277].contributions,
cells[278].level,
),
(1, 100 * 86_400, 1, 4)
);

View File

@@ -414,7 +414,7 @@ final class HeatmapView: UIView {
) ?? latest
let firstMonth = Calendar(identifier: .gregorian).date(
byAdding: .month,
value: -5,
value: -8,
to: latestMonth
) ?? latestMonth
cells = page.heatCells.filter {
@@ -423,7 +423,7 @@ final class HeatmapView: UIView {
super.init(frame: CGRect(x: 0, y: 0, width: 0, height: 132))
backgroundColor = .systemBackground
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.textColor = .secondaryLabel
addSubview(title)