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

Remove dashboard "View all" link

Drop the profile insights link button from the main column and remove profileInsightsLinkTitle from DashboardData and mock data.

Co-authored-by: Cursor <cursoragent@cursor.com>
AhtashamShahzad1 2 месяцев назад
Родитель
Сommit
bae1fdf757
2 измененных файлов с 2 добавлено и 20 удалено
  1. 1 3
      App for Indeed/Models/DashboardModels.swift
  2. 1 17
      App for Indeed/Views/DashboardView.swift

+ 1 - 3
App for Indeed/Models/DashboardModels.swift

@@ -17,7 +17,6 @@ struct DashboardData {
     let sidebarItems: [SidebarItem]
     let sidebarItems: [SidebarItem]
     let profileInsightsTitle: String
     let profileInsightsTitle: String
     let profileInsightsBody: String
     let profileInsightsBody: String
-    let profileInsightsLinkTitle: String
 }
 }
 
 
 protocol DashboardDataProviding {
 protocol DashboardDataProviding {
@@ -37,8 +36,7 @@ final class MockDashboardDataProvider: DashboardDataProviding {
                 SidebarItem(title: "Settings", systemImage: "gearshape", badge: nil)
                 SidebarItem(title: "Settings", systemImage: "gearshape", badge: nil)
             ],
             ],
             profileInsightsTitle: "AI insights",
             profileInsightsTitle: "AI insights",
-            profileInsightsBody: "Saved jobs and interviews at a glance.",
-            profileInsightsLinkTitle: "View all"
+            profileInsightsBody: "Saved jobs and interviews at a glance."
         )
         )
     }
     }
 }
 }

+ 1 - 17
App for Indeed/Views/DashboardView.swift

@@ -17,7 +17,6 @@ final class DashboardView: NSView {
         static let primaryText = NSColor(calibratedWhite: 0.96, alpha: 1)
         static let primaryText = NSColor(calibratedWhite: 0.96, alpha: 1)
         static let secondaryText = NSColor(calibratedWhite: 0.62, alpha: 1)
         static let secondaryText = NSColor(calibratedWhite: 0.62, alpha: 1)
         static let tertiaryText = NSColor(calibratedWhite: 0.48, alpha: 1)
         static let tertiaryText = NSColor(calibratedWhite: 0.48, alpha: 1)
-        static let linkText = NSColor(calibratedWhite: 0.82, alpha: 1)
     }
     }
 
 
     private let contentStack = NSStackView()
     private let contentStack = NSStackView()
@@ -31,7 +30,6 @@ final class DashboardView: NSView {
     private let insightsCard = NSView()
     private let insightsCard = NSView()
     private let insightsTitleLabel = NSTextField(labelWithString: "")
     private let insightsTitleLabel = NSTextField(labelWithString: "")
     private let insightsBodyLabel = NSTextField(labelWithString: "")
     private let insightsBodyLabel = NSTextField(labelWithString: "")
-    private let insightsLinkButton = NSButton(title: "", target: nil, action: nil)
     private let togglesLabel = NSTextField(labelWithString: "Show:")
     private let togglesLabel = NSTextField(labelWithString: "Show:")
     private let savedToggleButton = NSButton(title: "Saved", target: nil, action: nil)
     private let savedToggleButton = NSButton(title: "Saved", target: nil, action: nil)
     private let interviewsToggleButton = NSButton(title: "Interviews", target: nil, action: nil)
     private let interviewsToggleButton = NSButton(title: "Interviews", target: nil, action: nil)
@@ -58,7 +56,6 @@ final class DashboardView: NSView {
         subtitleLabel.stringValue = data.subtitle
         subtitleLabel.stringValue = data.subtitle
         insightsTitleLabel.stringValue = data.profileInsightsTitle
         insightsTitleLabel.stringValue = data.profileInsightsTitle
         insightsBodyLabel.stringValue = data.profileInsightsBody
         insightsBodyLabel.stringValue = data.profileInsightsBody
-        insightsLinkButton.title = data.profileInsightsLinkTitle
         configureSidebar(data.sidebarItems)
         configureSidebar(data.sidebarItems)
         updateDocumentLayout()
         updateDocumentLayout()
     }
     }
@@ -135,11 +132,6 @@ final class DashboardView: NSView {
         titleBlock.spacing = 10
         titleBlock.spacing = 10
         titleBlock.alignment = .centerX
         titleBlock.alignment = .centerX
 
 
-        let headerStack = NSStackView(views: [titleBlock, insightsLinkButton])
-        headerStack.orientation = .vertical
-        headerStack.spacing = 18
-        headerStack.alignment = .centerX
-
         let midSpacer = NSView()
         let midSpacer = NSView()
         midSpacer.translatesAutoresizingMaskIntoConstraints = false
         midSpacer.translatesAutoresizingMaskIntoConstraints = false
         midSpacer.heightAnchor.constraint(equalToConstant: 20).isActive = true
         midSpacer.heightAnchor.constraint(equalToConstant: 20).isActive = true
@@ -150,7 +142,7 @@ final class DashboardView: NSView {
         overlayBottomSpacer.setContentCompressionResistancePriority(.defaultLow, for: .vertical)
         overlayBottomSpacer.setContentCompressionResistancePriority(.defaultLow, for: .vertical)
 
 
         mainOverlay.addArrangedSubview(topInset)
         mainOverlay.addArrangedSubview(topInset)
-        mainOverlay.addArrangedSubview(headerStack)
+        mainOverlay.addArrangedSubview(titleBlock)
         mainOverlay.addArrangedSubview(midSpacer)
         mainOverlay.addArrangedSubview(midSpacer)
         mainOverlay.addArrangedSubview(insightsCard)
         mainOverlay.addArrangedSubview(insightsCard)
         mainOverlay.addArrangedSubview(overlayBottomSpacer)
         mainOverlay.addArrangedSubview(overlayBottomSpacer)
@@ -192,8 +184,6 @@ final class DashboardView: NSView {
             greetingLabel.trailingAnchor.constraint(equalTo: mainOverlay.trailingAnchor, constant: -24),
             greetingLabel.trailingAnchor.constraint(equalTo: mainOverlay.trailingAnchor, constant: -24),
             subtitleLabel.leadingAnchor.constraint(equalTo: greetingLabel.leadingAnchor),
             subtitleLabel.leadingAnchor.constraint(equalTo: greetingLabel.leadingAnchor),
             subtitleLabel.trailingAnchor.constraint(equalTo: greetingLabel.trailingAnchor),
             subtitleLabel.trailingAnchor.constraint(equalTo: greetingLabel.trailingAnchor),
-            insightsLinkButton.leadingAnchor.constraint(equalTo: greetingLabel.leadingAnchor),
-            insightsLinkButton.trailingAnchor.constraint(equalTo: greetingLabel.trailingAnchor),
 
 
             sparkleView.trailingAnchor.constraint(equalTo: mainHost.trailingAnchor, constant: -28),
             sparkleView.trailingAnchor.constraint(equalTo: mainHost.trailingAnchor, constant: -28),
             sparkleView.bottomAnchor.constraint(equalTo: mainHost.bottomAnchor, constant: -28)
             sparkleView.bottomAnchor.constraint(equalTo: mainHost.bottomAnchor, constant: -28)
@@ -218,12 +208,6 @@ final class DashboardView: NSView {
         insightsBodyLabel.lineBreakMode = .byWordWrapping
         insightsBodyLabel.lineBreakMode = .byWordWrapping
         insightsBodyLabel.preferredMaxLayoutWidth = 400
         insightsBodyLabel.preferredMaxLayoutWidth = 400
 
 
-        insightsLinkButton.bezelStyle = .inline
-        insightsLinkButton.isBordered = false
-        insightsLinkButton.font = .systemFont(ofSize: 13, weight: .medium)
-        insightsLinkButton.contentTintColor = Theme.linkText
-        insightsLinkButton.setButtonType(.momentaryPushIn)
-
         togglesLabel.font = .systemFont(ofSize: 12, weight: .medium)
         togglesLabel.font = .systemFont(ofSize: 12, weight: .medium)
         togglesLabel.textColor = Theme.tertiaryText
         togglesLabel.textColor = Theme.tertiaryText
         togglesLabel.alignment = .center
         togglesLabel.alignment = .center