fix(macos): simplify skills view and resize onboarding
This commit is contained in:
@@ -24,7 +24,7 @@ final class OnboardingController {
|
|||||||
let hosting = NSHostingController(rootView: OnboardingView())
|
let hosting = NSHostingController(rootView: OnboardingView())
|
||||||
let window = NSWindow(contentViewController: hosting)
|
let window = NSWindow(contentViewController: hosting)
|
||||||
window.title = UIStrings.welcomeTitle
|
window.title = UIStrings.welcomeTitle
|
||||||
window.setContentSize(NSSize(width: 680, height: 805))
|
window.setContentSize(NSSize(width: 630, height: 805))
|
||||||
window.styleMask = [.titled, .closable, .fullSizeContentView]
|
window.styleMask = [.titled, .closable, .fullSizeContentView]
|
||||||
window.titlebarAppearsTransparent = true
|
window.titlebarAppearsTransparent = true
|
||||||
window.titleVisibility = .hidden
|
window.titleVisibility = .hidden
|
||||||
@@ -83,7 +83,7 @@ struct OnboardingView: View {
|
|||||||
@Bindable private var state: AppState
|
@Bindable private var state: AppState
|
||||||
private var permissionMonitor: PermissionMonitor
|
private var permissionMonitor: PermissionMonitor
|
||||||
|
|
||||||
private let pageWidth: CGFloat = 680
|
private let pageWidth: CGFloat = 630
|
||||||
private let contentHeight: CGFloat = 520
|
private let contentHeight: CGFloat = 520
|
||||||
private let connectionPageIndex = 1
|
private let connectionPageIndex = 1
|
||||||
private let anthropicAuthPageIndex = 2
|
private let anthropicAuthPageIndex = 2
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ struct SkillsSettings: View {
|
|||||||
@Bindable var state: AppState
|
@Bindable var state: AppState
|
||||||
@State private var model = SkillsSettingsModel()
|
@State private var model = SkillsSettingsModel()
|
||||||
@State private var envEditor: EnvEditorState?
|
@State private var envEditor: EnvEditorState?
|
||||||
@State private var searchQuery = ""
|
|
||||||
@State private var filter: SkillsFilter = .all
|
@State private var filter: SkillsFilter = .all
|
||||||
|
|
||||||
init(state: AppState = AppStateStore.shared) {
|
init(state: AppState = AppStateStore.shared) {
|
||||||
@@ -106,7 +105,6 @@ struct SkillsSettings: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
.listStyle(.inset)
|
.listStyle(.inset)
|
||||||
.searchable(text: self.$searchQuery, placement: .automatic, prompt: "Search skills")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -123,14 +121,7 @@ struct SkillsSettings: View {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private var filteredSkills: [SkillStatus] {
|
private var filteredSkills: [SkillStatus] {
|
||||||
let trimmed = self.searchQuery.trimmingCharacters(in: .whitespacesAndNewlines)
|
|
||||||
let query = trimmed.lowercased()
|
|
||||||
return self.model.skills.filter { skill in
|
return self.model.skills.filter { skill in
|
||||||
if !query.isEmpty {
|
|
||||||
let matchesName = skill.name.lowercased().contains(query)
|
|
||||||
let matchesDescription = skill.description.lowercased().contains(query)
|
|
||||||
if !(matchesName || matchesDescription) { return false }
|
|
||||||
}
|
|
||||||
switch self.filter {
|
switch self.filter {
|
||||||
case .all:
|
case .all:
|
||||||
return true
|
return true
|
||||||
|
|||||||
Reference in New Issue
Block a user