Pārlūkot izejas kodu

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 mēneši atpakaļ
vecāks
revīzija
f094209a53

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

@@ -3,7 +3,7 @@
 //  App for Indeed
 //
 //  Shared résumé colours for gallery thumbnails and filled CV preview/export.
-//  Tracks app light / dark mode so the selected template looks the same everywhere.
+//  Résumés always use a print-style light palette regardless of app light/dark mode.
 //
 
 import AppKit
@@ -22,29 +22,15 @@ enum CVResumeAppearance {
         let accentBlue: NSColor
     }
 
-    static var isDark: Bool { AppAppearanceManager.shared.isDark }
-
-    static func colors(isDark dark: Bool? = nil) -> Colors {
-        let dark = dark ?? isDark
-        if dark {
-            return Colors(
-                paper: NSColor(srgbRed: 28 / 255, green: 30 / 255, blue: 36 / 255, alpha: 1),
-                ink: NSColor(srgbRed: 0.94, green: 0.95, blue: 0.97, alpha: 1),
-                muted: NSColor(srgbRed: 0.62, green: 0.66, blue: 0.72, alpha: 1),
-                rule: NSColor(srgbRed: 0.38, green: 0.40, blue: 0.46, alpha: 1),
-                cardBackground: NSColor(srgbRed: 32 / 255, green: 34 / 255, blue: 40 / 255, alpha: 1),
-                sidebarTint: NSColor(srgbRed: 40 / 255, green: 42 / 255, blue: 48 / 255, alpha: 1),
-                accentRed: NSColor(srgbRed: 235 / 255, green: 88 / 255, blue: 72 / 255, alpha: 1),
-                accentBlue: AppDashboardTheme.brandBlue
-            )
-        }
-        return Colors(
+    /// Print-style palette — always light, even when the app chrome is in dark mode.
+    static func colors() -> Colors {
+        Colors(
             paper: NSColor.white,
             ink: NSColor(srgbRed: 38 / 255, green: 50 / 255, blue: 71 / 255, alpha: 1),
             muted: NSColor(srgbRed: 110 / 255, green: 118 / 255, blue: 132 / 255, alpha: 1),
             rule: NSColor(srgbRed: 228 / 255, green: 232 / 255, blue: 240 / 255, alpha: 1),
             cardBackground: NSColor.white,
-            sidebarTint: AppDashboardTheme.cvMakerPreviewSidebarTint,
+            sidebarTint: NSColor(srgbRed: 244 / 255, green: 246 / 255, blue: 250 / 255, alpha: 1),
             accentRed: NSColor(srgbRed: 207 / 255, green: 67 / 255, blue: 50 / 255, alpha: 1),
             accentBlue: AppDashboardTheme.brandBlue
         )
@@ -52,7 +38,6 @@ enum CVResumeAppearance {
 
     /// Slight paper tint by layout variant (gallery + filled CV use the same rule).
     static func paperBackground(variant: Int, base: NSColor) -> NSColor {
-        guard !isDark else { return base }
         switch variant % 5 {
         case 0: return base
         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 {
         titleLabel.textColor = AppDashboardTheme.primaryText
         subtitleLabel.textColor = AppDashboardTheme.secondaryText
         exportButton.applyCurrentAppearance()
-        if let profile = lastProfile, let template = lastTemplate {
-            configure(profile: profile, template: template)
-        }
     }
 
     func configure(profile: SavedProfile, template: CVTemplate) {

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

@@ -131,9 +131,7 @@ private struct DocumentStyle {
                 ?? NSFontManager.shared.convert(georgia12, toHaveTrait: .italicFontMask)
             let eduMeta = NSFont(name: "Georgia-Italic", size: 11.5)
                 ?? NSFontManager.shared.convert(georgia115, toHaveTrait: .italicFontMask)
-            let execCard = CVResumeAppearance.isDark
-                ? cardBG
-                : NSColor(srgbRed: 0.992, green: 0.99, blue: 0.985, alpha: 1)
+            let execCard = NSColor(srgbRed: 0.992, green: 0.99, blue: 0.985, alpha: 1)
             return DocumentStyle(
                 nameFont: serifName,
                 roleFont: serifRole,
@@ -199,7 +197,6 @@ final class CVProfileDocumentView: NSView {
     private var style: DocumentStyle
     /// Matches `CVTemplatePreviewView` so the same template id + layout recipe renders the same silhouette as the gallery card.
     private let variant: Int
-    private var appearanceObserver: NSObjectProtocol?
     private weak var cardView: NSView?
 
     init(profile: SavedProfile, template: CVTemplate) {
@@ -214,29 +211,6 @@ final class CVProfileDocumentView: NSView {
         userInterfaceLayoutDirection = .leftToRight
         setContentHuggingPriority(.defaultLow, for: .horizontal)
         installCardContent()
-        appearanceObserver = NotificationCenter.default.addObserver(
-            forName: AppAppearanceManager.didChangeNotification,
-            object: nil,
-            queue: .main
-        ) { [weak self] _ in
-            self?.refreshForAppearanceChange()
-        }
-    }
-
-    deinit {
-        if let appearanceObserver {
-            NotificationCenter.default.removeObserver(appearanceObserver)
-        }
-    }
-
-    override func viewDidChangeEffectiveAppearance() {
-        super.viewDidChangeEffectiveAppearance()
-        refreshForAppearanceChange()
-    }
-
-    private func refreshForAppearanceChange() {
-        style = DocumentStyle.make(for: template)
-        installCardContent()
     }
 
     private func installCardContent() {