Sfoglia il codice sorgente

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 3 settimane fa
parent
commit
bae1fdf757

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

@@ -17,7 +17,6 @@ struct DashboardData {
17
     let sidebarItems: [SidebarItem]
17
     let sidebarItems: [SidebarItem]
18
     let profileInsightsTitle: String
18
     let profileInsightsTitle: String
19
     let profileInsightsBody: String
19
     let profileInsightsBody: String
20
-    let profileInsightsLinkTitle: String
21
 }
20
 }
22
 
21
 
23
 protocol DashboardDataProviding {
22
 protocol DashboardDataProviding {
@@ -37,8 +36,7 @@ final class MockDashboardDataProvider: DashboardDataProviding {
37
                 SidebarItem(title: "Settings", systemImage: "gearshape", badge: nil)
36
                 SidebarItem(title: "Settings", systemImage: "gearshape", badge: nil)
38
             ],
37
             ],
39
             profileInsightsTitle: "AI insights",
38
             profileInsightsTitle: "AI insights",
40
-            profileInsightsBody: "Saved jobs and interviews at a glance.",
41
-            profileInsightsLinkTitle: "View all"
39
+            profileInsightsBody: "Saved jobs and interviews at a glance."
42
         )
40
         )
43
     }
41
     }
44
 }
42
 }

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

@@ -17,7 +17,6 @@ final class DashboardView: NSView {
17
         static let primaryText = NSColor(calibratedWhite: 0.96, alpha: 1)
17
         static let primaryText = NSColor(calibratedWhite: 0.96, alpha: 1)
18
         static let secondaryText = NSColor(calibratedWhite: 0.62, alpha: 1)
18
         static let secondaryText = NSColor(calibratedWhite: 0.62, alpha: 1)
19
         static let tertiaryText = NSColor(calibratedWhite: 0.48, alpha: 1)
19
         static let tertiaryText = NSColor(calibratedWhite: 0.48, alpha: 1)
20
-        static let linkText = NSColor(calibratedWhite: 0.82, alpha: 1)
21
     }
20
     }
22
 
21
 
23
     private let contentStack = NSStackView()
22
     private let contentStack = NSStackView()
@@ -31,7 +30,6 @@ final class DashboardView: NSView {
31
     private let insightsCard = NSView()
30
     private let insightsCard = NSView()
32
     private let insightsTitleLabel = NSTextField(labelWithString: "")
31
     private let insightsTitleLabel = NSTextField(labelWithString: "")
33
     private let insightsBodyLabel = NSTextField(labelWithString: "")
32
     private let insightsBodyLabel = NSTextField(labelWithString: "")
34
-    private let insightsLinkButton = NSButton(title: "", target: nil, action: nil)
35
     private let togglesLabel = NSTextField(labelWithString: "Show:")
33
     private let togglesLabel = NSTextField(labelWithString: "Show:")
36
     private let savedToggleButton = NSButton(title: "Saved", target: nil, action: nil)
34
     private let savedToggleButton = NSButton(title: "Saved", target: nil, action: nil)
37
     private let interviewsToggleButton = NSButton(title: "Interviews", target: nil, action: nil)
35
     private let interviewsToggleButton = NSButton(title: "Interviews", target: nil, action: nil)
@@ -58,7 +56,6 @@ final class DashboardView: NSView {
58
         subtitleLabel.stringValue = data.subtitle
56
         subtitleLabel.stringValue = data.subtitle
59
         insightsTitleLabel.stringValue = data.profileInsightsTitle
57
         insightsTitleLabel.stringValue = data.profileInsightsTitle
60
         insightsBodyLabel.stringValue = data.profileInsightsBody
58
         insightsBodyLabel.stringValue = data.profileInsightsBody
61
-        insightsLinkButton.title = data.profileInsightsLinkTitle
62
         configureSidebar(data.sidebarItems)
59
         configureSidebar(data.sidebarItems)
63
         updateDocumentLayout()
60
         updateDocumentLayout()
64
     }
61
     }
@@ -135,11 +132,6 @@ final class DashboardView: NSView {
135
         titleBlock.spacing = 10
132
         titleBlock.spacing = 10
136
         titleBlock.alignment = .centerX
133
         titleBlock.alignment = .centerX
137
 
134
 
138
-        let headerStack = NSStackView(views: [titleBlock, insightsLinkButton])
139
-        headerStack.orientation = .vertical
140
-        headerStack.spacing = 18
141
-        headerStack.alignment = .centerX
142
-
143
         let midSpacer = NSView()
135
         let midSpacer = NSView()
144
         midSpacer.translatesAutoresizingMaskIntoConstraints = false
136
         midSpacer.translatesAutoresizingMaskIntoConstraints = false
145
         midSpacer.heightAnchor.constraint(equalToConstant: 20).isActive = true
137
         midSpacer.heightAnchor.constraint(equalToConstant: 20).isActive = true
@@ -150,7 +142,7 @@ final class DashboardView: NSView {
150
         overlayBottomSpacer.setContentCompressionResistancePriority(.defaultLow, for: .vertical)
142
         overlayBottomSpacer.setContentCompressionResistancePriority(.defaultLow, for: .vertical)
151
 
143
 
152
         mainOverlay.addArrangedSubview(topInset)
144
         mainOverlay.addArrangedSubview(topInset)
153
-        mainOverlay.addArrangedSubview(headerStack)
145
+        mainOverlay.addArrangedSubview(titleBlock)
154
         mainOverlay.addArrangedSubview(midSpacer)
146
         mainOverlay.addArrangedSubview(midSpacer)
155
         mainOverlay.addArrangedSubview(insightsCard)
147
         mainOverlay.addArrangedSubview(insightsCard)
156
         mainOverlay.addArrangedSubview(overlayBottomSpacer)
148
         mainOverlay.addArrangedSubview(overlayBottomSpacer)
@@ -192,8 +184,6 @@ final class DashboardView: NSView {
192
             greetingLabel.trailingAnchor.constraint(equalTo: mainOverlay.trailingAnchor, constant: -24),
184
             greetingLabel.trailingAnchor.constraint(equalTo: mainOverlay.trailingAnchor, constant: -24),
193
             subtitleLabel.leadingAnchor.constraint(equalTo: greetingLabel.leadingAnchor),
185
             subtitleLabel.leadingAnchor.constraint(equalTo: greetingLabel.leadingAnchor),
194
             subtitleLabel.trailingAnchor.constraint(equalTo: greetingLabel.trailingAnchor),
186
             subtitleLabel.trailingAnchor.constraint(equalTo: greetingLabel.trailingAnchor),
195
-            insightsLinkButton.leadingAnchor.constraint(equalTo: greetingLabel.leadingAnchor),
196
-            insightsLinkButton.trailingAnchor.constraint(equalTo: greetingLabel.trailingAnchor),
197
 
187
 
198
             sparkleView.trailingAnchor.constraint(equalTo: mainHost.trailingAnchor, constant: -28),
188
             sparkleView.trailingAnchor.constraint(equalTo: mainHost.trailingAnchor, constant: -28),
199
             sparkleView.bottomAnchor.constraint(equalTo: mainHost.bottomAnchor, constant: -28)
189
             sparkleView.bottomAnchor.constraint(equalTo: mainHost.bottomAnchor, constant: -28)
@@ -218,12 +208,6 @@ final class DashboardView: NSView {
218
         insightsBodyLabel.lineBreakMode = .byWordWrapping
208
         insightsBodyLabel.lineBreakMode = .byWordWrapping
219
         insightsBodyLabel.preferredMaxLayoutWidth = 400
209
         insightsBodyLabel.preferredMaxLayoutWidth = 400
220
 
210
 
221
-        insightsLinkButton.bezelStyle = .inline
222
-        insightsLinkButton.isBordered = false
223
-        insightsLinkButton.font = .systemFont(ofSize: 13, weight: .medium)
224
-        insightsLinkButton.contentTintColor = Theme.linkText
225
-        insightsLinkButton.setButtonType(.momentaryPushIn)
226
-
227
         togglesLabel.font = .systemFont(ofSize: 12, weight: .medium)
211
         togglesLabel.font = .systemFont(ofSize: 12, weight: .medium)
228
         togglesLabel.textColor = Theme.tertiaryText
212
         togglesLabel.textColor = Theme.tertiaryText
229
         togglesLabel.alignment = .center
213
         togglesLabel.alignment = .center