diff --git a/packages/kbot/dist/win-64/tauri-app.exe b/packages/kbot/dist/win-64/tauri-app.exe index 568db815..882e382a 100644 Binary files a/packages/kbot/dist/win-64/tauri-app.exe and b/packages/kbot/dist/win-64/tauri-app.exe differ diff --git a/packages/kbot/generated_gen_1.png b/packages/kbot/generated_gen_1.png new file mode 100644 index 00000000..aaabd310 Binary files /dev/null and b/packages/kbot/generated_gen_1.png differ diff --git a/packages/kbot/generated_gen_2.png b/packages/kbot/generated_gen_2.png new file mode 100644 index 00000000..616495f1 Binary files /dev/null and b/packages/kbot/generated_gen_2.png differ diff --git a/packages/kbot/generated_gen_3.png b/packages/kbot/generated_gen_3.png new file mode 100644 index 00000000..41002fd3 Binary files /dev/null and b/packages/kbot/generated_gen_3.png differ diff --git a/packages/kbot/generated_gen_4.png b/packages/kbot/generated_gen_4.png new file mode 100644 index 00000000..1db554dd Binary files /dev/null and b/packages/kbot/generated_gen_4.png differ diff --git a/packages/kbot/generated_gen_5.png b/packages/kbot/generated_gen_5.png new file mode 100644 index 00000000..5a57af82 Binary files /dev/null and b/packages/kbot/generated_gen_5.png differ diff --git a/packages/kbot/generated_gen_6.png b/packages/kbot/generated_gen_6.png new file mode 100644 index 00000000..81e46a11 Binary files /dev/null and b/packages/kbot/generated_gen_6.png differ diff --git a/packages/kbot/generated_gen_7.png b/packages/kbot/generated_gen_7.png new file mode 100644 index 00000000..65e0ba85 Binary files /dev/null and b/packages/kbot/generated_gen_7.png differ diff --git a/packages/kbot/gui/tauri-app/src-tauri/capabilities/base.json b/packages/kbot/gui/tauri-app/src-tauri/capabilities/base.json index 6192d872..42534c5b 100644 --- a/packages/kbot/gui/tauri-app/src-tauri/capabilities/base.json +++ b/packages/kbot/gui/tauri-app/src-tauri/capabilities/base.json @@ -14,6 +14,20 @@ }, "core:default", "fs:default", + "fs:allow-write-text-file", + "fs:allow-read-text-file", + "fs:allow-create", + "fs:allow-mkdir", + "fs:allow-exists", + "fs:allow-write", + "fs:allow-read", + { + "identifier": "fs:scope-appdata-recursive", + "allow": [ + { "path": "$APPDATA/" }, + { "path": "$APPDATA/**" } + ] + }, "core:window:allow-minimize", "core:window:allow-maximize", "core:window:allow-unmaximize", diff --git a/packages/kbot/gui/tauri-app/src/App.tsx b/packages/kbot/gui/tauri-app/src/App.tsx index 82e0cfbc..5005ddb9 100644 --- a/packages/kbot/gui/tauri-app/src/App.tsx +++ b/packages/kbot/gui/tauri-app/src/App.tsx @@ -3,6 +3,7 @@ import { ImageFile, PromptTemplate } from "./types"; import { useTauriListeners } from "./hooks/useTauriListeners"; import { tauriApi } from "./lib/tauriApi"; import { saveStore } from "./lib/init"; +import { QUICK_STYLES, QUICK_ACTIONS } from "./constants"; import log from "./lib/log"; import Header from "./components/Header"; import PromptForm from "./components/PromptForm"; @@ -44,6 +45,38 @@ function App() { const [prompts, setPrompts] = useState([]); + const appendStyle = (style: string) => { + setPrompt(prev => { + const trimmed = prev.trim(); + if (trimmed) { + return `${trimmed}, ${style}`; + } else { + return style; + } + }); + log.info(`🎨 Style applied: ${style}`); + }; + + const executeQuickAction = async (action: { name: string; prompt: string; icon: string }) => { + // Find the last non-generated image to use as input + const inputImages = files.filter(f => !f.isGenerated); + if (inputImages.length === 0) { + log.warn('No input images available for quick action'); + return; + } + + const lastImage = inputImages[inputImages.length - 1]; + + // Select the last image + handleImageSelection(lastImage.path, false); + + // Set the action prompt + setPrompt(action.prompt); + + // Generate with the selected image + log.info(`🚀 Executing quick action: ${action.name}`); + await generateImage(action.prompt, [lastImage]); + }; const importPrompts = async () => { try { @@ -581,6 +614,10 @@ function App() { savePrompts={savePrompts} importPrompts={importPrompts} exportPrompts={exportPrompts} + quickStyles={QUICK_STYLES} + appendStyle={appendStyle} + quickActions={QUICK_ACTIONS} + executeQuickAction={executeQuickAction} /> {/* Debug Panel */} diff --git a/packages/kbot/gui/tauri-app/src/components/PromptForm.tsx b/packages/kbot/gui/tauri-app/src/components/PromptForm.tsx index 1fe2e7af..d347592f 100644 --- a/packages/kbot/gui/tauri-app/src/components/PromptForm.tsx +++ b/packages/kbot/gui/tauri-app/src/components/PromptForm.tsx @@ -1,5 +1,6 @@ import React from 'react'; import { ImageFile, PromptTemplate } from '../types'; +import { QUICK_ACTIONS } from '../constants'; import ImageGallery from './ImageGallery'; import { useDropZone } from '../hooks/useDropZone'; import PromptManager from './PromptManager'; @@ -30,6 +31,10 @@ interface PromptFormProps { savePrompts: (prompts: PromptTemplate[]) => void; importPrompts: () => void; exportPrompts: () => void; + quickStyles: readonly string[]; + appendStyle: (style: string) => void; + quickActions: typeof QUICK_ACTIONS; + executeQuickAction: (action: { name: string; prompt: string; icon: string }) => Promise; } const PromptForm: React.FC = ({ @@ -58,6 +63,10 @@ const PromptForm: React.FC = ({ savePrompts, importPrompts, exportPrompts, + quickStyles, + appendStyle, + quickActions, + executeQuickAction, }) => { const selectedCount = getSelectedImages().length; const { ref: dropZoneRef, dragIn } = useDropZone({ onDrop: addFiles }); @@ -89,6 +98,71 @@ const PromptForm: React.FC = ({ } }} /> + + {/* Quick Style Picker */} +
+
+ Quick styles: + {quickStyles.map((style) => ( + + ))} +
+
+ + {/* Quick Actions */} +
+
+ Quick actions: + {quickActions.map((action) => { + const hasInputImages = files.filter(f => !f.isGenerated).length > 0; + return ( + + ); + })} +
+
+ + {/* Generate Button */} +
+ +
= ({ )}
- - {files.some(file => file.path.startsWith('generated_')) && (