Sfoglia il codice sorgente

Improve dashboard scroll views and chat layout

Use legacy scroller style on chat and saved jobs so the thumb sits in a
dedicated track. Pin the chat document view width to the clip view so
content tracks window width. Use width alignment on chat columns and job
stacks for consistent horizontal layout.

Co-authored-by: Cursor <cursoragent@cursor.com>
AhtashamShahzad1 3 settimane fa
parent
commit
0b55cc4278
1 ha cambiato i file con 11 aggiunte e 2 eliminazioni
  1. 11 2
      App for Indeed/Views/DashboardView.swift

+ 11 - 2
App for Indeed/Views/DashboardView.swift

@@ -308,6 +308,8 @@ final class DashboardView: NSView, NSTextFieldDelegate {
308 308
         chatScrollView.translatesAutoresizingMaskIntoConstraints = false
309 309
         chatScrollView.hasVerticalScroller = true
310 310
         chatScrollView.hasHorizontalScroller = false
311
+        // Legacy reserves a dedicated track to the right of the clip view so the thumb never sits on top of cards/buttons.
312
+        chatScrollView.scrollerStyle = .legacy
311 313
         chatScrollView.autohidesScrollers = true
312 314
         chatScrollView.drawsBackground = false
313 315
         chatScrollView.borderType = .noBorder
@@ -315,6 +317,12 @@ final class DashboardView: NSView, NSTextFieldDelegate {
315 317
         chatScrollView.setContentHuggingPriority(.defaultLow, for: .vertical)
316 318
         chatScrollView.setContentCompressionResistancePriority(.defaultLow, for: .vertical)
317 319
         chatScrollView.heightAnchor.constraint(greaterThanOrEqualToConstant: 320).isActive = true
320
+        // 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.
321
+        NSLayoutConstraint.activate([
322
+            chatDocumentView.topAnchor.constraint(equalTo: chatScrollView.contentView.topAnchor),
323
+            chatDocumentView.leadingAnchor.constraint(equalTo: chatScrollView.contentView.leadingAnchor),
324
+            chatDocumentView.widthAnchor.constraint(equalTo: chatScrollView.contentView.widthAnchor)
325
+        ])
318 326
     }
319 327
 
320 328
     private func updateJobListingDescriptionWidths() {
@@ -896,6 +904,7 @@ final class DashboardView: NSView, NSTextFieldDelegate {
896 904
         savedJobsScrollView.translatesAutoresizingMaskIntoConstraints = false
897 905
         savedJobsScrollView.hasVerticalScroller = true
898 906
         savedJobsScrollView.hasHorizontalScroller = false
907
+        savedJobsScrollView.scrollerStyle = .legacy
899 908
         savedJobsScrollView.autohidesScrollers = true
900 909
         savedJobsScrollView.drawsBackground = false
901 910
         savedJobsScrollView.borderType = .noBorder
@@ -1397,7 +1406,7 @@ final class DashboardView: NSView, NSTextFieldDelegate {
1397 1406
         let column = NSStackView(views: [nameLabel, bubble])
1398 1407
         column.orientation = .vertical
1399 1408
         column.spacing = 6
1400
-        column.alignment = .leading
1409
+        column.alignment = .width
1401 1410
         column.translatesAutoresizingMaskIntoConstraints = false
1402 1411
 
1403 1412
         if let jobs, !jobs.isEmpty {
@@ -1488,7 +1497,7 @@ final class DashboardView: NSView, NSTextFieldDelegate {
1488 1497
         let stack = ChatJobsStackView()
1489 1498
         stack.orientation = .vertical
1490 1499
         stack.spacing = 10
1491
-        stack.alignment = .leading
1500
+        stack.alignment = .width
1492 1501
         stack.distribution = .fill
1493 1502
         stack.translatesAutoresizingMaskIntoConstraints = false
1494 1503