Explorar el Código

Shorten dashboard insights card copy and layout

Tighten mock strings for the AI insights card, relabel toggles to Show:,
and size the card to its content with a bottom overlay spacer instead
of stretching empty space inside the card.

Co-authored-by: Cursor <cursoragent@cursor.com>
AhtashamShahzad1 hace 3 semanas
padre
commit
449ab3a2c3

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

@@ -36,9 +36,9 @@ final class MockDashboardDataProvider: DashboardDataProviding {
36 36
                 SidebarItem(title: "Profile", systemImage: "person", badge: nil),
37 37
                 SidebarItem(title: "Settings", systemImage: "gearshape", badge: nil)
38 38
             ],
39
-            profileInsightsTitle: "AI Profile Insights",
40
-            profileInsightsBody: "Your personal dashboard, powered by AI. Check your saved jobs and upcoming interviews.",
41
-            profileInsightsLinkTitle: "View Full Insights"
39
+            profileInsightsTitle: "AI insights",
40
+            profileInsightsBody: "Saved jobs and interviews at a glance.",
41
+            profileInsightsLinkTitle: "View all"
42 42
         )
43 43
     }
44 44
 }

+ 16 - 7
App for Indeed/Views/DashboardView.swift

@@ -32,7 +32,7 @@ final class DashboardView: NSView {
32 32
     private let insightsTitleLabel = NSTextField(labelWithString: "")
33 33
     private let insightsBodyLabel = NSTextField(labelWithString: "")
34 34
     private let insightsLinkButton = NSButton(title: "", target: nil, action: nil)
35
-    private let togglesLabel = NSTextField(labelWithString: "Dashboard Toggles:")
35
+    private let togglesLabel = NSTextField(labelWithString: "Show:")
36 36
     private let savedToggleButton = NSButton(title: "Saved", target: nil, action: nil)
37 37
     private let interviewsToggleButton = NSButton(title: "Interviews", target: nil, action: nil)
38 38
     private let sparkleView = NSImageView()
@@ -75,7 +75,7 @@ final class DashboardView: NSView {
75 75
         contentStack.orientation = .horizontal
76 76
         contentStack.spacing = 20
77 77
         contentStack.translatesAutoresizingMaskIntoConstraints = false
78
-        contentStack.alignment = .top
78
+        contentStack.alignment = .height
79 79
         contentStack.edgeInsets = NSEdgeInsets(top: 24, left: 24, bottom: 24, right: 24)
80 80
 
81 81
         documentContainer.translatesAutoresizingMaskIntoConstraints = true
@@ -110,8 +110,9 @@ final class DashboardView: NSView {
110 110
         mainOverlay.orientation = .vertical
111 111
         mainOverlay.spacing = 0
112 112
         mainOverlay.alignment = .centerX
113
+        mainOverlay.distribution = .fill
113 114
         mainOverlay.translatesAutoresizingMaskIntoConstraints = false
114
-        mainOverlay.setContentHuggingPriority(.required, for: .vertical)
115
+        mainOverlay.setContentHuggingPriority(.defaultLow, for: .vertical)
115 116
 
116 117
         greetingLabel.font = .systemFont(ofSize: 32, weight: .bold)
117 118
         greetingLabel.textColor = Theme.primaryText
@@ -143,10 +144,16 @@ final class DashboardView: NSView {
143 144
         midSpacer.translatesAutoresizingMaskIntoConstraints = false
144 145
         midSpacer.heightAnchor.constraint(equalToConstant: 20).isActive = true
145 146
 
147
+        let overlayBottomSpacer = NSView()
148
+        overlayBottomSpacer.translatesAutoresizingMaskIntoConstraints = false
149
+        overlayBottomSpacer.setContentHuggingPriority(.defaultLow, for: .vertical)
150
+        overlayBottomSpacer.setContentCompressionResistancePriority(.defaultLow, for: .vertical)
151
+
146 152
         mainOverlay.addArrangedSubview(topInset)
147 153
         mainOverlay.addArrangedSubview(headerStack)
148 154
         mainOverlay.addArrangedSubview(midSpacer)
149 155
         mainOverlay.addArrangedSubview(insightsCard)
156
+        mainOverlay.addArrangedSubview(overlayBottomSpacer)
150 157
 
151 158
         sparkleView.translatesAutoresizingMaskIntoConstraints = false
152 159
         sparkleView.symbolConfiguration = NSImage.SymbolConfiguration(pointSize: 22, weight: .regular)
@@ -179,7 +186,7 @@ final class DashboardView: NSView {
179 186
             mainOverlay.leadingAnchor.constraint(equalTo: mainHost.leadingAnchor),
180 187
             mainOverlay.trailingAnchor.constraint(equalTo: mainHost.trailingAnchor),
181 188
             mainOverlay.topAnchor.constraint(equalTo: mainHost.topAnchor),
182
-            mainHost.bottomAnchor.constraint(equalTo: mainOverlay.bottomAnchor, constant: 24),
189
+            mainOverlay.bottomAnchor.constraint(equalTo: mainHost.bottomAnchor, constant: -24),
183 190
 
184 191
             greetingLabel.leadingAnchor.constraint(equalTo: mainOverlay.leadingAnchor, constant: 24),
185 192
             greetingLabel.trailingAnchor.constraint(equalTo: mainOverlay.trailingAnchor, constant: -24),
@@ -237,16 +244,18 @@ final class DashboardView: NSView {
237 244
             toggleRow
238 245
         ])
239 246
         inner.orientation = .vertical
240
-        inner.spacing = 14
247
+        inner.spacing = 10
241 248
         inner.alignment = .centerX
249
+        inner.distribution = .fill
242 250
         inner.translatesAutoresizingMaskIntoConstraints = false
243 251
 
252
+        insightsCard.setContentHuggingPriority(.defaultHigh, for: .vertical)
244 253
         insightsCard.addSubview(inner)
245 254
         NSLayoutConstraint.activate([
246 255
             inner.leadingAnchor.constraint(equalTo: insightsCard.leadingAnchor, constant: 32),
247 256
             inner.trailingAnchor.constraint(equalTo: insightsCard.trailingAnchor, constant: -32),
248
-            inner.topAnchor.constraint(equalTo: insightsCard.topAnchor, constant: 28),
249
-            inner.bottomAnchor.constraint(equalTo: insightsCard.bottomAnchor, constant: -28),
257
+            inner.topAnchor.constraint(equalTo: insightsCard.topAnchor, constant: 22),
258
+            inner.bottomAnchor.constraint(equalTo: insightsCard.bottomAnchor, constant: -22),
250 259
             insightsCard.widthAnchor.constraint(equalToConstant: 440)
251 260
         ])
252 261
     }