Przeglądaj źródła

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 2 miesięcy temu
rodzic
commit
449ab3a2c3

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

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

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

@@ -32,7 +32,7 @@ final class DashboardView: NSView {
     private let insightsTitleLabel = NSTextField(labelWithString: "")
     private let insightsBodyLabel = NSTextField(labelWithString: "")
     private let insightsLinkButton = NSButton(title: "", target: nil, action: nil)
-    private let togglesLabel = NSTextField(labelWithString: "Dashboard Toggles:")
+    private let togglesLabel = NSTextField(labelWithString: "Show:")
     private let savedToggleButton = NSButton(title: "Saved", target: nil, action: nil)
     private let interviewsToggleButton = NSButton(title: "Interviews", target: nil, action: nil)
     private let sparkleView = NSImageView()
@@ -75,7 +75,7 @@ final class DashboardView: NSView {
         contentStack.orientation = .horizontal
         contentStack.spacing = 20
         contentStack.translatesAutoresizingMaskIntoConstraints = false
-        contentStack.alignment = .top
+        contentStack.alignment = .height
         contentStack.edgeInsets = NSEdgeInsets(top: 24, left: 24, bottom: 24, right: 24)
 
         documentContainer.translatesAutoresizingMaskIntoConstraints = true
@@ -110,8 +110,9 @@ final class DashboardView: NSView {
         mainOverlay.orientation = .vertical
         mainOverlay.spacing = 0
         mainOverlay.alignment = .centerX
+        mainOverlay.distribution = .fill
         mainOverlay.translatesAutoresizingMaskIntoConstraints = false
-        mainOverlay.setContentHuggingPriority(.required, for: .vertical)
+        mainOverlay.setContentHuggingPriority(.defaultLow, for: .vertical)
 
         greetingLabel.font = .systemFont(ofSize: 32, weight: .bold)
         greetingLabel.textColor = Theme.primaryText
@@ -143,10 +144,16 @@ final class DashboardView: NSView {
         midSpacer.translatesAutoresizingMaskIntoConstraints = false
         midSpacer.heightAnchor.constraint(equalToConstant: 20).isActive = true
 
+        let overlayBottomSpacer = NSView()
+        overlayBottomSpacer.translatesAutoresizingMaskIntoConstraints = false
+        overlayBottomSpacer.setContentHuggingPriority(.defaultLow, for: .vertical)
+        overlayBottomSpacer.setContentCompressionResistancePriority(.defaultLow, for: .vertical)
+
         mainOverlay.addArrangedSubview(topInset)
         mainOverlay.addArrangedSubview(headerStack)
         mainOverlay.addArrangedSubview(midSpacer)
         mainOverlay.addArrangedSubview(insightsCard)
+        mainOverlay.addArrangedSubview(overlayBottomSpacer)
 
         sparkleView.translatesAutoresizingMaskIntoConstraints = false
         sparkleView.symbolConfiguration = NSImage.SymbolConfiguration(pointSize: 22, weight: .regular)
@@ -179,7 +186,7 @@ final class DashboardView: NSView {
             mainOverlay.leadingAnchor.constraint(equalTo: mainHost.leadingAnchor),
             mainOverlay.trailingAnchor.constraint(equalTo: mainHost.trailingAnchor),
             mainOverlay.topAnchor.constraint(equalTo: mainHost.topAnchor),
-            mainHost.bottomAnchor.constraint(equalTo: mainOverlay.bottomAnchor, constant: 24),
+            mainOverlay.bottomAnchor.constraint(equalTo: mainHost.bottomAnchor, constant: -24),
 
             greetingLabel.leadingAnchor.constraint(equalTo: mainOverlay.leadingAnchor, constant: 24),
             greetingLabel.trailingAnchor.constraint(equalTo: mainOverlay.trailingAnchor, constant: -24),
@@ -237,16 +244,18 @@ final class DashboardView: NSView {
             toggleRow
         ])
         inner.orientation = .vertical
-        inner.spacing = 14
+        inner.spacing = 10
         inner.alignment = .centerX
+        inner.distribution = .fill
         inner.translatesAutoresizingMaskIntoConstraints = false
 
+        insightsCard.setContentHuggingPriority(.defaultHigh, for: .vertical)
         insightsCard.addSubview(inner)
         NSLayoutConstraint.activate([
             inner.leadingAnchor.constraint(equalTo: insightsCard.leadingAnchor, constant: 32),
             inner.trailingAnchor.constraint(equalTo: insightsCard.trailingAnchor, constant: -32),
-            inner.topAnchor.constraint(equalTo: insightsCard.topAnchor, constant: 28),
-            inner.bottomAnchor.constraint(equalTo: insightsCard.bottomAnchor, constant: -28),
+            inner.topAnchor.constraint(equalTo: insightsCard.topAnchor, constant: 22),
+            inner.bottomAnchor.constraint(equalTo: insightsCard.bottomAnchor, constant: -22),
             insightsCard.widthAnchor.constraint(equalToConstant: 440)
         ])
     }