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
|
break
|
||||||
case .permissions:
|
case .permissions:
|
||||||
await inspectPermissions()
|
await inspectPermissions()
|
||||||
case .settings:
|
case .settings, .about:
|
||||||
break
|
|
||||||
case .about:
|
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,10 +43,10 @@ struct TaskCenterView: View {
|
|||||||
title: taskRun.kind.title,
|
title: taskRun.kind.title,
|
||||||
subtitle: taskRun.summary,
|
subtitle: taskRun.summary,
|
||||||
footnote: timelineFootnote(for: taskRun),
|
footnote: timelineFootnote(for: taskRun),
|
||||||
systemImage: icon(for: taskRun.kind),
|
systemImage: taskRun.kind.atlasSystemImage,
|
||||||
tone: taskRun.status.tintTone
|
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) {
|
Button(action: onOpenHistory) {
|
||||||
Label(AtlasL10n.string("taskcenter.openHistory"), systemImage: "arrow.right.circle.fill")
|
Label(AtlasL10n.string("taskcenter.openHistory"), systemImage: "arrow.right.circle.fill")
|
||||||
}
|
}
|
||||||
.buttonStyle(.borderedProminent)
|
.buttonStyle(.atlasPrimary)
|
||||||
.controlSize(.large)
|
|
||||||
.keyboardShortcut(.defaultAction)
|
.keyboardShortcut(.defaultAction)
|
||||||
.accessibilityIdentifier("taskcenter.openHistory")
|
.accessibilityIdentifier("taskcenter.openHistory")
|
||||||
.accessibilityHint(AtlasL10n.string("taskcenter.openHistory.hint"))
|
.accessibilityHint(AtlasL10n.string("taskcenter.openHistory.hint"))
|
||||||
@@ -74,33 +73,4 @@ struct TaskCenterView: View {
|
|||||||
return AtlasL10n.string("taskcenter.timeline.running", start)
|
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" : [
|
"images" : [
|
||||||
{
|
{
|
||||||
"filename" : "avatar.png",
|
"filename" : "avatar.png",
|
||||||
"idiom" : "universal",
|
"idiom" : "universal"
|
||||||
"scale" : "2x"
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"info" : {
|
"info" : {
|
||||||
|
|||||||
@@ -129,6 +129,7 @@ public struct SettingsFeatureView: View {
|
|||||||
.font(AtlasTypography.body.weight(.medium))
|
.font(AtlasTypography.body.weight(.medium))
|
||||||
}
|
}
|
||||||
.toggleStyle(.switch)
|
.toggleStyle(.switch)
|
||||||
|
.tint(AtlasColor.brand)
|
||||||
.accessibilityIdentifier("settings.notifications")
|
.accessibilityIdentifier("settings.notifications")
|
||||||
.accessibilityHint(AtlasL10n.string("settings.notifications.hint"))
|
.accessibilityHint(AtlasL10n.string("settings.notifications.hint"))
|
||||||
}
|
}
|
||||||
@@ -162,6 +163,7 @@ public struct SettingsFeatureView: View {
|
|||||||
Text(AtlasL10n.string("settings.retention.adjust"))
|
Text(AtlasL10n.string("settings.retention.adjust"))
|
||||||
.font(AtlasTypography.body.weight(.medium))
|
.font(AtlasTypography.body.weight(.medium))
|
||||||
}
|
}
|
||||||
|
.tint(AtlasColor.brand)
|
||||||
.accessibilityIdentifier("settings.recoveryRetention")
|
.accessibilityIdentifier("settings.recoveryRetention")
|
||||||
.accessibilityHint(AtlasL10n.string("settings.retention.hint"))
|
.accessibilityHint(AtlasL10n.string("settings.retention.hint"))
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user