Add brand visual style to page profile and logo palette to image prompts

Adds PageProfile.visualStyle (with migration), feeds it into every AI
prompt route, and samples a logo palette for image generation. Also
hardens Chrome focus handling and image copy in the ChatGPT driver.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Loma Bot Ops
2026-11-23 20:58:06 +07:00
parent dc6ee09a55
commit 4c93bf0a11
18 changed files with 166 additions and 49 deletions
+9 -1
View File
@@ -11,11 +11,19 @@ public static class ChromeKeyboard
[DllImport("user32.dll")] private static extern bool AttachThreadInput(uint source, uint target, bool attach);
[DllImport("user32.dll")] private static extern bool SetForegroundWindow(IntPtr h);
[DllImport("user32.dll")] private static extern bool BringWindowToTop(IntPtr h);
[DllImport("user32.dll")] private static extern void keybd_event(byte key, byte scan, uint flags, UIntPtr extra);
public static void ActivateWindow(IntPtr window)
{
if (GetForegroundWindow() == window) return;
if (SetForegroundWindow(window)) return;
// A synthetic Alt press is the documented user-input signal Windows
// uses to allow a background process to transfer foreground focus.
keybd_event(0x12, 0, 0, UIntPtr.Zero);
keybd_event(0x12, 0, 2, UIntPtr.Zero);
// SetForegroundWindow can report success before Windows has actually
// changed the foreground window. Only return after verifying the HWND.
SetForegroundWindow(window);
if (GetForegroundWindow() == window) return;
uint ignored;
uint current = GetCurrentThreadId();
uint foreground = GetWindowThreadProcessId(GetForegroundWindow(), out ignored);