From 9df07da9da64b31642afc3953cb05d8b5e8dd32c Mon Sep 17 00:00:00 2001 From: Fabian Meyer <44942030+dinooo13@users.noreply.github.com> Date: Sat, 7 Nov 2026 02:35:07 +0100 Subject: [PATCH] Settings: a quiet model load, indicator cards at one scale, no subtitle a label already says MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - A speech model switch says "Loading the speech model…" in the Model row's subtitle instead of a regular-size spinner row; Get Started and the polish model's check use BusyRow, a sentence with a small spinner at the trailing edge. - The recording indicator cards draw every pill at one scale, centred, on shorter cards. - "Check for updates automatically" and "Mute other audio while recording" lose their subtitles and hints; the managed line stays. - DESIGN.md says all three. Co-Authored-By: Claude Opus 5.5 --- .../Pladder/Resources/Localizable.xcstrings | 20 ------------ .../Settings/GeneralSettingsView.swift | 31 ++++++++++--------- Sources/Pladder/Settings/OptionCards.swift | 23 ++++++-------- Sources/Pladder/Settings/SettingsView.swift | 17 ++++++++++ .../Pladder/Settings/TextSettingsView.swift | 4 +-- docs/DESIGN.md | 11 +++++-- 6 files changed, 53 insertions(+), 53 deletions(-) diff --git a/Sources/Pladder/Resources/Localizable.xcstrings b/Sources/Pladder/Resources/Localizable.xcstrings index d7975ab..d1c79d3 100644 --- a/Sources/Pladder/Resources/Localizable.xcstrings +++ b/Sources/Pladder/Resources/Localizable.xcstrings @@ -101,16 +101,6 @@ } } }, - "Asks GitHub once a day for a newer Pladder. Sends nothing about you.": { - "localizations": { - "de": { - "stringUnit": { - "state": "translated", - "value": "Fragt einmal am Tag bei GitHub nach einem neueren Pladder. Sendet nichts über dich." - } - } - } - }, "Built into macOS. Adds one to two seconds to each dictation.": { "localizations": { "de": { @@ -951,16 +941,6 @@ } } }, - "So music or a call does not end up in the dictation.": { - "localizations": { - "de": { - "stringUnit": { - "state": "translated", - "value": "Damit Musik oder ein Anruf nicht im Diktat landet." - } - } - } - }, "Tap to start, tap again to paste.": { "localizations": { "de": { diff --git a/Sources/Pladder/Settings/GeneralSettingsView.swift b/Sources/Pladder/Settings/GeneralSettingsView.swift index e043c28..259c5c1 100644 --- a/Sources/Pladder/Settings/GeneralSettingsView.swift +++ b/Sources/Pladder/Settings/GeneralSettingsView.swift @@ -86,9 +86,11 @@ private struct GetStartedSection: View { } } -// Shown in Get Started while it lasts, and in the speech model's own section after. +// Shown in Get Started while it lasts, and in the speech model's own section after, where +// a load is only the Model row's subtitle: a switch of model is not setup. private struct SpeechModelProgress: View { let model: AppModel + var showsLoading = true var body: some View { switch model.coordinator.engineStatus { @@ -106,8 +108,8 @@ private struct SpeechModelProgress: View { } } case .loading: - ProgressView { - Text("Loading the speech model…") + if showsLoading { + BusyRow("Loading the speech model…") } case .failed(let failure): LabeledContent { @@ -137,20 +139,14 @@ private struct StartupSection: View { // Its own line, not the group's footer: the rest of the group is the user's. Toggle(isOn: $model.settings.checksForUpdatesAutomatically) { Text("Check for updates automatically") - Text("Asks GitHub once a day for a newer Pladder. Sends nothing about you.") if model.policy.updateChecks != nil { Text(ManagedText.footer) } } - .accessibilityHint(Text("Asks GitHub once a day for a newer Pladder. Sends nothing about you.")) .disabled(model.policy.updateChecks != nil) } Toggle("Play start and stop sounds", isOn: $model.settings.playSounds) - Toggle(isOn: $model.settings.muteOutputWhileDictating) { - Text("Mute other audio while recording") - Text("So music or a call does not end up in the dictation.") - } - .accessibilityHint(Text("So music or a call does not end up in the dictation.")) + Toggle("Mute other audio while recording", isOn: $model.settings.muteOutputWhileDictating) } } } @@ -250,13 +246,12 @@ private struct SpeechModelSection: View { } } label: { Text("Model") - // The registry's own text, localized where it is built. - Text(verbatim: model.registry.entry(for: model.settings.engineID)?.detail ?? "") + Text(verbatim: detail) } - .accessibilityHint(Text(verbatim: model.registry.entry(for: model.settings.engineID)?.detail ?? "")) + .accessibilityHint(Text(verbatim: detail)) .disabled(model.policy.pinsEngine) if !model.showsGetStarted { - SpeechModelProgress(model: model) + SpeechModelProgress(model: model, showsLoading: false) } } header: { Text("Speech Model") @@ -267,6 +262,14 @@ private struct SpeechModelSection: View { } } + private var detail: String { + if case .loading = model.coordinator.engineStatus, !model.showsGetStarted { + return String(localized: "Loading the speech model…") + } + // The registry's own text, localized where it is built. + return model.registry.entry(for: model.settings.engineID)?.detail ?? "" + } + private var engines: [EngineRegistry.Entry] { let allowed = model.policy.engines(from: model.registry.available.map(\.id)) return model.registry.available.filter { allowed.contains($0.id) } diff --git a/Sources/Pladder/Settings/OptionCards.swift b/Sources/Pladder/Settings/OptionCards.swift index d9ea203..64427bc 100644 --- a/Sources/Pladder/Settings/OptionCards.swift +++ b/Sources/Pladder/Settings/OptionCards.swift @@ -68,7 +68,7 @@ struct OptionCard: View { @ViewBuilder let thumbnail: Thumbnail // Computed, since a generic type cannot hold static stored values. - private static var designSize: CGSize { CGSize(width: 132, height: 84) } + private static var designSize: CGSize { CGSize(width: 132, height: 62) } private static var scale: CGFloat { 0.75 } private static var cardSize: CGSize { CGSize(width: (designSize.width * scale).rounded(), height: (designSize.height * scale).rounded()) @@ -105,12 +105,14 @@ struct OverlayStyleThumbnail: View { let style: OverlayStyle private static let previewLevel: Float = 0.55 + // One scale for every style, so the cards compare sizes the way the real pills do. + private static let pillScale: CGFloat = 0.65 var body: some View { DesktopWash() // Overlay rather than ZStack: a scaled-down pill still lays out at full size, and in // a ZStack that would stretch the backdrop so the card only shows its middle. - .overlay(alignment: style == .menuBar ? .top : .bottom) { + .overlay(alignment: style == .menuBar ? .top : .center) { content } } @@ -118,18 +120,12 @@ struct OverlayStyleThumbnail: View { @ViewBuilder private var content: some View { switch style { - case .compact: - OverlayPill(state: .recording, level: Self.previewLevel, style: .compact, isPreview: true) - .fixedSize() - .scaleEffect(0.62) - .padding(.bottom, 2) - case .minimal: - OverlayPill(state: .recording, level: Self.previewLevel, style: .minimal, isPreview: true) - .fixedSize() - .scaleEffect(0.8) - .padding(.bottom, 10) case .menuBar: menuBar + case .compact, .minimal: + OverlayPill(state: .recording, level: Self.previewLevel, style: style, isPreview: true) + .fixedSize() + .scaleEffect(Self.pillScale) case .liveTranscript: OverlayPill( state: .recording, @@ -142,8 +138,7 @@ struct OverlayStyleThumbnail: View { // Proposed at the card's width the glass shrinks but the row does not, and the dot // ends up outside the capsule. .fixedSize() - .scaleEffect(0.8) - .padding(.bottom, 4) + .scaleEffect(Self.pillScale) } } diff --git a/Sources/Pladder/Settings/SettingsView.swift b/Sources/Pladder/Settings/SettingsView.swift index ec72306..d2bd290 100644 --- a/Sources/Pladder/Settings/SettingsView.swift +++ b/Sources/Pladder/Settings/SettingsView.swift @@ -100,6 +100,23 @@ struct WarningLabel: View { } } +// Work under way, as System Settings shows it: the sentence, and a small spinner at the +// trailing edge. The regular size is a 32 pt wheel that outweighs the form. +struct BusyRow: View { + let text: LocalizedStringKey + + init(_ text: LocalizedStringKey) { self.text = text } + + var body: some View { + LabeledContent { + ProgressView() + .controlSize(.small) + } label: { + Text(text) + } + } +} + struct PermissionRow: View { let title: LocalizedStringKey let detail: String diff --git a/Sources/Pladder/Settings/TextSettingsView.swift b/Sources/Pladder/Settings/TextSettingsView.swift index 2a4f15b..8e3c23d 100644 --- a/Sources/Pladder/Settings/TextSettingsView.swift +++ b/Sources/Pladder/Settings/TextSettingsView.swift @@ -87,9 +87,7 @@ struct TextSettingsView: View { Text(fraction, format: .percent.precision(.fractionLength(0))) } case .verifying: - ProgressView { - Text("Checking the download…") - } + BusyRow("Checking the download…") case .failed(let failure): LabeledContent { Button("Try Again") { model.polish.retryDownload() } diff --git a/docs/DESIGN.md b/docs/DESIGN.md index e834dcc..ecdba4a 100644 --- a/docs/DESIGN.md +++ b/docs/DESIGN.md @@ -42,7 +42,8 @@ Three rules decide most questions: - **Section headers in Title Case** ("Keyboard Shortcuts", "Recording Indicator"); row labels in sentence case ("Mute other audio while recording"). - **A row that needs explaining gets one short subtitle** under its label, saying - what it does or why, not how it works. The same sentence is the control's + what it does or why, not how it works. A label that already says it gets none + ("Check for updates automatically", "Mute other audio while recording"). The same sentence is the control's accessibility hint, so VoiceOver users moving control by control hear it too. On macOS `.help` and the accessibility hint are one attribute, so a control with help puts the hint first in it. @@ -63,7 +64,13 @@ Three rules decide most questions: a well with the glyphs (⌥Space) and a clear button. All share one width per language. Focus rings only with Full Keyboard Access. - **Choices with a picture** (the recording indicator styles) are a radio group of - cards with a neutral thumbnail, focusable and announced as one group. + cards with a neutral thumbnail, focusable and announced as one group. Every pill is + drawn at one scale and centred, so the cards compare sizes as the real pills do. +- **Work under way** is a sentence with an ellipsis. When it belongs to a row, a + model switch say, it takes that row's subtitle; otherwise it is a row of its own + with a small spinner at the trailing edge (`BusyRow`). A download shows its bar. + Never the regular-size spinner: it outweighs the form, and the menu and its icon + already say the model is loading. - **Empty states** use `ContentUnavailableView` with the one action that fills them, and hide the controls that only make sense with content (the dictionary's table, its add and remove buttons, its test field).