feat(domain): add SidebarSection grouping and sidebar localization strings
Add SidebarSection enum to AtlasRoute with core/manage groupings, isSidebarRoute filter, and sidebarSection lookup. Add en/zh-Hans strings for sidebar sections, about window title, and about command. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -11,6 +11,57 @@ public enum AtlasRoute: String, CaseIterable, Codable, Hashable, Identifiable, S
|
|||||||
|
|
||||||
public var id: String { rawValue }
|
public var id: String { rawValue }
|
||||||
|
|
||||||
|
// MARK: - Sidebar
|
||||||
|
|
||||||
|
public enum SidebarSection: String, CaseIterable, Identifiable, Sendable {
|
||||||
|
case core
|
||||||
|
case manage
|
||||||
|
|
||||||
|
public var id: String { rawValue }
|
||||||
|
|
||||||
|
public var title: String {
|
||||||
|
switch self {
|
||||||
|
case .core:
|
||||||
|
return AtlasL10n.string("sidebar.section.core")
|
||||||
|
case .manage:
|
||||||
|
return AtlasL10n.string("sidebar.section.manage")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public var routes: [AtlasRoute] {
|
||||||
|
switch self {
|
||||||
|
case .core:
|
||||||
|
return [.overview, .smartClean, .apps]
|
||||||
|
case .manage:
|
||||||
|
return [.history, .permissions]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public var isSidebarRoute: Bool {
|
||||||
|
switch self {
|
||||||
|
case .settings, .about:
|
||||||
|
return false
|
||||||
|
default:
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static var sidebarRoutes: [AtlasRoute] {
|
||||||
|
allCases.filter(\.isSidebarRoute)
|
||||||
|
}
|
||||||
|
|
||||||
|
public var sidebarSection: SidebarSection? {
|
||||||
|
switch self {
|
||||||
|
case .overview, .smartClean, .apps:
|
||||||
|
return .core
|
||||||
|
case .history, .permissions:
|
||||||
|
return .manage
|
||||||
|
case .settings, .about:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public var title: String {
|
public var title: String {
|
||||||
switch self {
|
switch self {
|
||||||
case .overview:
|
case .overview:
|
||||||
|
|||||||
@@ -602,3 +602,8 @@
|
|||||||
"about.social.discord" = "Discord";
|
"about.social.discord" = "Discord";
|
||||||
|
|
||||||
"smartclean.preview.callout.review.title" = "Some steps in this plan need a closer review";
|
"smartclean.preview.callout.review.title" = "Some steps in this plan need a closer review";
|
||||||
|
|
||||||
|
"sidebar.section.core" = "Core";
|
||||||
|
"sidebar.section.manage" = "Manage";
|
||||||
|
"about.window.title" = "About Atlas";
|
||||||
|
"commands.about" = "About Atlas";
|
||||||
|
|||||||
@@ -602,3 +602,8 @@
|
|||||||
"about.social.discord" = "Discord";
|
"about.social.discord" = "Discord";
|
||||||
|
|
||||||
"smartclean.preview.callout.review.title" = "这份计划中仍有步骤需要复核";
|
"smartclean.preview.callout.review.title" = "这份计划中仍有步骤需要复核";
|
||||||
|
|
||||||
|
"sidebar.section.core" = "核心";
|
||||||
|
"sidebar.section.manage" = "管理";
|
||||||
|
"about.window.title" = "关于 Atlas";
|
||||||
|
"commands.about" = "关于 Atlas";
|
||||||
|
|||||||
Reference in New Issue
Block a user