Show release notes in-app instead of opening the web releases page
New "Read Release Notes" entries in the Help menu (current installed version) and the "Check for Updates" alert (the new, not-yet-installed version) render a release's markdown notes in a Confab modal. - UpdateCheckService.fetchReleaseNotes(forTag:) fetches a release's title + body from Gitea's public releases-by-tag API, caching the result by version tag in the settings table (a published release's notes don't change, so no need to refetch on every view). - ReleaseNotesView reuses the existing MarkdownContentView renderer; shows a friendly "not available yet" state for versions with no published Gitea release (e.g. a dev build ahead of the last release). - ReleaseNotesRequest carries which version to show atomically via .sheet(item:), per this project's established sheet-timing pattern. - Removed the redundant "Release Page" button from the update alert now that notes show in-app; added an explicit .keyboardShortcut (.cancelAction) to its cancel button so Escape actually closes it — role: .cancel alone didn't do it, since NSAlert only auto-binds Escape to a button literally titled "Cancel".
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
//
|
||||
// ReleaseNotesRequest.swift
|
||||
// Confab
|
||||
//
|
||||
// Sheet-presentation payload for ReleaseNotesView
|
||||
//
|
||||
// SPDX-License-Identifier: PolyForm-Noncommercial-1.0.0
|
||||
// Copyright (C) 2026 Rune Olsen
|
||||
//
|
||||
// This file is part of Confab.
|
||||
//
|
||||
// Confab is licensed under the PolyForm Noncommercial License 1.0.0.
|
||||
// You may use, study, modify, and share it for any noncommercial
|
||||
// purpose. Commercial use — including selling Confab or any part of
|
||||
// it, standalone or bundled into another product or service —
|
||||
// requires a separate commercial license from the copyright holder.
|
||||
//
|
||||
// See the LICENSE file or
|
||||
// <https://polyformproject.org/licenses/noncommercial/1.0.0> for
|
||||
// the full license text. For commercial licensing, contact Rune
|
||||
// Olsen via <https://confab.no>.
|
||||
|
||||
import Foundation
|
||||
|
||||
/// Carries which version's release notes to show atomically to `.sheet(item:)` — avoids the
|
||||
/// two-sequential-@State-mutations race documented for sheets that show existing data.
|
||||
struct ReleaseNotesRequest: Identifiable {
|
||||
let id = UUID()
|
||||
/// Git tag form, e.g. "v2.5.0".
|
||||
let versionTag: String
|
||||
/// true: opened from the Help menu for the currently-installed version.
|
||||
/// false: opened from the "update available" alert for a not-yet-installed version.
|
||||
let isCurrentlyInstalled: Bool
|
||||
}
|
||||
Reference in New Issue
Block a user