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

Tighten home hero layout and enlarge chat area

Reduce welcome section spacing, typography, sparkle icon, and feature
card padding so the conversation scroll view sits higher and reads
larger. Raise chat minimum height and prefer vertical growth in the
chat scroller via stack hugging priorities.

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

+ 20 - 18
App for Indeed/Views/DashboardView.swift

@@ -215,19 +215,19 @@ final class DashboardView: NSView, NSTextFieldDelegate {
215
         mainOverlay.translatesAutoresizingMaskIntoConstraints = false
215
         mainOverlay.translatesAutoresizingMaskIntoConstraints = false
216
         mainOverlay.setContentHuggingPriority(.defaultLow, for: .vertical)
216
         mainOverlay.setContentHuggingPriority(.defaultLow, for: .vertical)
217
 
217
 
218
-        greetingLabel.font = .systemFont(ofSize: 34, weight: .bold)
218
+        greetingLabel.font = .systemFont(ofSize: 28, weight: .bold)
219
         greetingLabel.textColor = Theme.welcomeHeroHeadingBlue
219
         greetingLabel.textColor = Theme.welcomeHeroHeadingBlue
220
         greetingLabel.alignment = .center
220
         greetingLabel.alignment = .center
221
         greetingLabel.maximumNumberOfLines = 1
221
         greetingLabel.maximumNumberOfLines = 1
222
 
222
 
223
-        subtitleLabel.font = .systemFont(ofSize: 15, weight: .regular)
223
+        subtitleLabel.font = .systemFont(ofSize: 14, weight: .regular)
224
         subtitleLabel.textColor = Theme.welcomeHeroSubtitleText
224
         subtitleLabel.textColor = Theme.welcomeHeroSubtitleText
225
         subtitleLabel.alignment = .center
225
         subtitleLabel.alignment = .center
226
         subtitleLabel.maximumNumberOfLines = 2
226
         subtitleLabel.maximumNumberOfLines = 2
227
 
227
 
228
         let topInset = NSView()
228
         let topInset = NSView()
229
         topInset.translatesAutoresizingMaskIntoConstraints = false
229
         topInset.translatesAutoresizingMaskIntoConstraints = false
230
-        topInset.heightAnchor.constraint(equalToConstant: 24).isActive = true
230
+        topInset.heightAnchor.constraint(equalToConstant: 12).isActive = true
231
 
231
 
232
         configureSearchBar()
232
         configureSearchBar()
233
         configureChatViews()
233
         configureChatViews()
@@ -238,12 +238,13 @@ final class DashboardView: NSView, NSTextFieldDelegate {
238
 
238
 
239
         let welcomeHeroContent = NSStackView(views: [welcomeSparkleCluster, greetingLabel, subtitleLabel])
239
         let welcomeHeroContent = NSStackView(views: [welcomeSparkleCluster, greetingLabel, subtitleLabel])
240
         welcomeHeroContent.orientation = .vertical
240
         welcomeHeroContent.orientation = .vertical
241
-        welcomeHeroContent.spacing = 14
241
+        welcomeHeroContent.spacing = 8
242
         welcomeHeroContent.alignment = .centerX
242
         welcomeHeroContent.alignment = .centerX
243
         welcomeHeroContent.translatesAutoresizingMaskIntoConstraints = false
243
         welcomeHeroContent.translatesAutoresizingMaskIntoConstraints = false
244
 
244
 
245
         welcomeHeroHost.addSubview(welcomeHeroBackgroundView)
245
         welcomeHeroHost.addSubview(welcomeHeroBackgroundView)
246
         welcomeHeroHost.addSubview(welcomeHeroContent)
246
         welcomeHeroHost.addSubview(welcomeHeroContent)
247
+        welcomeHeroHost.setContentHuggingPriority(.defaultHigh, for: .vertical)
247
         NSLayoutConstraint.activate([
248
         NSLayoutConstraint.activate([
248
             welcomeHeroBackgroundView.leadingAnchor.constraint(equalTo: welcomeHeroHost.leadingAnchor),
249
             welcomeHeroBackgroundView.leadingAnchor.constraint(equalTo: welcomeHeroHost.leadingAnchor),
249
             welcomeHeroBackgroundView.trailingAnchor.constraint(equalTo: welcomeHeroHost.trailingAnchor),
250
             welcomeHeroBackgroundView.trailingAnchor.constraint(equalTo: welcomeHeroHost.trailingAnchor),
@@ -253,27 +254,28 @@ final class DashboardView: NSView, NSTextFieldDelegate {
253
             welcomeHeroContent.centerXAnchor.constraint(equalTo: welcomeHeroHost.centerXAnchor),
254
             welcomeHeroContent.centerXAnchor.constraint(equalTo: welcomeHeroHost.centerXAnchor),
254
             welcomeHeroContent.leadingAnchor.constraint(greaterThanOrEqualTo: welcomeHeroHost.leadingAnchor, constant: 16),
255
             welcomeHeroContent.leadingAnchor.constraint(greaterThanOrEqualTo: welcomeHeroHost.leadingAnchor, constant: 16),
255
             welcomeHeroContent.trailingAnchor.constraint(lessThanOrEqualTo: welcomeHeroHost.trailingAnchor, constant: -16),
256
             welcomeHeroContent.trailingAnchor.constraint(lessThanOrEqualTo: welcomeHeroHost.trailingAnchor, constant: -16),
256
-            welcomeHeroContent.topAnchor.constraint(equalTo: welcomeHeroHost.topAnchor, constant: 8),
257
-            welcomeHeroContent.bottomAnchor.constraint(equalTo: welcomeHeroHost.bottomAnchor, constant: -4)
257
+            welcomeHeroContent.topAnchor.constraint(equalTo: welcomeHeroHost.topAnchor, constant: 4),
258
+            welcomeHeroContent.bottomAnchor.constraint(equalTo: welcomeHeroHost.bottomAnchor, constant: -2)
258
         ])
259
         ])
259
 
260
 
260
         configureFeatureShortcutCards()
261
         configureFeatureShortcutCards()
262
+        featureCardsRow.setContentHuggingPriority(.defaultHigh, for: .vertical)
261
 
263
 
262
         let heroCardsSpacer = NSView()
264
         let heroCardsSpacer = NSView()
263
         heroCardsSpacer.translatesAutoresizingMaskIntoConstraints = false
265
         heroCardsSpacer.translatesAutoresizingMaskIntoConstraints = false
264
-        heroCardsSpacer.heightAnchor.constraint(equalToConstant: 36).isActive = true
266
+        heroCardsSpacer.heightAnchor.constraint(equalToConstant: 14).isActive = true
265
 
267
 
266
         let midSpacer = NSView()
268
         let midSpacer = NSView()
267
         midSpacer.translatesAutoresizingMaskIntoConstraints = false
269
         midSpacer.translatesAutoresizingMaskIntoConstraints = false
268
-        midSpacer.heightAnchor.constraint(equalToConstant: 12).isActive = true
270
+        midSpacer.heightAnchor.constraint(equalToConstant: 6).isActive = true
269
 
271
 
270
         let chatTopSpacer = NSView()
272
         let chatTopSpacer = NSView()
271
         chatTopSpacer.translatesAutoresizingMaskIntoConstraints = false
273
         chatTopSpacer.translatesAutoresizingMaskIntoConstraints = false
272
-        chatTopSpacer.heightAnchor.constraint(equalToConstant: 14).isActive = true
274
+        chatTopSpacer.heightAnchor.constraint(equalToConstant: 8).isActive = true
273
 
275
 
274
         let chatBottomSpacer = NSView()
276
         let chatBottomSpacer = NSView()
275
         chatBottomSpacer.translatesAutoresizingMaskIntoConstraints = false
277
         chatBottomSpacer.translatesAutoresizingMaskIntoConstraints = false
276
-        chatBottomSpacer.heightAnchor.constraint(equalToConstant: 14).isActive = true
278
+        chatBottomSpacer.heightAnchor.constraint(equalToConstant: 8).isActive = true
277
 
279
 
278
         mainOverlay.addArrangedSubview(topInset)
280
         mainOverlay.addArrangedSubview(topInset)
279
         mainOverlay.addArrangedSubview(welcomeHeroHost)
281
         mainOverlay.addArrangedSubview(welcomeHeroHost)
@@ -378,7 +380,7 @@ final class DashboardView: NSView, NSTextFieldDelegate {
378
         chatScrollView.documentView = chatDocumentView
380
         chatScrollView.documentView = chatDocumentView
379
         chatScrollView.setContentHuggingPriority(.defaultLow, for: .vertical)
381
         chatScrollView.setContentHuggingPriority(.defaultLow, for: .vertical)
380
         chatScrollView.setContentCompressionResistancePriority(.defaultLow, for: .vertical)
382
         chatScrollView.setContentCompressionResistancePriority(.defaultLow, for: .vertical)
381
-        chatScrollView.heightAnchor.constraint(greaterThanOrEqualToConstant: 320).isActive = true
383
+        chatScrollView.heightAnchor.constraint(greaterThanOrEqualToConstant: 420).isActive = true
382
         // Match Saved Jobs: pin document width to the clip view so cards and bubbles track window width instead of sticking to a narrow intrinsic width.
384
         // Match Saved Jobs: pin document width to the clip view so cards and bubbles track window width instead of sticking to a narrow intrinsic width.
383
         NSLayoutConstraint.activate([
385
         NSLayoutConstraint.activate([
384
             chatDocumentView.topAnchor.constraint(equalTo: chatScrollView.contentView.topAnchor),
386
             chatDocumentView.topAnchor.constraint(equalTo: chatScrollView.contentView.topAnchor),
@@ -2543,7 +2545,7 @@ private final class WelcomeHeroBackgroundView: NSView {
2543
 
2545
 
2544
 /// Circular pastel well with three sparkle symbols (reference: layered stars of different sizes).
2546
 /// Circular pastel well with three sparkle symbols (reference: layered stars of different sizes).
2545
 private final class WelcomeSparkleClusterView: NSView {
2547
 private final class WelcomeSparkleClusterView: NSView {
2546
-    private let diameter: CGFloat = 72
2548
+    private let diameter: CGFloat = 56
2547
 
2549
 
2548
     override var intrinsicContentSize: NSSize {
2550
     override var intrinsicContentSize: NSSize {
2549
         NSSize(width: diameter, height: diameter)
2551
         NSSize(width: diameter, height: diameter)
@@ -2560,9 +2562,9 @@ private final class WelcomeSparkleClusterView: NSView {
2560
         layer?.backgroundColor = iconWell.cgColor
2562
         layer?.backgroundColor = iconWell.cgColor
2561
 
2563
 
2562
         let configs: [(CGFloat, NSFont.Weight, CGFloat, CGFloat)] = [
2564
         let configs: [(CGFloat, NSFont.Weight, CGFloat, CGFloat)] = [
2563
-            (22, .medium, 0, 0),
2564
-            (14, .regular, -14, -11),
2565
-            (11, .regular, 15, 13)
2565
+            (17, .medium, 0, 0),
2566
+            (11, .regular, -11, -9),
2567
+            (9, .regular, 12, 10)
2566
         ]
2568
         ]
2567
 
2569
 
2568
         let symbolName = Self.sparkleSymbolName()
2570
         let symbolName = Self.sparkleSymbolName()
@@ -2626,7 +2628,7 @@ private final class FeatureShortcutCardView: NSView {
2626
         // `#5D6D7E` — muted description.
2628
         // `#5D6D7E` — muted description.
2627
         let secondary = NSColor(srgbRed: 93 / 255, green: 109 / 255, blue: 126 / 255, alpha: 1)
2629
         let secondary = NSColor(srgbRed: 93 / 255, green: 109 / 255, blue: 126 / 255, alpha: 1)
2628
 
2630
 
2629
-        let iconSize: CGFloat = 48
2631
+        let iconSize: CGFloat = 40
2630
         let iconHost = NSView()
2632
         let iconHost = NSView()
2631
         iconHost.translatesAutoresizingMaskIntoConstraints = false
2633
         iconHost.translatesAutoresizingMaskIntoConstraints = false
2632
         iconHost.wantsLayer = true
2634
         iconHost.wantsLayer = true
@@ -2635,7 +2637,7 @@ private final class FeatureShortcutCardView: NSView {
2635
 
2637
 
2636
         let icon = NSImageView()
2638
         let icon = NSImageView()
2637
         icon.translatesAutoresizingMaskIntoConstraints = false
2639
         icon.translatesAutoresizingMaskIntoConstraints = false
2638
-        icon.symbolConfiguration = NSImage.SymbolConfiguration(pointSize: 18, weight: .regular)
2640
+        icon.symbolConfiguration = NSImage.SymbolConfiguration(pointSize: 16, weight: .regular)
2639
         icon.image = NSImage(systemSymbolName: symbolName, accessibilityDescription: nil)
2641
         icon.image = NSImage(systemSymbolName: symbolName, accessibilityDescription: nil)
2640
         icon.contentTintColor = primaryBlue
2642
         icon.contentTintColor = primaryBlue
2641
         iconHost.addSubview(icon)
2643
         iconHost.addSubview(icon)
@@ -2695,7 +2697,7 @@ private final class FeatureShortcutCardView: NSView {
2695
         row.translatesAutoresizingMaskIntoConstraints = false
2697
         row.translatesAutoresizingMaskIntoConstraints = false
2696
         addSubview(row)
2698
         addSubview(row)
2697
 
2699
 
2698
-        let inset: CGFloat = 22
2700
+        let inset: CGFloat = 16
2699
         NSLayoutConstraint.activate([
2701
         NSLayoutConstraint.activate([
2700
             row.leadingAnchor.constraint(equalTo: leadingAnchor, constant: inset),
2702
             row.leadingAnchor.constraint(equalTo: leadingAnchor, constant: inset),
2701
             row.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -inset),
2703
             row.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -inset),