Преглед изворни кода

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 недеља
родитељ
комит
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 215
         mainOverlay.translatesAutoresizingMaskIntoConstraints = false
216 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 219
         greetingLabel.textColor = Theme.welcomeHeroHeadingBlue
220 220
         greetingLabel.alignment = .center
221 221
         greetingLabel.maximumNumberOfLines = 1
222 222
 
223
-        subtitleLabel.font = .systemFont(ofSize: 15, weight: .regular)
223
+        subtitleLabel.font = .systemFont(ofSize: 14, weight: .regular)
224 224
         subtitleLabel.textColor = Theme.welcomeHeroSubtitleText
225 225
         subtitleLabel.alignment = .center
226 226
         subtitleLabel.maximumNumberOfLines = 2
227 227
 
228 228
         let topInset = NSView()
229 229
         topInset.translatesAutoresizingMaskIntoConstraints = false
230
-        topInset.heightAnchor.constraint(equalToConstant: 24).isActive = true
230
+        topInset.heightAnchor.constraint(equalToConstant: 12).isActive = true
231 231
 
232 232
         configureSearchBar()
233 233
         configureChatViews()
@@ -238,12 +238,13 @@ final class DashboardView: NSView, NSTextFieldDelegate {
238 238
 
239 239
         let welcomeHeroContent = NSStackView(views: [welcomeSparkleCluster, greetingLabel, subtitleLabel])
240 240
         welcomeHeroContent.orientation = .vertical
241
-        welcomeHeroContent.spacing = 14
241
+        welcomeHeroContent.spacing = 8
242 242
         welcomeHeroContent.alignment = .centerX
243 243
         welcomeHeroContent.translatesAutoresizingMaskIntoConstraints = false
244 244
 
245 245
         welcomeHeroHost.addSubview(welcomeHeroBackgroundView)
246 246
         welcomeHeroHost.addSubview(welcomeHeroContent)
247
+        welcomeHeroHost.setContentHuggingPriority(.defaultHigh, for: .vertical)
247 248
         NSLayoutConstraint.activate([
248 249
             welcomeHeroBackgroundView.leadingAnchor.constraint(equalTo: welcomeHeroHost.leadingAnchor),
249 250
             welcomeHeroBackgroundView.trailingAnchor.constraint(equalTo: welcomeHeroHost.trailingAnchor),
@@ -253,27 +254,28 @@ final class DashboardView: NSView, NSTextFieldDelegate {
253 254
             welcomeHeroContent.centerXAnchor.constraint(equalTo: welcomeHeroHost.centerXAnchor),
254 255
             welcomeHeroContent.leadingAnchor.constraint(greaterThanOrEqualTo: welcomeHeroHost.leadingAnchor, constant: 16),
255 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 261
         configureFeatureShortcutCards()
262
+        featureCardsRow.setContentHuggingPriority(.defaultHigh, for: .vertical)
261 263
 
262 264
         let heroCardsSpacer = NSView()
263 265
         heroCardsSpacer.translatesAutoresizingMaskIntoConstraints = false
264
-        heroCardsSpacer.heightAnchor.constraint(equalToConstant: 36).isActive = true
266
+        heroCardsSpacer.heightAnchor.constraint(equalToConstant: 14).isActive = true
265 267
 
266 268
         let midSpacer = NSView()
267 269
         midSpacer.translatesAutoresizingMaskIntoConstraints = false
268
-        midSpacer.heightAnchor.constraint(equalToConstant: 12).isActive = true
270
+        midSpacer.heightAnchor.constraint(equalToConstant: 6).isActive = true
269 271
 
270 272
         let chatTopSpacer = NSView()
271 273
         chatTopSpacer.translatesAutoresizingMaskIntoConstraints = false
272
-        chatTopSpacer.heightAnchor.constraint(equalToConstant: 14).isActive = true
274
+        chatTopSpacer.heightAnchor.constraint(equalToConstant: 8).isActive = true
273 275
 
274 276
         let chatBottomSpacer = NSView()
275 277
         chatBottomSpacer.translatesAutoresizingMaskIntoConstraints = false
276
-        chatBottomSpacer.heightAnchor.constraint(equalToConstant: 14).isActive = true
278
+        chatBottomSpacer.heightAnchor.constraint(equalToConstant: 8).isActive = true
277 279
 
278 280
         mainOverlay.addArrangedSubview(topInset)
279 281
         mainOverlay.addArrangedSubview(welcomeHeroHost)
@@ -378,7 +380,7 @@ final class DashboardView: NSView, NSTextFieldDelegate {
378 380
         chatScrollView.documentView = chatDocumentView
379 381
         chatScrollView.setContentHuggingPriority(.defaultLow, for: .vertical)
380 382
         chatScrollView.setContentCompressionResistancePriority(.defaultLow, for: .vertical)
381
-        chatScrollView.heightAnchor.constraint(greaterThanOrEqualToConstant: 320).isActive = true
383
+        chatScrollView.heightAnchor.constraint(greaterThanOrEqualToConstant: 420).isActive = true
382 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 385
         NSLayoutConstraint.activate([
384 386
             chatDocumentView.topAnchor.constraint(equalTo: chatScrollView.contentView.topAnchor),
@@ -2543,7 +2545,7 @@ private final class WelcomeHeroBackgroundView: NSView {
2543 2545
 
2544 2546
 /// Circular pastel well with three sparkle symbols (reference: layered stars of different sizes).
2545 2547
 private final class WelcomeSparkleClusterView: NSView {
2546
-    private let diameter: CGFloat = 72
2548
+    private let diameter: CGFloat = 56
2547 2549
 
2548 2550
     override var intrinsicContentSize: NSSize {
2549 2551
         NSSize(width: diameter, height: diameter)
@@ -2560,9 +2562,9 @@ private final class WelcomeSparkleClusterView: NSView {
2560 2562
         layer?.backgroundColor = iconWell.cgColor
2561 2563
 
2562 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 2570
         let symbolName = Self.sparkleSymbolName()
@@ -2626,7 +2628,7 @@ private final class FeatureShortcutCardView: NSView {
2626 2628
         // `#5D6D7E` — muted description.
2627 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 2632
         let iconHost = NSView()
2631 2633
         iconHost.translatesAutoresizingMaskIntoConstraints = false
2632 2634
         iconHost.wantsLayer = true
@@ -2635,7 +2637,7 @@ private final class FeatureShortcutCardView: NSView {
2635 2637
 
2636 2638
         let icon = NSImageView()
2637 2639
         icon.translatesAutoresizingMaskIntoConstraints = false
2638
-        icon.symbolConfiguration = NSImage.SymbolConfiguration(pointSize: 18, weight: .regular)
2640
+        icon.symbolConfiguration = NSImage.SymbolConfiguration(pointSize: 16, weight: .regular)
2639 2641
         icon.image = NSImage(systemSymbolName: symbolName, accessibilityDescription: nil)
2640 2642
         icon.contentTintColor = primaryBlue
2641 2643
         iconHost.addSubview(icon)
@@ -2695,7 +2697,7 @@ private final class FeatureShortcutCardView: NSView {
2695 2697
         row.translatesAutoresizingMaskIntoConstraints = false
2696 2698
         addSubview(row)
2697 2699
 
2698
-        let inset: CGFloat = 22
2700
+        let inset: CGFloat = 16
2699 2701
         NSLayoutConstraint.activate([
2700 2702
             row.leadingAnchor.constraint(equalTo: leadingAnchor, constant: inset),
2701 2703
             row.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -inset),