Pārlūkot izejas kodu

CV gallery: split templates by design vs profession; quiet window restore

- Map template families to design-based vs profession-based groups and
  filter the CV maker gallery accordingly; hide empty family chips.
- Extend catalog prompts so modern/creative vs minimal/professional/
  executive content matches each gallery tab.
- Set isRestorable false on main and premium windows and opt out of
  secure restorable state until real NSWindowRestoration is implemented,
  avoiding null className restoration warnings.

Co-authored-by: Cursor <cursoragent@cursor.com>
AhtashamShahzad1 2 mēneši atpakaļ
vecāks
revīzija
2c81504214

+ 4 - 1
App for Indeed/AppDelegate.swift

@@ -53,6 +53,8 @@ class AppDelegate: NSObject, NSApplicationDelegate {
 
             window.minSize = self.minimumWindowSize
             window.setContentSize(self.minimumWindowSize)
+            // Prevents "className=(null)" restoration warnings; layout is applied each launch.
+            window.isRestorable = false
             window.title = "App for Indeed"
             window.styleMask.insert(.fullSizeContentView)
             window.titlebarAppearsTransparent = true
@@ -68,7 +70,8 @@ class AppDelegate: NSObject, NSApplicationDelegate {
     }
 
     func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool {
-        return true
+        // Opt out until real `NSWindowRestoration` is implemented (avoids null className restore logs).
+        return false
     }
 
 

+ 1 - 0
App for Indeed/Controllers/PremiumPlansWindowController.swift

@@ -16,6 +16,7 @@ final class PremiumPlansWindowController: NSWindowController {
         window.backgroundColor = Self.paywallSheetBackground
         window.setContentSize(NSSize(width: 1160, height: 760))
         window.minSize = NSSize(width: 980, height: 680)
+        window.isRestorable = false
         window.center()
         super.init(window: window)
     }

+ 4 - 1
App for Indeed/Services/CVTemplateFetchService.swift

@@ -26,11 +26,14 @@ final class CVTemplateFetchService {
         Use creative but professional names; do not copy real commercial template trademarks. \
         Vary `headline`, `accent`, `layoutType`, `sidebarSide`, `sidebarTinted`, and `sectionLabelStyle` across the set — do not repeat \
         the same six-tuple of those fields on consecutive rows. \
+        Niche split for the in-app gallery: `modern` and `creative` families are shown under Design-Based (portfolio / UX / visual roles); \
+        `minimal`, `professional`, and `executive` appear under Profession-Based (ATS-friendly / corporate / leadership). \
         Output must strictly match the JSON schema — no markdown or extra keys.
         """
         static let userInput = """
         Generate the template catalog now. Exactly six entries per family: professional, modern, creative, minimal, executive. \
-        Use both singleColumn and twoColumn layouts across the 30 rows. For twoColumn rows vary leading vs trailing sidebars and tinted true/false.
+        Use both singleColumn and twoColumn layouts across the 30 rows. For twoColumn rows vary leading vs trailing sidebars and tinted true/false. \
+        Keep modern and creative entries suitable for design-led résumés; keep minimal, professional, and executive suitable for traditional industries.
         """
     }
 

+ 14 - 4
App for Indeed/Views/CVMakerPageView.swift

@@ -109,6 +109,14 @@ struct CVTemplate: Hashable {
         }
     }
 
+    /// Top-level gallery tab: expressive layouts for design-led roles vs. conservative ATS-friendly styles.
+    var galleryGroup: CVCategoryGroup {
+        switch family {
+        case .modern, .creative: return .designBased
+        case .minimal, .professional, .executive: return .professionBased
+        }
+    }
+
     var themeColor: NSColor {
         NSColor(srgbRed: themeRed, green: themeGreen, blue: themeBlue, alpha: 1)
     }
@@ -718,21 +726,23 @@ final class CVMakerPageView: NSView {
 
         for family in CVDesignFamily.allCases {
             let count = templates(forGroup: selectedGroup, family: family).count
+            guard count > 0 else { continue }
             let chip = CVChipButton(title: family.title, badgeText: "\(count)", leadingSymbol: nil, style: .pillSmall)
             chip.onSelect = { [weak self] in self?.didSelectFamily(family) }
             familyChipsRow.addArrangedSubview(chip)
             familyChipButtons[family] = chip
         }
+
+        if let f = selectedFamily, templates(forGroup: selectedGroup, family: f).isEmpty {
+            selectedFamily = nil
+        }
     }
 
     // MARK: Data filtering
 
     private func templates(forGroup group: CVCategoryGroup, family: CVDesignFamily?) -> [CVTemplate] {
-        // The catalog is design-driven; profession-based reuses the same templates
-        // so the gallery is fully populated for both groups in this preview build.
-        let base = activeCatalog
+        let base = activeCatalog.filter { $0.galleryGroup == group }
         guard let family else { return base }
-        _ = group
         return base.filter { $0.family == family }
     }