Просмотр исходного кода

Simplify AI job search UI by removing sort, exclude filters, and posted dates.

Keep list/grid layout on results and hide relative dates only on the search screen.

Co-authored-by: Cursor <cursoragent@cursor.com>
faiz ali 2 часов назад
Родитель
Сommit
62fbfea9b2

+ 4 - 1
indeed_ai_job_search/DesignSystem/Components/JobRowView.swift

@@ -145,6 +145,7 @@ struct JobGridCardView: View {
     let isSaved: Bool
     var onToggleSave: () -> Void
     var onOpen: (() -> Void)? = nil
+    var showsPostedDate: Bool = true
 
     private func openListing() {
         if let onOpen {
@@ -183,7 +184,9 @@ struct JobGridCardView: View {
             HStack {
                 if listing.isEasyApply { EasyApplyBadge() }
                 Spacer()
-                RelativeDateLabel(date: listing.postedAt)
+                if showsPostedDate {
+                    RelativeDateLabel(date: listing.postedAt)
+                }
             }
 
             Text(openLinkTitle)

+ 17 - 37
indeed_ai_job_search/Features/JobSearch/Views/AIJobSearchView.swift

@@ -126,42 +126,20 @@ struct AIJobSearchView: View {
 
             Spacer()
 
-            HStack(spacing: AppSpacing.sm) {
-                Menu {
-                    ForEach(JobSortOption.allCases) { option in
-                        Button(option.displayName) {
-                            viewModel.sortOption = option
-                        }
-                    }
-                } label: {
-                    HStack(spacing: 4) {
-                        Text("Sort by:")
-                            .foregroundStyle(AppColors.textSecondary)
-                        Text(viewModel.sortOption.displayName)
-                            .foregroundStyle(AppColors.textPrimary)
-                        Image(systemName: "chevron.down")
-                            .font(.system(size: 9, weight: .semibold))
-                            .foregroundStyle(AppColors.textTertiary)
-                    }
-                    .font(AppTypography.meta)
-                }
-                .menuStyle(.borderlessButton)
-
-                HStack(spacing: 2) {
-                    ForEach(ResultsLayout.allCases) { layout in
-                        Button {
-                            viewModel.layout = layout
-                        } label: {
-                            Image(systemName: layout.iconName)
-                                .font(.system(size: 12, weight: .medium))
-                                .foregroundStyle(viewModel.layout == layout ? AppColors.brand : AppColors.textTertiary)
-                                .frame(width: 28, height: 28)
-                                .background(viewModel.layout == layout ? AppColors.brandSoft : Color.clear)
-                                .clipShape(RoundedRectangle(cornerRadius: 6, style: .continuous))
-                        }
-                        .buttonStyle(.plain)
-                        .help(layout == .list ? "List view" : "Grid view")
+            HStack(spacing: 2) {
+                ForEach(ResultsLayout.allCases) { layout in
+                    Button {
+                        viewModel.layout = layout
+                    } label: {
+                        Image(systemName: layout.iconName)
+                            .font(.system(size: 12, weight: .medium))
+                            .foregroundStyle(viewModel.layout == layout ? AppColors.brand : AppColors.textTertiary)
+                            .frame(width: 28, height: 28)
+                            .background(viewModel.layout == layout ? AppColors.brandSoft : Color.clear)
+                            .clipShape(RoundedRectangle(cornerRadius: 6, style: .continuous))
                     }
+                    .buttonStyle(.plain)
+                    .help(layout == .list ? "List view" : "Grid view")
                 }
             }
         }
@@ -202,7 +180,8 @@ struct AIJobSearchView: View {
                             JobRowView(
                                 listing: listing,
                                 isSaved: viewModel.isSaved(listing),
-                                onToggleSave: { viewModel.toggleSave(listing) }
+                                onToggleSave: { viewModel.toggleSave(listing) },
+                                showsPostedDate: false
                             )
                             .contextMenu {
                                 Button("Open on Indeed") {
@@ -226,7 +205,8 @@ struct AIJobSearchView: View {
                             JobGridCardView(
                                 listing: listing,
                                 isSaved: viewModel.isSaved(listing),
-                                onToggleSave: { viewModel.toggleSave(listing) }
+                                onToggleSave: { viewModel.toggleSave(listing) },
+                                showsPostedDate: false
                             )
                             .contextMenu {
                                 Button("Open on Indeed") {

+ 2 - 13
indeed_ai_job_search/Features/JobSearch/Views/FiltersPanelView.swift

@@ -12,7 +12,7 @@ struct FiltersPanelView: View {
 
     @Environment(\.accessibilityReduceMotion) private var reduceMotion
     @State private var expanded: Set<FilterSection> = [
-        .jobTitle, .exclude, .location, .employment, .experience
+        .jobTitle, .location, .employment, .experience
     ]
     @State private var salaryText: String = ""
 
@@ -28,7 +28,6 @@ struct FiltersPanelView: View {
             ScrollView {
                 VStack(spacing: 0) {
                     accordion(.jobTitle) { jobTitleSection }
-                    accordion(.exclude) { excludeSection }
                     accordion(.location) { locationSection }
                     accordion(.employment) { employmentSection }
                     accordion(.experience) { experienceSection }
@@ -115,15 +114,6 @@ struct FiltersPanelView: View {
         .onChange(of: criteria.keywords) { _, _ in onChange() }
     }
 
-    private var excludeSection: some View {
-        FilterTextField(
-            title: "Exclude keywords",
-            prompt: "Words to exclude",
-            text: $criteria.excludedKeywords
-        )
-        .onChange(of: criteria.excludedKeywords) { _, _ in onChange() }
-    }
-
     private var locationSection: some View {
         VStack(alignment: .leading, spacing: AppSpacing.sm) {
             FilterTextField(
@@ -222,12 +212,11 @@ struct FiltersPanelView: View {
 }
 
 private enum FilterSection: Hashable {
-    case jobTitle, exclude, location, employment, experience, salary
+    case jobTitle, location, employment, experience, salary
 
     var title: String {
         switch self {
         case .jobTitle: return "Job Title & Keywords"
-        case .exclude: return "Exclude Keywords"
         case .location: return "Location"
         case .employment: return "Employment Type"
         case .experience: return "Experience Level"