|
|
@@ -140,6 +140,8 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
140
|
140
|
|
|
141
|
141
|
private var currentSidebarItems: [SidebarItem] = []
|
|
142
|
142
|
private var selectedSidebarIndex: Int = 0
|
|
|
143
|
+ /// When true, the **Indeed** sidebar row is highlighted instead of `selectedSidebarIndex`.
|
|
|
144
|
+ private var isIndeedSidebarSelected = false
|
|
143
|
145
|
/// All jobs that have been shown in the current chat session, oldest first. Used to deduplicate continuation searches so "show more" doesn't re-display the same listings.
|
|
144
|
146
|
private var lastSearchResults: [JobListing] = []
|
|
145
|
147
|
/// "Show more jobs" row under the latest assistant message that listed jobs; removed when a newer listing block replaces it.
|
|
|
@@ -952,6 +954,15 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
952
|
954
|
|
|
953
|
955
|
private static let externalIndeedAppURLSchemes = ["indeed://", "indeedjobs://"]
|
|
954
|
956
|
|
|
|
957
|
+ private func selectIndeedSidebar() {
|
|
|
958
|
+ isIndeedSidebarSelected = true
|
|
|
959
|
+ if !isIndeedJobBrowserPresented {
|
|
|
960
|
+ openIndeedFromSidebar()
|
|
|
961
|
+ }
|
|
|
962
|
+ configureSidebar()
|
|
|
963
|
+ updateMainContentVisibility()
|
|
|
964
|
+ }
|
|
|
965
|
+
|
|
955
|
966
|
/// Opens the installed Indeed app when a handler is registered; otherwise loads Indeed in the embedded browser.
|
|
956
|
967
|
private func openIndeedFromSidebar() {
|
|
957
|
968
|
for scheme in Self.externalIndeedAppURLSchemes {
|
|
|
@@ -983,6 +994,10 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
983
|
994
|
private func dismissIndeedJobBrowserEmbedded() {
|
|
984
|
995
|
guard isIndeedJobBrowserPresented else { return }
|
|
985
|
996
|
isIndeedJobBrowserPresented = false
|
|
|
997
|
+ if isIndeedSidebarSelected {
|
|
|
998
|
+ isIndeedSidebarSelected = false
|
|
|
999
|
+ configureSidebar()
|
|
|
1000
|
+ }
|
|
986
|
1001
|
updateMainContentVisibility()
|
|
987
|
1002
|
}
|
|
988
|
1003
|
|
|
|
@@ -2397,16 +2412,19 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
2397
|
2412
|
}
|
|
2398
|
2413
|
|
|
2399
|
2414
|
private func addIndeedSidebarLaunchRow() {
|
|
|
2415
|
+ let isSelected = isIndeedSidebarSelected
|
|
|
2416
|
+
|
|
2400
|
2417
|
let rowHost = SidebarNavRowView { [weak self] in
|
|
2401
|
|
- self?.openIndeedFromSidebar()
|
|
|
2418
|
+ self?.selectIndeedSidebar()
|
|
2402
|
2419
|
}
|
|
2403
|
2420
|
rowHost.translatesAutoresizingMaskIntoConstraints = false
|
|
2404
|
2421
|
rowHost.wantsLayer = true
|
|
2405
|
2422
|
rowHost.layer?.cornerRadius = 8
|
|
2406
|
|
- rowHost.restingBackgroundColor = nil
|
|
2407
|
|
- rowHost.hoverBackgroundColor = Theme.sidebarRowHoverFill
|
|
|
2423
|
+ rowHost.restingBackgroundColor = isSelected ? Theme.selectionFill : nil
|
|
|
2424
|
+ rowHost.hoverBackgroundColor = isSelected ? Theme.selectionFillHover : Theme.sidebarRowHoverFill
|
|
2408
|
2425
|
rowHost.setAccessibilityLabel("Indeed")
|
|
2409
|
2426
|
rowHost.setAccessibilityRole(.button)
|
|
|
2427
|
+ rowHost.setAccessibilitySelected(isSelected)
|
|
2410
|
2428
|
rowHost.setAccessibilityHelp("Open Indeed to search and apply for jobs")
|
|
2411
|
2429
|
|
|
2412
|
2430
|
let row = NSStackView()
|
|
|
@@ -2420,7 +2438,7 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
2420
|
2438
|
|
|
2421
|
2439
|
let text = NSTextField(labelWithString: "Indeed")
|
|
2422
|
2440
|
text.font = .systemFont(ofSize: 14, weight: .medium)
|
|
2423
|
|
- text.textColor = Theme.secondaryText
|
|
|
2441
|
+ text.textColor = isSelected ? Theme.brandBlue : Theme.secondaryText
|
|
2424
|
2442
|
text.refusesFirstResponder = true
|
|
2425
|
2443
|
|
|
2426
|
2444
|
row.addArrangedSubview(logo)
|
|
|
@@ -2468,7 +2486,7 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
2468
|
2486
|
addIndeedSidebarLaunchRow()
|
|
2469
|
2487
|
|
|
2470
|
2488
|
items.enumerated().forEach { index, item in
|
|
2471
|
|
- let isSelected = index == selectedSidebarIndex
|
|
|
2489
|
+ let isSelected = index == selectedSidebarIndex && !isIndeedSidebarSelected
|
|
2472
|
2490
|
|
|
2473
|
2491
|
let rowHost = SidebarNavRowView { [weak self] in
|
|
2474
|
2492
|
self?.selectSidebarItem(at: index)
|
|
|
@@ -2656,10 +2674,12 @@ final class DashboardView: NSView, NSTextFieldDelegate, NSSharingServicePickerDe
|
|
2656
|
2674
|
}
|
|
2657
|
2675
|
|
|
2658
|
2676
|
private func selectSidebarItem(at index: Int) {
|
|
|
2677
|
+ let leavingIndeedSelection = isIndeedSidebarSelected
|
|
|
2678
|
+ isIndeedSidebarSelected = false
|
|
2659
|
2679
|
dismissIndeedJobBrowserEmbedded()
|
|
2660
|
2680
|
guard index >= 0, index < currentSidebarItems.count else { return }
|
|
2661
|
2681
|
let selectingHome = isHomeSidebarIndex(index)
|
|
2662
|
|
- if index == selectedSidebarIndex {
|
|
|
2682
|
+ if index == selectedSidebarIndex, !leavingIndeedSelection {
|
|
2663
|
2683
|
if selectingHome {
|
|
2664
|
2684
|
applyHomeState()
|
|
2665
|
2685
|
}
|