From 6034a47d7bb13d81fa40f3498f90c86e3052a7d5 Mon Sep 17 00:00:00 2001 From: StuBehan Date: Thu, 19 Nov 2026 07:26:11 +0000 Subject: [PATCH] feat(update): always show the update output --- AGENTS.md | 2 +- panel/Panel.swift | 5 +---- panel/PanelNav.swift | 5 ++--- panel/Updater.swift | 49 ++++++++++++++++++++++++++++---------------- 4 files changed, 35 insertions(+), 26 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index aa79368..0b60c1c 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -35,7 +35,7 @@ Cancelling a field puts it back the way it was before you started and hands the | `Tab` / `⇧Tab` | Next / previous row on pages that have them (Settings). Never a different action. | | `→` / `←` | Step into / out of a level, or through a carousel. While a value is being picked, they step the value instead (see `Space`). | | `⏎` | The selected row's main action: open, approve, activate. Every row that shows a `⏎` hint has to do something with it. | -| `Space` | Flip a toggle (Phrases defaults, the update log). In Settings it does what `⏎` does on every row: flips an on/off row, fires an action row, and on a value row (a sound, a duration, a threshold) starts picking. While picking, `←` / `→` step through the values and `Space` or `⏎` settles on one; moving to another row settles it too. | +| `Space` | Flip a toggle (Phrases defaults). In Settings it does what `⏎` does on every row: flips an on/off row, fires an action row, and on a value row (a sound, a duration, a threshold) starts picking. While picking, `←` / `→` step through the values and `Space` or `⏎` settles on one; moving to another row settles it too. | | `⌫` / `⌦` | Dismiss the selected item, where that loses nothing (an Events nudge, an Outcomes row). Anything destructive that has no confirmation step takes `⌘⌫` (killing a session, removing a phrase or an extension), and ignores autorepeat. | | `/` | Focus the page's text field, where it has one. | diff --git a/panel/Panel.swift b/panel/Panel.swift index ef75c72..28c760d 100644 --- a/panel/Panel.swift +++ b/panel/Panel.swift @@ -4429,7 +4429,7 @@ final class PanelController: NSObject, NSApplicationDelegate, PanelKeyDelegate, } // Updating: ← back to Settings, and only after a failure (so the user - // can't accidentally abandon a live install). Space toggles the log. + // can't accidentally abandon a live install). if nav.mode == .updating { let plain = mods.intersection([.command, .control, .option, .shift]).isEmpty guard plain else { return false } @@ -4437,9 +4437,6 @@ final class PanelController: NSObject, NSApplicationDelegate, PanelKeyDelegate, case KeyCode.leftArrow where nav.updaterPhase == .failed: nav.mode = .settings return true - case KeyCode.space: - nav.updaterShowLog.toggle() - return true default: return false } diff --git a/panel/PanelNav.swift b/panel/PanelNav.swift index 759f606..0547428 100644 --- a/panel/PanelNav.swift +++ b/panel/PanelNav.swift @@ -422,11 +422,10 @@ final class PanelNav: ObservableObject { // (e.g. private repo without auth). @Published var updateReleaseNotes: String? // Live updater state. updaterPhase advances as install.sh emits STAGE - // markers; updaterLog accumulates the raw install output for the - // expandable "Show output" detail in UpdatingView. + // markers; updaterLog accumulates the raw install output UpdatingView + // shows under the progress bar. @Published var updaterPhase: UpdatePhase = .idle @Published var updaterLog: String = "" - @Published var updaterShowLog: Bool = false // Post-update screen state. Populated on launch when the status file // from a previous in-flight update is found; drives the welcome-style // PostUpdateView (mode = .postUpdate). Cleared on dismiss. diff --git a/panel/Updater.swift b/panel/Updater.swift index c06d14a..5e5dc51 100644 --- a/panel/Updater.swift +++ b/panel/Updater.swift @@ -1261,8 +1261,8 @@ struct MarkdownNotesView: View { // MARK: - Updating view // Shown while install.sh is running. Top half: spinner + current phase -// label + step counter. Bottom half: a disclosure that reveals the raw -// install log (toggled via "Show output"). +// label + step counter. Bottom half: the raw install output, always shown +// so a slow or stuck step can be read without asking for it. struct UpdatingView: View { @ObservedObject var nav: PanelNav @@ -1272,7 +1272,7 @@ struct UpdatingView: View { VStack(alignment: .leading, spacing: 14) { phaseHeader progressBar - detailDisclosure + output } .padding(.horizontal, 14) .padding(.vertical, 14) @@ -1314,26 +1314,39 @@ struct UpdatingView: View { .tint(nav.updaterPhase == .failed ? .red : .accentColor) } - @ViewBuilder - private var detailDisclosure: some View { - DisclosureGroup(isExpanded: $nav.updaterShowLog) { - ScrollView { - Text(nav.updaterLog.isEmpty ? "Waiting for output…" : nav.updaterLog) - .font(.caption.monospaced()) - .foregroundStyle(.secondary) - .frame(maxWidth: .infinity, alignment: .leading) - .textSelection(.enabled) - .padding(8) + private static let outputEnd = "output-end" + + private var output: some View { + VStack(alignment: .leading, spacing: 6) { + Text("Output") + .font(.caption) + .foregroundStyle(.secondary) + // Takes whatever height the page has left, never more, so the panel + // keeps its size. Once the output outgrows it, it follows the newest + // line, so the step that's running is the one on screen. + ScrollViewReader { proxy in + ScrollView { + VStack(alignment: .leading, spacing: 0) { + Text(nav.updaterLog.isEmpty ? "Waiting for output…" : nav.updaterLog) + .font(.caption.monospaced()) + .foregroundStyle(.secondary) + .frame(maxWidth: .infinity, alignment: .leading) + .textSelection(.enabled) + .padding(8) + Color.clear.frame(height: 0).id(Self.outputEnd) + } + } + .background(ThinScrollers()) + .onChange(of: nav.updaterLog) { _ in + proxy.scrollTo(Self.outputEnd, anchor: .bottom) + } + .onAppear { proxy.scrollTo(Self.outputEnd, anchor: .bottom) } } - .frame(maxHeight: 140) + .frame(maxHeight: .infinity) .background( RoundedRectangle(cornerRadius: 6, style: .continuous) .fill(Color.primary.opacity(0.05)) ) - } label: { - Text("Show output") - .font(.caption) - .foregroundStyle(.secondary) } } }