Selaa lähdekoodia

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 2 kuukautta sitten
vanhempi
sitoutus
0b55cc4278
1 muutettua tiedostoa jossa 11 lisäystä ja 2 poistoa
  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 {
         chatScrollView.translatesAutoresizingMaskIntoConstraints = false
         chatScrollView.hasVerticalScroller = true
         chatScrollView.hasHorizontalScroller = false
+        // Legacy reserves a dedicated track to the right of the clip view so the thumb never sits on top of cards/buttons.
+        chatScrollView.scrollerStyle = .legacy
         chatScrollView.autohidesScrollers = true
         chatScrollView.drawsBackground = false
         chatScrollView.borderType = .noBorder
@@ -315,6 +317,12 @@ final class DashboardView: NSView, NSTextFieldDelegate {
         chatScrollView.setContentHuggingPriority(.defaultLow, for: .vertical)
         chatScrollView.setContentCompressionResistancePriority(.defaultLow, for: .vertical)
         chatScrollView.heightAnchor.constraint(greaterThanOrEqualToConstant: 320).isActive = true
+        // 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.
+        NSLayoutConstraint.activate([
+            chatDocumentView.topAnchor.constraint(equalTo: chatScrollView.contentView.topAnchor),
+            chatDocumentView.leadingAnchor.constraint(equalTo: chatScrollView.contentView.leadingAnchor),
+            chatDocumentView.widthAnchor.constraint(equalTo: chatScrollView.contentView.widthAnchor)
+        ])
     }
 
     private func updateJobListingDescriptionWidths() {
@@ -896,6 +904,7 @@ final class DashboardView: NSView, NSTextFieldDelegate {
         savedJobsScrollView.translatesAutoresizingMaskIntoConstraints = false
         savedJobsScrollView.hasVerticalScroller = true
         savedJobsScrollView.hasHorizontalScroller = false
+        savedJobsScrollView.scrollerStyle = .legacy
         savedJobsScrollView.autohidesScrollers = true
         savedJobsScrollView.drawsBackground = false
         savedJobsScrollView.borderType = .noBorder
@@ -1397,7 +1406,7 @@ final class DashboardView: NSView, NSTextFieldDelegate {
         let column = NSStackView(views: [nameLabel, bubble])
         column.orientation = .vertical
         column.spacing = 6
-        column.alignment = .leading
+        column.alignment = .width
         column.translatesAutoresizingMaskIntoConstraints = false
 
         if let jobs, !jobs.isEmpty {
@@ -1488,7 +1497,7 @@ final class DashboardView: NSView, NSTextFieldDelegate {
         let stack = ChatJobsStackView()
         stack.orientation = .vertical
         stack.spacing = 10
-        stack.alignment = .leading
+        stack.alignment = .width
         stack.distribution = .fill
         stack.translatesAutoresizingMaskIntoConstraints = false