checkpoint before checking out main

This commit is contained in:
Rocky
2026-08-25 13:42:00 +08:00
parent 57844ce615
commit dccafe6f9e
105 changed files with 4302 additions and 1323 deletions
+2 -6
View File
@@ -88,13 +88,13 @@ struct DashboardView: View {
.frame(maxWidth: .infinity, alignment: .leading)
}
// MARK: - Stats (7-day chart + cumulative grid shared cluster)
// MARK: - Stats (monthly calendar + cumulative grid shared cluster)
private var statCluster: some View {
UsageStatsCluster(
layout: .split,
language: lang,
points: stats.last7Days,
points: stats.currentMonth,
dictationCharacterCount: stats.dictationCharacterCount,
dictationDurationSeconds: stats.dictationDurationSeconds,
translationCharacterCount: stats.translationCharacterCount,
@@ -225,10 +225,6 @@ struct BottomDictationBar: View {
palette.surfaceElevated,
in: RoundedRectangle(cornerRadius: Radius.medium, style: .continuous)
)
.overlay(
RoundedRectangle(cornerRadius: Radius.medium, style: .continuous)
.stroke(palette.divider, lineWidth: 0.5)
)
}
.menuStyle(.borderlessButton)
.fixedSize()
+1 -18
View File
@@ -133,7 +133,7 @@ private struct MacGlassSurface<S: Shape>: ViewModifier {
// Flat, shadowless surface fill. We deliberately avoid `glassEffect`
// here: on macOS 26 Liquid Glass adds a raised drop shadow to every
// card, which reads as visual noise for content containers. Hierarchy
// is carried by the surface colour + hairline border instead.
// is carried by the semantic surface colour instead.
content
.background(palette.surface.opacity(fillOpacity), in: shape)
}
@@ -361,10 +361,6 @@ struct MacSettingsIconButton: View {
.foregroundStyle(disabled ? palette.textTertiary : palette.textSecondary)
.frame(width: MacMetrics.settingsControlHeight, height: MacMetrics.settingsControlHeight)
.background(palette.surfaceElevated, in: RoundedRectangle(cornerRadius: Radius.medium, style: .continuous))
.overlay(
RoundedRectangle(cornerRadius: Radius.medium, style: .continuous)
.stroke(palette.divider, lineWidth: 0.5)
)
}
.buttonStyle(.plain)
.disabled(disabled)
@@ -381,9 +377,6 @@ struct MacSettingsToolButton: View {
var fill: Color?
/// Text color. Defaults to primary text (tertiary when disabled).
var foreground: Color?
/// Hairline divider border drawn for the neutral variant, hidden for
/// colored fills (delete / download) so the fill reads as the button.
var showsBorder: Bool = true
var disabled: Bool = false
let action: () -> Void
@@ -396,11 +389,6 @@ struct MacSettingsToolButton: View {
.padding(.horizontal, Spacing.md)
.frame(minHeight: 34)
.background(fill ?? palette.surfaceElevated, in: shape)
.overlay {
if showsBorder {
shape.stroke(palette.divider, lineWidth: 0.5)
}
}
}
.buttonStyle(.plain)
.disabled(disabled)
@@ -485,7 +473,6 @@ extension MacPageHeader where Trailing == EmptyView {
/// Elevated surface used for stat tiles and the dictation canvas.
struct MacCard<Content: View>: View {
@Environment(\.themePalette) private var palette
var padding: CGFloat = Spacing.md
var cornerRadius: CGFloat = Radius.medium
@ViewBuilder var content: () -> Content
@@ -496,10 +483,6 @@ struct MacCard<Content: View>: View {
content()
.padding(padding)
.macGlassSurface(in: shape, fillOpacity: 1)
.overlay(
shape
.stroke(palette.divider, lineWidth: 0.5)
)
}
}
+12 -21
View File
@@ -14,8 +14,6 @@ struct MacDictionaryView: View {
@State private var showEntryEditor = false
@State private var generatingAliasEntryIDs: Set<UUID> = []
private let aliasGenerator = DictionaryAliasGenerator()
private var lang: AppUILanguage { viewModel.config.uiLanguage }
private var entries: [PersonalDictionary.Entry] {
@@ -235,29 +233,22 @@ struct MacDictionaryView: View {
private func saveManualEntry(term: String) {
let store = AppGroupStore(defaults: viewModel.defaults)
var dictionary = store.personalDictionary
guard let saved = dictionary.upsertManual(term: term) else { return }
dictionary.version += 1
store.setPersonalDictionary(dictionary)
let service = PersonalDictionaryEntryService(
store: store,
cloudPush: { dictionary in
try? await MacICloudSyncBootstrap.dictionarySync.pushLocalIfEnabled(dictionary)
}
)
guard let saved = service.saveEntry(term: term, source: .manual) else { return }
viewModel.refreshDictionaryFromCloud()
generatingAliasEntryIDs.insert(saved.id)
if saved.shouldGenerateAliases {
generatingAliasEntryIDs.insert(saved.entryID)
}
Task {
try? await MacICloudSyncBootstrap.dictionarySync.pushLocalIfEnabled(dictionary)
let aliases = await aliasGenerator.generateAliases(for: saved.term)
generatingAliasEntryIDs.remove(saved.id)
guard !aliases.isEmpty else { return }
var latest = store.personalDictionary
guard latest.entries.contains(where: {
$0.id == saved.id && $0.term == saved.term
}) else { return }
latest.updateAliases(for: saved.id, aliases: aliases)
latest.version += 1
store.setPersonalDictionary(latest)
await service.finishSaving(saved)
generatingAliasEntryIDs.remove(saved.entryID)
viewModel.refreshDictionaryFromCloud()
try? await MacICloudSyncBootstrap.dictionarySync.pushLocalIfEnabled(latest)
}
}
}
@@ -377,8 +377,7 @@ struct MacLocalASRModelSettingsView: View {
MacSettingsToolButton(
title: MacL10n.string("mac.localASR.delete", language: lang),
fill: palette.danger.opacity(0.15),
foreground: palette.danger,
showsBorder: false
foreground: palette.danger
) {
modelVM.deleteModel(model)
}
@@ -386,8 +385,7 @@ struct MacLocalASRModelSettingsView: View {
MacSettingsToolButton(
title: MacL10n.string("mac.localASR.download", language: lang),
fill: palette.accent,
foreground: .white,
showsBorder: false
foreground: .white
) {
modelVM.installModel(model)
}
+2 -7
View File
@@ -350,7 +350,6 @@ struct MacOnboardingView: View {
.padding(.horizontal, Spacing.md)
.frame(maxWidth: .infinity)
.background(cardShape.fill(palette.surface))
.overlay(cardShape.stroke(palette.divider, lineWidth: 0.5))
}
private func permissionCard(isGranted: Bool, grantedText: String, neededText: String) -> some View {
@@ -368,7 +367,6 @@ struct MacOnboardingView: View {
.padding(Spacing.md)
.frame(maxWidth: .infinity)
.background(cardShape.fill(palette.surface))
.overlay(cardShape.stroke((isGranted ? palette.accent : palette.warning).opacity(0.25), lineWidth: 1))
}
private var enginePicker: some View {
@@ -423,7 +421,6 @@ struct MacOnboardingView: View {
.padding(Spacing.md)
.frame(maxWidth: .infinity)
.background(cardShape.fill(selected ? palette.accentMuted : palette.surface))
.overlay(cardShape.stroke(selected ? palette.accent.opacity(0.5) : palette.divider, lineWidth: selected ? 1 : 0.5))
.contentShape(Rectangle())
}
.buttonStyle(.plain)
@@ -461,7 +458,6 @@ struct MacOnboardingView: View {
.padding(Spacing.md)
.frame(maxWidth: .infinity)
.background(cardShape.fill(palette.surface))
.overlay(cardShape.stroke(palette.divider, lineWidth: 0.5))
}
private var localModelPanel: some View {
@@ -513,7 +509,6 @@ struct MacOnboardingView: View {
.padding(Spacing.md)
.frame(maxWidth: .infinity)
.background(cardShape.fill(palette.surface))
.overlay(cardShape.stroke(palette.divider, lineWidth: 0.5))
}
// MARK: Progress dots
@@ -577,8 +572,8 @@ struct MacOnboardingView: View {
.padding(.horizontal, Spacing.lg)
.frame(minHeight: 44)
.background(
RoundedRectangle(cornerRadius: Radius.large, style: .continuous)
.stroke(palette.dividerStrong, lineWidth: 0.5)
palette.surfaceElevated,
in: RoundedRectangle(cornerRadius: Radius.large, style: .continuous)
)
}
.buttonStyle(.plain)
-10
View File
@@ -403,12 +403,6 @@ private struct MacPolishStyleCard: View {
isSelected ? palette.accentMuted : palette.surface,
in: shape
)
.overlay(
shape.stroke(
isSelected ? palette.accent : hoverBorder,
lineWidth: isSelected ? 1.5 : 0.5
)
)
.clipShape(shape)
.scaleEffect(isHovering ? 1.01 : 1)
.animation(Motion.quick, value: isHovering)
@@ -421,10 +415,6 @@ private struct MacPolishStyleCard: View {
}
}
}
private var hoverBorder: Color {
isHovering ? palette.dividerStrong : palette.divider
}
}
/// Read-only prompt viewer for built-in styles (mirrors iOS).