Compare commits

..

4 Commits

Author SHA1 Message Date
hikari 0903033180 fix(ci): regenerate icon.ico with BMP-only entries
Security Scan and Upload / Security & DefectDojo Upload (pull_request) Successful in 1m23s
CI / Lint & Check (pull_request) Successful in 13m5s
CI / Build Windows (pull_request) Successful in 28m40s
All six entries in the original icon.ico used PNG compression inside
the ICO container. Older versions of llvm-rc (used during Windows
cross-compilation) cannot parse PNG-compressed ICO entries, causing
the resource compilation step to fail since PR #1.

Regenerated with ImageMagick using -compress None to force BMP format
for all sizes including 256x256. Reverts the LLVM pinning attempts
as they are no longer needed.
2026-04-13 13:15:04 -07:00
hikari ef7f74a919 fix(ci): use LLVM 18 bin path instead of update-alternatives
Security Scan and Upload / Security & DefectDojo Upload (pull_request) Successful in 2m6s
CI / Lint & Check (pull_request) Successful in 15m25s
CI / Build Windows (pull_request) Failing after 30m52s
clang-cl-18 does not have a versioned symlink in /usr/bin on this
runner, causing update-alternatives to fail and abort the step before
llvm-rc was ever configured. Prepending /usr/lib/llvm-18/bin to PATH
is more robust and ensures all LLVM 18 tools (clang-cl, lld-link,
llvm-rc) are resolved correctly without relying on symlink names.
2026-04-13 12:13:39 -07:00
hikari 42b4958c2a fix(ci): pin LLVM 18 for Windows cross-compilation
Security Scan and Upload / Security & DefectDojo Upload (pull_request) Successful in 1m18s
CI / Lint & Check (pull_request) Successful in 14m56s
CI / Build Windows (pull_request) Failing after 2m31s
Older llvm-rc versions cannot handle PNG-compressed ICO entries,
causing the Windows build to fail. Pinning to LLVM 18 and setting
up alternatives ensures llvm-rc, clang-cl, and lld-link all resolve
to a version that handles the icon resource correctly.
2026-04-13 11:50:36 -07:00
hikari 662d6119fa feat: add image input to art/avatar modes and notes to replace mode (#16)
Security Scan and Upload / Security & DefectDojo Upload (push) Successful in 1m8s
CI / Lint & Check (push) Successful in 12m40s
CI / Build Windows (push) Failing after 25m14s
## Summary

- Art and Avatar modes now support optional image uploads (paste or file picker), sent to Gemini alongside the text prompt
- Initial Replace mode gains an optional textarea for notes to include with the uploaded image
- Backend updated to send user images for all modes, appending replace instructions only when in replace mode
- Send validation updated to allow image-only messages in art and avatar modes

 This PR was created with help from Hikari~ 🌸

Reviewed-on: #16
Co-authored-by: Hikari <hikari@nhcarrigan.com>
Co-committed-by: Hikari <hikari@nhcarrigan.com>
2026-04-13 10:18:35 -07:00
5 changed files with 72 additions and 56 deletions
+1 -1
View File
@@ -14,7 +14,7 @@
"@tauri-apps/api": "2.5.0", "@tauri-apps/api": "2.5.0",
"@tauri-apps/plugin-dialog": "2.3.0", "@tauri-apps/plugin-dialog": "2.3.0",
"@tauri-apps/plugin-fs": "2.4.0", "@tauri-apps/plugin-fs": "2.4.0",
"react": "19.2.4", "react": "19.1.0",
"react-dom": "19.1.0" "react-dom": "19.1.0"
}, },
"devDependencies": { "devDependencies": {
+11 -11
View File
@@ -18,15 +18,15 @@ importers:
specifier: 2.4.0 specifier: 2.4.0
version: 2.4.0 version: 2.4.0
react: react:
specifier: 19.2.4 specifier: 19.1.0
version: 19.2.4 version: 19.1.0
react-dom: react-dom:
specifier: 19.1.0 specifier: 19.1.0
version: 19.1.0(react@19.2.4) version: 19.1.0(react@19.1.0)
devDependencies: devDependencies:
'@nhcarrigan/eslint-config': '@nhcarrigan/eslint-config':
specifier: 5.2.0 specifier: 5.2.0
version: 5.2.0(@typescript-eslint/utils@8.58.1(eslint@9.25.1(jiti@1.21.7))(typescript@5.8.3))(eslint@9.25.1(jiti@1.21.7))(playwright@1.59.1)(react@19.2.4)(typescript@5.8.3)(vitest@4.1.4(vite@6.3.2(jiti@1.21.7)(yaml@2.8.3))) version: 5.2.0(@typescript-eslint/utils@8.58.1(eslint@9.25.1(jiti@1.21.7))(typescript@5.8.3))(eslint@9.25.1(jiti@1.21.7))(playwright@1.59.1)(react@19.1.0)(typescript@5.8.3)(vitest@4.1.4(vite@6.3.2(jiti@1.21.7)(yaml@2.8.3)))
'@nhcarrigan/typescript-config': '@nhcarrigan/typescript-config':
specifier: 4.0.0 specifier: 4.0.0
version: 4.0.0(typescript@5.8.3) version: 4.0.0(typescript@5.8.3)
@@ -1960,8 +1960,8 @@ packages:
resolution: {integrity: sha512-z6F7K9bV85EfseRCp2bzrpyQ0Gkw1uLoCel9XBVWPg/TjRj94SkJzUTGfOa4bs7iJvBWtQG0Wq7wnI0syw3EBQ==} resolution: {integrity: sha512-z6F7K9bV85EfseRCp2bzrpyQ0Gkw1uLoCel9XBVWPg/TjRj94SkJzUTGfOa4bs7iJvBWtQG0Wq7wnI0syw3EBQ==}
engines: {node: '>=0.10.0'} engines: {node: '>=0.10.0'}
react@19.2.4: react@19.1.0:
resolution: {integrity: sha512-9nfp2hYpCwOjAN+8TZFGhtWEwgvWHXqESH8qT89AT/lWklpLON22Lc8pEtnpsZz7VmawabSU0gCjnj8aC0euHQ==} resolution: {integrity: sha512-FS+XFBNvn3GTAWq26joslQgWNoFu08F4kl0J4CgdNKADkdSGXQyTCnKteIAJy96Br6YbpEU1LSzV5dYtjMkMDg==}
engines: {node: '>=0.10.0'} engines: {node: '>=0.10.0'}
read-cache@1.0.0: read-cache@1.0.0:
@@ -2707,7 +2707,7 @@ snapshots:
'@jridgewell/resolve-uri': 3.1.2 '@jridgewell/resolve-uri': 3.1.2
'@jridgewell/sourcemap-codec': 1.5.5 '@jridgewell/sourcemap-codec': 1.5.5
'@nhcarrigan/eslint-config@5.2.0(@typescript-eslint/utils@8.58.1(eslint@9.25.1(jiti@1.21.7))(typescript@5.8.3))(eslint@9.25.1(jiti@1.21.7))(playwright@1.59.1)(react@19.2.4)(typescript@5.8.3)(vitest@4.1.4(vite@6.3.2(jiti@1.21.7)(yaml@2.8.3)))': '@nhcarrigan/eslint-config@5.2.0(@typescript-eslint/utils@8.58.1(eslint@9.25.1(jiti@1.21.7))(typescript@5.8.3))(eslint@9.25.1(jiti@1.21.7))(playwright@1.59.1)(react@19.1.0)(typescript@5.8.3)(vitest@4.1.4(vite@6.3.2(jiti@1.21.7)(yaml@2.8.3)))':
dependencies: dependencies:
'@eslint-community/eslint-plugin-eslint-comments': 4.4.1(eslint@9.25.1(jiti@1.21.7)) '@eslint-community/eslint-plugin-eslint-comments': 4.4.1(eslint@9.25.1(jiti@1.21.7))
'@eslint/compat': 1.2.4(eslint@9.25.1(jiti@1.21.7)) '@eslint/compat': 1.2.4(eslint@9.25.1(jiti@1.21.7))
@@ -2727,7 +2727,7 @@ snapshots:
eslint-plugin-unicorn: 56.0.1(eslint@9.25.1(jiti@1.21.7)) eslint-plugin-unicorn: 56.0.1(eslint@9.25.1(jiti@1.21.7))
globals: 15.14.0 globals: 15.14.0
playwright: 1.59.1 playwright: 1.59.1
react: 19.2.4 react: 19.1.0
typescript: 5.8.3 typescript: 5.8.3
vitest: 4.1.4(vite@6.3.2(jiti@1.21.7)(yaml@2.8.3)) vitest: 4.1.4(vite@6.3.2(jiti@1.21.7)(yaml@2.8.3))
transitivePeerDependencies: transitivePeerDependencies:
@@ -4435,16 +4435,16 @@ snapshots:
queue-microtask@1.2.3: {} queue-microtask@1.2.3: {}
react-dom@19.1.0(react@19.2.4): react-dom@19.1.0(react@19.1.0):
dependencies: dependencies:
react: 19.2.4 react: 19.1.0
scheduler: 0.26.0 scheduler: 0.26.0
react-is@16.13.1: {} react-is@16.13.1: {}
react-refresh@0.17.0: {} react-refresh@0.17.0: {}
react@19.2.4: {} react@19.1.0: {}
read-cache@1.0.0: read-cache@1.0.0:
dependencies: dependencies:
Binary file not shown.

Before

Width:  |  Height:  |  Size: 155 KiB

After

Width:  |  Height:  |  Size: 364 KiB

+14 -10
View File
@@ -83,22 +83,26 @@ fn build_user_gemini_parts(
user_image_base64: &Option<String>, user_image_base64: &Option<String>,
user_image_mime: &Option<String>, user_image_mime: &Option<String>,
) -> Vec<Value> { ) -> Vec<Value> {
if mode == "replace" && user_image_base64.is_some() { if let Some(image_data) = user_image_base64.as_deref() {
let mime = user_image_mime.as_deref().unwrap_or("image/png"); let mime = user_image_mime.as_deref().unwrap_or("image/png");
let data = user_image_base64.as_deref().unwrap_or("");
let base_text = user_text.as_deref().unwrap_or(""); let base_text = user_text.as_deref().unwrap_or("");
let final_text = if base_text.is_empty() { let final_text = if mode == "replace" {
REPLACE_MODE_APPEND.to_string() if base_text.is_empty() {
REPLACE_MODE_APPEND.to_string()
} else {
format!("{}\n{}", base_text, REPLACE_MODE_APPEND)
}
} else { } else {
format!("{}\n{}", base_text, REPLACE_MODE_APPEND) base_text.to_string()
}; };
vec![ let mut parts = vec![json!({"inlineData": {"mimeType": mime, "data": image_data}})];
json!({"inlineData": {"mimeType": mime, "data": data}}), if !final_text.is_empty() {
json!({"text": final_text}), parts.push(json!({"text": final_text}));
] }
parts
} else { } else {
// Art/avatar mode, or replace mode follow-up correction (text only) // No image: text-only message
let text = user_text.as_deref().unwrap_or(""); let text = user_text.as_deref().unwrap_or("");
vec![json!({"text": text})] vec![json!({"text": text})]
} }
+46 -34
View File
@@ -256,7 +256,8 @@ const inputArea = ({
if (isInitialReplace && imageBase64 === undefined) { if (isInitialReplace && imageBase64 === undefined) {
return; return;
} }
if (!isInitialReplace && text.trim().length === 0) { const hasContent = text.trim().length > 0 || imageBase64 !== undefined;
if (!isInitialReplace && !hasContent) {
return; return;
} }
@@ -332,6 +333,9 @@ const inputArea = ({
: dropZoneInactiveClass, : dropZoneInactiveClass,
].join(" "); ].join(" ");
const hasNoContent = text.trim().length === 0 && imageBase64 === undefined;
const isSendDisabled = isLoading || hasNoContent;
return ( return (
<div className="border-t border-purple-900/30 p-4 bg-[#0f0a1a]"> <div className="border-t border-purple-900/30 p-4 bg-[#0f0a1a]">
<div className="flex items-center gap-2 mb-2"> <div className="flex items-center gap-2 mb-2">
@@ -397,6 +401,15 @@ const inputArea = ({
type="file" type="file"
/> />
<textarea
className={textareaClass}
disabled={isLoading}
onChange={handleTextChange}
placeholder="Add notes to include with the image (optional)..."
rows={2}
value={text}
/>
<button <button
className={replaceButtonClass} className={replaceButtonClass}
disabled={isLoading || imageBase64 === undefined} disabled={isLoading || imageBase64 === undefined}
@@ -414,41 +427,40 @@ const inputArea = ({
</div> </div>
: <div className="flex flex-col gap-3"> : <div className="flex flex-col gap-3">
{mode === "replace" <div className="flex flex-col gap-2">
? <div className="flex flex-col gap-2"> {imagePreview === undefined
{imagePreview === undefined ? <button
? <button className={pasteButtonClass}
className={pasteButtonClass} onClick={handlePasteButtonClick}
onClick={handlePasteButtonClick} type="button"
>
{mode === "replace"
? "📋 Paste replacement image (optional)"
: "📋 Paste image (optional)"}
</button>
: <div className="relative inline-block">
<img
alt="Upload preview"
className="max-h-32 rounded-lg border border-purple-700/40"
src={imagePreview}
/>
<button
className={clearButtonClass}
onClick={clearImage}
type="button" type="button"
> >
{"📋 Paste replacement image (optional)"} {"×"}
</button> </button>
</div>}
: <div className="relative inline-block"> <input
<img accept="image/*"
alt="Upload preview" className="hidden"
className="max-h-32 rounded-lg border border-purple-700/40" onChange={handleFileChange}
src={imagePreview} ref={fileInputReference}
/> type="file"
<button />
className={clearButtonClass} </div>
onClick={clearImage}
type="button"
>
{"×"}
</button>
</div>}
<input
accept="image/*"
className="hidden"
onChange={handleFileChange}
ref={fileInputReference}
type="file"
/>
</div>
: null}
<div className="flex gap-3 items-end"> <div className="flex gap-3 items-end">
<textarea <textarea
@@ -464,7 +476,7 @@ const inputArea = ({
/> />
<button <button
className={sendButtonClass} className={sendButtonClass}
disabled={isLoading || text.trim().length === 0} disabled={isSendDisabled}
onClick={handleSend} onClick={handleSend}
type="button" type="button"
> >