Skip to content
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
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ body:
attributes:
label: Pullo version
description: Settings › About.
placeholder: "0.12.0"
placeholder: "0.12.1"
validations:
required: true
- type: input
Expand Down
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to Pullo are listed here, newest first. The format follows [

## [Unreleased]

## [0.12.1] - 2026-11-23

### Changed
- CI progress shows beside the notch again by default. To show it below the notch, choose Below the notch in Settings › Appearance.
- Inside a job, the step that is running, or the last one that ran, is listed first, so you no longer scroll to see what is happening now. Steps that have not started stay at the end.

## [0.12.0] - 2026-11-17

### Changed
Expand Down Expand Up @@ -325,7 +331,8 @@ All notable changes to Pullo are listed here, newest first. The format follows [
- An alert stays open while the pointer is over it.
- Clicks only land on the visible part of the notch. Everywhere else they go to the app behind it.

[unreleased]: https://github.com/jordan-cod/pullo/compare/v0.12.0...HEAD
[unreleased]: https://github.com/jordan-cod/pullo/compare/v0.12.1...HEAD
[0.12.1]: https://github.com/jordan-cod/pullo/compare/v0.12.0...v0.12.1
[0.12.0]: https://github.com/jordan-cod/pullo/compare/v0.11.4...v0.12.0
[0.11.4]: https://github.com/jordan-cod/pullo/compare/v0.11.3...v0.11.4
[0.11.3]: https://github.com/jordan-cod/pullo/compare/v0.11.2...v0.11.3
Expand Down
7 changes: 7 additions & 0 deletions Sources/Pullo/Domain/WorkflowJob.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ struct WorkflowStep: Identifiable, Equatable {

var id: Int { number }

var hasStarted: Bool { [.running, .passed, .failed, .cancelled].contains(state) }

func duration(now: Date) -> TimeInterval? {
guard let startedAt, state != .skipped, state != .queued else { return nil }
return (completedAt ?? now).timeIntervalSince(startedAt)
Expand All @@ -28,6 +30,11 @@ struct WorkflowJob: Identifiable, Equatable {

var currentStep: String? { steps.first { $0.state == .running }?.name }

var stepsLatestFirst: [WorkflowStep] {
guard let reached = steps.lastIndex(where: \.hasStarted) else { return steps }
return steps[...reached].reversed() + steps[(reached + 1)...]
}

var group: String {
guard let open = name.range(of: " ("), name.hasSuffix(")") else { return name }
return String(name[..<open.lowerBound])
Expand Down
2 changes: 1 addition & 1 deletion Sources/Pullo/Features/Actions/RunDetail.swift
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ private struct JobRow: View {
.disabled(!hasSteps && job.url == nil)
.hint(hint)
if isExpanded {
ForEach(job.steps) { step in
ForEach(job.stepsLatestFirst) { step in
StepRow(step: step, now: now, url: url(of: step))
}
.padding(.leading, 20)
Expand Down
6 changes: 3 additions & 3 deletions Sources/Pullo/Features/Notch/LiveCI.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ struct LiveCI: Equatable {
var othersRunning = 0
var finished: CIState?
var label: LiveCILabel = .number
var placement: LiveCIPlacement = .below
var placement: LiveCIPlacement = .beside

init(pr: PullRequest, othersRunning: Int = 0, finished: CIState? = nil, label: LiveCILabel = .number) {
id = pr.id
Expand Down Expand Up @@ -83,12 +83,12 @@ enum LiveCILabel: String, CaseIterable {
}

enum LiveCIPlacement: String, CaseIterable {
case below, beside
case beside, below

var title: String {
switch self {
case .below: String(localized: "Below the notch")
case .beside: String(localized: "Beside the notch")
case .below: String(localized: "Below the notch")
}
}
}
4 changes: 2 additions & 2 deletions Sources/Pullo/Features/Settings/AppSettings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ final class AppSettings {
panelStyle = (defaults.object(for: .panelStyle) as? String).flatMap(PanelStyle.init(rawValue:)) ?? .solid
showsLiveCI = defaults.object(for: .liveCI) as? Bool ?? true
liveCILabel = (defaults.object(for: .liveCILabel) as? String).flatMap(LiveCILabel.init(rawValue:)) ?? .number
liveCIPlacement = (defaults.object(for: .liveCIPlacement) as? String).flatMap(LiveCIPlacement.init(rawValue:)) ?? .below
liveCIPlacement = (defaults.object(for: .liveCISide) as? String).flatMap(LiveCIPlacement.init(rawValue:)) ?? .beside
display = (defaults.object(for: .display) as? String).flatMap(DisplayChoice.init(rawValue:)) ?? .builtIn
shortcut = (defaults.object(for: .shortcut) as? String).flatMap(ShortcutChoice.init(rawValue:)) ?? .optionCommandP
holdsAlertsInFullScreen = defaults.object(for: .holdInFullScreen) as? Bool ?? false
Expand Down Expand Up @@ -91,7 +91,7 @@ final class AppSettings {
defaults.set(panelStyle.rawValue, for: .panelStyle)
defaults.set(showsLiveCI, for: .liveCI)
defaults.set(liveCILabel.rawValue, for: .liveCILabel)
defaults.set(liveCIPlacement.rawValue, for: .liveCIPlacement)
defaults.set(liveCIPlacement.rawValue, for: .liveCISide)
defaults.set(display.rawValue, for: .display)
defaults.set(shortcut.rawValue, for: .shortcut)
defaults.set(holdsAlertsInFullScreen, for: .holdInFullScreen)
Expand Down
2 changes: 1 addition & 1 deletion Sources/Pullo/Support/DefaultsKey.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Foundation

enum DefaultsKey: String {
case accounts, tabs, runTabs, unreadableTabs, unreadableRunTabs
case mutedCategories, mutedAccounts, haptics, sound, categorySounds, panelStyle, liveCI, liveCILabel, liveCIPlacement
case mutedCategories, mutedAccounts, haptics, sound, categorySounds, panelStyle, liveCI, liveCILabel, liveCISide
case display, shortcut, holdInFullScreen
case readBaselines, readKnownAccounts
case betaUpdates
Expand Down
10 changes: 8 additions & 2 deletions Tests/PulloTests/AppSettingsTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,16 @@ struct AppSettingsTests {
#expect(AppSettings(defaults: scratch.defaults).liveCILabel == .both)
}

@Test func ciProgressShowsBelowTheNotchUntilBesideIsChosen() {
@Test func ciProgressShowsBesideTheNotchUntilBelowIsChosen() {
let scratch = ScratchDefaults()
#expect(AppSettings(defaults: scratch.defaults).liveCIPlacement == .beside)
AppSettings(defaults: scratch.defaults).liveCIPlacement = .below
#expect(AppSettings(defaults: scratch.defaults).liveCIPlacement == .below)
AppSettings(defaults: scratch.defaults).liveCIPlacement = .beside
}

@Test func ciProgressIgnoresThePlacementSavedBy0120() {
let scratch = ScratchDefaults()
scratch.defaults.set("below", forKey: "liveCIPlacement")
#expect(AppSettings(defaults: scratch.defaults).liveCIPlacement == .beside)
}

Expand Down
2 changes: 1 addition & 1 deletion Tests/PulloTests/FirstRunTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ extension NotchBehavior {
hasNotch: false
)
#expect(h.notch.liveCI?.id == "PR_1")
#expect(h.notch.layout.size(for: .closed).height > 24)
#expect(h.notch.layout.size(for: .closed).width > NotchGeometry.pillWidth)
}
}
}
Expand Down
10 changes: 5 additions & 5 deletions Tests/PulloTests/LiveCITests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,20 @@ extension NotchBehavior {
#expect(h.notch.liveCI?.othersRunning == 1)
}

@Test func dropsBelowTheClosedNotchWhileChecksRun() async {
@Test func dropsBelowTheClosedNotchWhenShownBelowIt() async {
let idle = await NotchHarness()
let busy = await NotchHarness(mine: [Self.running("PR_1", minutesAgo: 1)])
#expect(idle.notch.liveCI == nil)
busy.settings.liveCIPlacement = .below
let closed = busy.notch.layout.size(for: .closed)
#expect(closed.width == idle.notch.layout.size(for: .closed).width)
#expect(closed.height == idle.notch.layout.size(for: .closed).height + LiveCI.dropHeight)
#expect(busy.notch.layout.hitRect(for: .closed).height > idle.notch.layout.hitRect(for: .closed).height)
}

@Test func widensTheClosedNotchWhenShownBesideIt() async {
@Test func widensTheClosedNotchWhileChecksRun() async {
let idle = await NotchHarness()
let busy = await NotchHarness(mine: [Self.running("PR_1", minutesAgo: 1)])
busy.settings.liveCIPlacement = .beside
#expect(idle.notch.liveCI == nil)
let closed = busy.notch.layout.size(for: .closed)
#expect(closed.width > idle.notch.layout.size(for: .closed).width)
#expect(closed.height == idle.notch.layout.size(for: .closed).height)
Expand All @@ -47,6 +47,7 @@ extension NotchBehavior {

@Test func growsWiderBelowANarrowNotchWhenTheLabelDoesNotFit() async {
let h = await NotchHarness(mine: [Self.running("PR_1", minutesAgo: 1)])
h.settings.liveCIPlacement = .below
h.notch.geometry.notchSize.width = 60
h.settings.liveCILabel = .both
#expect(h.notch.layout.size(for: .closed).width > 60)
Expand All @@ -64,7 +65,6 @@ extension NotchBehavior {

@Test func followsTheChosenLabel() async {
let h = await NotchHarness(mine: [Self.running("PR_1", minutesAgo: 1)])
h.settings.liveCIPlacement = .beside
#expect(h.notch.liveCI?.trailingText == "#383")
h.settings.liveCILabel = .checks
#expect(h.notch.liveCI?.trailingText == "3/5")
Expand Down
16 changes: 16 additions & 0 deletions Tests/PulloTests/WorkflowRunTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,22 @@ struct WorkflowRunTests {
#expect(jobs[2].steps.first?.number == 1)
}

@Test func listsTheLatestStepFirstAndThePendingOnesLast() {
let step = { (number: Int, state: WorkflowRun.State) in
WorkflowStep(number: number, name: "Step \(number)", state: state, startedAt: nil, completedAt: nil)
}
let job = WorkflowJob(
id: 1, name: "test", state: .running, url: nil, startedAt: nil, completedAt: nil,
steps: [step(1, .passed), step(2, .skipped), step(3, .passed), step(4, .running), step(5, .queued), step(6, .queued)]
)
#expect(job.stepsLatestFirst.map(\.number) == [4, 3, 2, 1, 5, 6])
let waiting = WorkflowJob(
id: 2, name: "test", state: .queued, url: nil, startedAt: nil, completedAt: nil,
steps: [step(1, .queued), step(2, .queued)]
)
#expect(waiting.stepsLatestFirst.map(\.number) == [1, 2])
}

@Test func groupsMatrixJobsAndPutsFailuresFirst() {
let groups = JobGroup.grouping([
.make(id: 1, name: "lint", state: .passed),
Expand Down
Loading