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

Keep résumé templates and previews on a light print palette in dark mode.

Gallery thumbnails and filled CVs always use white paper and dark text while app chrome still follows the user’s appearance setting.

Co-authored-by: Cursor <cursoragent@cursor.com>
AhtashamShahzad1 недель назад: 2
Родитель
Сommit
f094209a53

+ 5 - 20
App for Indeed/Services/CVResumeAppearance.swift

@@ -3,7 +3,7 @@
3
 //  App for Indeed
3
 //  App for Indeed
4
 //
4
 //
5
 //  Shared résumé colours for gallery thumbnails and filled CV preview/export.
5
 //  Shared résumé colours for gallery thumbnails and filled CV preview/export.
6
-//  Tracks app light / dark mode so the selected template looks the same everywhere.
6
+//  Résumés always use a print-style light palette regardless of app light/dark mode.
7
 //
7
 //
8
 
8
 
9
 import AppKit
9
 import AppKit
@@ -22,29 +22,15 @@ enum CVResumeAppearance {
22
         let accentBlue: NSColor
22
         let accentBlue: NSColor
23
     }
23
     }
24
 
24
 
25
-    static var isDark: Bool { AppAppearanceManager.shared.isDark }
26
-
27
-    static func colors(isDark dark: Bool? = nil) -> Colors {
28
-        let dark = dark ?? isDark
29
-        if dark {
30
-            return Colors(
31
-                paper: NSColor(srgbRed: 28 / 255, green: 30 / 255, blue: 36 / 255, alpha: 1),
32
-                ink: NSColor(srgbRed: 0.94, green: 0.95, blue: 0.97, alpha: 1),
33
-                muted: NSColor(srgbRed: 0.62, green: 0.66, blue: 0.72, alpha: 1),
34
-                rule: NSColor(srgbRed: 0.38, green: 0.40, blue: 0.46, alpha: 1),
35
-                cardBackground: NSColor(srgbRed: 32 / 255, green: 34 / 255, blue: 40 / 255, alpha: 1),
36
-                sidebarTint: NSColor(srgbRed: 40 / 255, green: 42 / 255, blue: 48 / 255, alpha: 1),
37
-                accentRed: NSColor(srgbRed: 235 / 255, green: 88 / 255, blue: 72 / 255, alpha: 1),
38
-                accentBlue: AppDashboardTheme.brandBlue
39
-            )
40
-        }
41
-        return Colors(
25
+    /// Print-style palette — always light, even when the app chrome is in dark mode.
26
+    static func colors() -> Colors {
27
+        Colors(
42
             paper: NSColor.white,
28
             paper: NSColor.white,
43
             ink: NSColor(srgbRed: 38 / 255, green: 50 / 255, blue: 71 / 255, alpha: 1),
29
             ink: NSColor(srgbRed: 38 / 255, green: 50 / 255, blue: 71 / 255, alpha: 1),
44
             muted: NSColor(srgbRed: 110 / 255, green: 118 / 255, blue: 132 / 255, alpha: 1),
30
             muted: NSColor(srgbRed: 110 / 255, green: 118 / 255, blue: 132 / 255, alpha: 1),
45
             rule: NSColor(srgbRed: 228 / 255, green: 232 / 255, blue: 240 / 255, alpha: 1),
31
             rule: NSColor(srgbRed: 228 / 255, green: 232 / 255, blue: 240 / 255, alpha: 1),
46
             cardBackground: NSColor.white,
32
             cardBackground: NSColor.white,
47
-            sidebarTint: AppDashboardTheme.cvMakerPreviewSidebarTint,
33
+            sidebarTint: NSColor(srgbRed: 244 / 255, green: 246 / 255, blue: 250 / 255, alpha: 1),
48
             accentRed: NSColor(srgbRed: 207 / 255, green: 67 / 255, blue: 50 / 255, alpha: 1),
34
             accentRed: NSColor(srgbRed: 207 / 255, green: 67 / 255, blue: 50 / 255, alpha: 1),
49
             accentBlue: AppDashboardTheme.brandBlue
35
             accentBlue: AppDashboardTheme.brandBlue
50
         )
36
         )
@@ -52,7 +38,6 @@ enum CVResumeAppearance {
52
 
38
 
53
     /// Slight paper tint by layout variant (gallery + filled CV use the same rule).
39
     /// Slight paper tint by layout variant (gallery + filled CV use the same rule).
54
     static func paperBackground(variant: Int, base: NSColor) -> NSColor {
40
     static func paperBackground(variant: Int, base: NSColor) -> NSColor {
55
-        guard !isDark else { return base }
56
         switch variant % 5 {
41
         switch variant % 5 {
57
         case 0: return base
42
         case 0: return base
58
         case 1: return NSColor(srgbRed: 0.995, green: 0.992, blue: 0.985, alpha: 1)
43
         case 1: return NSColor(srgbRed: 0.995, green: 0.992, blue: 0.985, alpha: 1)

+ 0 - 3
App for Indeed/Views/CVFilledPreviewPageView.swift

@@ -225,9 +225,6 @@ final class CVFilledPreviewPageView: NSView {
225
         titleLabel.textColor = AppDashboardTheme.primaryText
225
         titleLabel.textColor = AppDashboardTheme.primaryText
226
         subtitleLabel.textColor = AppDashboardTheme.secondaryText
226
         subtitleLabel.textColor = AppDashboardTheme.secondaryText
227
         exportButton.applyCurrentAppearance()
227
         exportButton.applyCurrentAppearance()
228
-        if let profile = lastProfile, let template = lastTemplate {
229
-            configure(profile: profile, template: template)
230
-        }
231
     }
228
     }
232
 
229
 
233
     func configure(profile: SavedProfile, template: CVTemplate) {
230
     func configure(profile: SavedProfile, template: CVTemplate) {

+ 1 - 27
App for Indeed/Views/CVProfileDocumentView.swift

@@ -131,9 +131,7 @@ private struct DocumentStyle {
131
                 ?? NSFontManager.shared.convert(georgia12, toHaveTrait: .italicFontMask)
131
                 ?? NSFontManager.shared.convert(georgia12, toHaveTrait: .italicFontMask)
132
             let eduMeta = NSFont(name: "Georgia-Italic", size: 11.5)
132
             let eduMeta = NSFont(name: "Georgia-Italic", size: 11.5)
133
                 ?? NSFontManager.shared.convert(georgia115, toHaveTrait: .italicFontMask)
133
                 ?? NSFontManager.shared.convert(georgia115, toHaveTrait: .italicFontMask)
134
-            let execCard = CVResumeAppearance.isDark
135
-                ? cardBG
136
-                : NSColor(srgbRed: 0.992, green: 0.99, blue: 0.985, alpha: 1)
134
+            let execCard = NSColor(srgbRed: 0.992, green: 0.99, blue: 0.985, alpha: 1)
137
             return DocumentStyle(
135
             return DocumentStyle(
138
                 nameFont: serifName,
136
                 nameFont: serifName,
139
                 roleFont: serifRole,
137
                 roleFont: serifRole,
@@ -199,7 +197,6 @@ final class CVProfileDocumentView: NSView {
199
     private var style: DocumentStyle
197
     private var style: DocumentStyle
200
     /// Matches `CVTemplatePreviewView` so the same template id + layout recipe renders the same silhouette as the gallery card.
198
     /// Matches `CVTemplatePreviewView` so the same template id + layout recipe renders the same silhouette as the gallery card.
201
     private let variant: Int
199
     private let variant: Int
202
-    private var appearanceObserver: NSObjectProtocol?
203
     private weak var cardView: NSView?
200
     private weak var cardView: NSView?
204
 
201
 
205
     init(profile: SavedProfile, template: CVTemplate) {
202
     init(profile: SavedProfile, template: CVTemplate) {
@@ -214,29 +211,6 @@ final class CVProfileDocumentView: NSView {
214
         userInterfaceLayoutDirection = .leftToRight
211
         userInterfaceLayoutDirection = .leftToRight
215
         setContentHuggingPriority(.defaultLow, for: .horizontal)
212
         setContentHuggingPriority(.defaultLow, for: .horizontal)
216
         installCardContent()
213
         installCardContent()
217
-        appearanceObserver = NotificationCenter.default.addObserver(
218
-            forName: AppAppearanceManager.didChangeNotification,
219
-            object: nil,
220
-            queue: .main
221
-        ) { [weak self] _ in
222
-            self?.refreshForAppearanceChange()
223
-        }
224
-    }
225
-
226
-    deinit {
227
-        if let appearanceObserver {
228
-            NotificationCenter.default.removeObserver(appearanceObserver)
229
-        }
230
-    }
231
-
232
-    override func viewDidChangeEffectiveAppearance() {
233
-        super.viewDidChangeEffectiveAppearance()
234
-        refreshForAppearanceChange()
235
-    }
236
-
237
-    private func refreshForAppearanceChange() {
238
-        style = DocumentStyle.make(for: template)
239
-        installCardContent()
240
     }
214
     }
241
 
215
 
242
     private func installCardContent() {
216
     private func installCardContent() {