fix: consolidate model switch cases, brand-tint controls, fix avatar asset
Merge settings/about cases in refreshCurrentRoute. Refactor TaskCenterView to use domain-level icon/tone helpers and atlasPrimary button style. Brand-tint toggle and stepper in SettingsFeatureView. Remove redundant scale from avatar image asset. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -480,9 +480,7 @@ final class AtlasAppModel: ObservableObject {
|
||||
break
|
||||
case .permissions:
|
||||
await inspectPermissions()
|
||||
case .settings:
|
||||
break
|
||||
case .about:
|
||||
case .settings, .about:
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,10 +43,10 @@ struct TaskCenterView: View {
|
||||
title: taskRun.kind.title,
|
||||
subtitle: taskRun.summary,
|
||||
footnote: timelineFootnote(for: taskRun),
|
||||
systemImage: icon(for: taskRun.kind),
|
||||
tone: taskRun.status.tintTone
|
||||
systemImage: taskRun.kind.atlasSystemImage,
|
||||
tone: taskRun.status.atlasTone
|
||||
) {
|
||||
AtlasStatusChip(taskRun.status.title, tone: taskRun.status.tintTone)
|
||||
AtlasStatusChip(taskRun.status.title, tone: taskRun.status.atlasTone)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -55,8 +55,7 @@ struct TaskCenterView: View {
|
||||
Button(action: onOpenHistory) {
|
||||
Label(AtlasL10n.string("taskcenter.openHistory"), systemImage: "arrow.right.circle.fill")
|
||||
}
|
||||
.buttonStyle(.borderedProminent)
|
||||
.controlSize(.large)
|
||||
.buttonStyle(.atlasPrimary)
|
||||
.keyboardShortcut(.defaultAction)
|
||||
.accessibilityIdentifier("taskcenter.openHistory")
|
||||
.accessibilityHint(AtlasL10n.string("taskcenter.openHistory.hint"))
|
||||
@@ -74,33 +73,4 @@ struct TaskCenterView: View {
|
||||
return AtlasL10n.string("taskcenter.timeline.running", start)
|
||||
}
|
||||
|
||||
private func icon(for kind: TaskKind) -> String {
|
||||
switch kind {
|
||||
case .scan:
|
||||
return "sparkles"
|
||||
case .executePlan:
|
||||
return "play.circle"
|
||||
case .uninstallApp:
|
||||
return "trash"
|
||||
case .restore:
|
||||
return "arrow.uturn.backward.circle"
|
||||
case .inspectPermissions:
|
||||
return "lock.shield"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private extension TaskStatus {
|
||||
var tintTone: AtlasTone {
|
||||
switch self {
|
||||
case .queued:
|
||||
return .neutral
|
||||
case .running:
|
||||
return .warning
|
||||
case .completed:
|
||||
return .success
|
||||
case .failed, .cancelled:
|
||||
return .danger
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
"images" : [
|
||||
{
|
||||
"filename" : "avatar.png",
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x"
|
||||
"idiom" : "universal"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
|
||||
@@ -129,6 +129,7 @@ public struct SettingsFeatureView: View {
|
||||
.font(AtlasTypography.body.weight(.medium))
|
||||
}
|
||||
.toggleStyle(.switch)
|
||||
.tint(AtlasColor.brand)
|
||||
.accessibilityIdentifier("settings.notifications")
|
||||
.accessibilityHint(AtlasL10n.string("settings.notifications.hint"))
|
||||
}
|
||||
@@ -162,6 +163,7 @@ public struct SettingsFeatureView: View {
|
||||
Text(AtlasL10n.string("settings.retention.adjust"))
|
||||
.font(AtlasTypography.body.weight(.medium))
|
||||
}
|
||||
.tint(AtlasColor.brand)
|
||||
.accessibilityIdentifier("settings.recoveryRetention")
|
||||
.accessibilityHint(AtlasL10n.string("settings.retention.hint"))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user