From 71a520840eb3debe46173c1f73bc85bbea0b1aa6 Mon Sep 17 00:00:00 2001
From: Ariver <shanghai3168@gmail.com>
Date: Sun, 28 Jun 2026 23:42:38 +0800
Subject: [PATCH] Implement Pro custom hotkeys for 8.2.0

---
 src/Scripts/pro_feature_gate_qa.sh |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/src/Scripts/pro_feature_gate_qa.sh b/src/Scripts/pro_feature_gate_qa.sh
index 1a9447b..9ed2c60 100755
--- a/src/Scripts/pro_feature_gate_qa.sh
+++ b/src/Scripts/pro_feature_gate_qa.sh
@@ -62,6 +62,7 @@
     "layoutExport",
     "unlimitedNotes",
     "persistentAppSorting",
+    "customHotkeys",
 ]:
     require(pro, f"case {case}", f"missing ProFeature.{case}")
 
@@ -80,12 +81,18 @@
 require(pro, "ProEntitlementSnapshotStore", "sync entitlement snapshot for data-layer policy is missing")
 require(pro, "manualNonEmptyNoteCount", "note quota must count existing manual notes")
 require(pro, "manualNonEmptyNotePaths", "note quota must avoid double-counting existing notes")
+require(pro, "case .premiumThemes, .layoutImport, .layoutExport, .unlimitedNotes, .persistentAppSorting, .customHotkeys:", "custom hotkeys must be unlocked only by the Pro access state")
+require(pro, "NotificationCenter.default.post(name: .tagLauncherProEntitlementChanged", "Pro entitlement changes must notify hotkey registration")
 
 effective_theme = function_body(pro, "static func effectiveTheme(for storedTheme: AppGridTheme) -> AppGridTheme")
 require(effective_theme, "return .defaultLight", "locked premium theme must fall back to defaultLight")
 require(effective_theme, "canUseTheme(storedTheme)", "effectiveTheme must check Pro theme entitlement")
 
 require(app, "ProEntitlementCenter.shared.start()", "App startup does not start Pro entitlement center")
+require(app, "observeProEntitlementChanges()", "App startup must observe Pro entitlement changes for custom hotkeys")
+require(app, "applyCustomHotkey(_ hotkey: LauncherHotkey, for kind: LauncherHotkeyKind)", "AppDelegate custom hotkey save entry is missing")
+require(app, "guard ProEntitlementPolicy.isUnlocked(.customHotkeys) else", "custom hotkey save/restore must be hard-gated by Pro")
+require(app, "LauncherHotkeySettings.effectiveHotkey(for: kind)", "global hotkey registration must use the entitlement-aware effective shortcut")
 
 require(theme, "var requiresPro: Bool", "AppGridTheme does not expose Pro requirement")
 require(theme, "ProEntitlementConfig.freeThemes.contains(self)", "theme Pro requirement must use central free theme set")
@@ -126,6 +133,8 @@
 
 require(preferences, "ProStatusPill(text: tr(\"pro.card.badge\"), style: .locked, compact: true)", "locked data actions must show compact Pro pill")
 require(preferences, "presentSettingsProPrompt(for: .premiumThemes)", "premium theme selection prompt is missing")
+require(preferences, "presentSettingsProPrompt(for: .customHotkeys)", "custom hotkey Pro prompt is missing")
+require(preferences, "NSEvent.addLocalMonitorForEvents(matching: .keyDown)", "custom hotkey recording must be local to Settings")
 require(preferences, "proEntitlement.startThemePreview(for: theme, tuning:", "premium theme free preview is missing")
 require(preferences, "proEntitlement.stopThemePreview()", "theme preview cleanup is missing")
 require(pro, "func remainingSeconds(at date: Date = Date()) -> Int", "theme preview remaining-seconds helper is missing")

--
Gitblit v1.9.3