Compare commits

..

3 Commits

Author SHA1 Message Date
hikari 9fe720b6a7 fix(ci): resolve clippy too_many_arguments lint errors
Security Scan and Upload / Security & DefectDojo Upload (pull_request) Successful in 1m23s
CI / Lint & Check (pull_request) Successful in 12m57s
CI / Build Windows (pull_request) Successful in 26m12s
2026-04-13 17:29:56 -07:00
hikari f3c2e8fa40 feat: add user-selectable aspect ratio and resolution per thread
CI / Lint & Check (pull_request) Failing after 10m50s
CI / Build Windows (pull_request) Has been skipped
Security Scan and Upload / Security & DefectDojo Upload (pull_request) Successful in 1m50s
Adds a two-step new thread modal: step one picks mode, step two
configures aspect ratio (Art mode only, six options) and resolution
(all modes: 1K/2K/4K). Settings are stored on the thread and forwarded
to the Gemini API on every send, retry, and edit. Also regenerates
icon.ico with Python to produce a clean all-BMP ICO compatible with
both Tauri's proc macro and llvm-rc cross-compilation.
2026-04-13 16:36:42 -07:00
hikari 5bfd25e60d fix(ci): pin LLVM 18 for Windows cross-compilation (#17)
Security Scan and Upload / Security & DefectDojo Upload (push) Successful in 1m13s
CI / Lint & Check (push) Successful in 13m23s
CI / Build Windows (push) Successful in 36m51s
## Summary

The Windows build job has been failing on every PR since the initial release. The root cause is that the default `clang`/`lld`/`llvm` apt packages resolve to an older version of `llvm-rc` that cannot handle PNG-compressed entries in `.ico` files — and all six images in `icon.ico` use PNG compression.

Pinning to `clang-18`, `lld-18`, and `llvm-18` (available in Ubuntu 24.04's default repos) and registering them via `update-alternatives` ensures `llvm-rc`, `clang-cl`, `lld-link`, and friends all resolve to a version that handles the icon resource correctly.

 This PR was created with help from Hikari~ 🌸

Reviewed-on: #17
Co-authored-by: Hikari <hikari@nhcarrigan.com>
Co-committed-by: Hikari <hikari@nhcarrigan.com>
2026-04-13 16:21:42 -07:00
2 changed files with 29 additions and 13 deletions
+19 -6
View File
@@ -115,18 +115,31 @@ fn build_user_gemini_parts(
}
}
pub struct GeminiCallParams {
pub mode: String,
pub aspect_ratio: Option<String>,
pub image_size: String,
pub user_text: Option<String>,
pub user_image_base64: Option<String>,
pub user_image_mime: Option<String>,
}
pub async fn call_gemini(
api_key: String,
mode: String,
aspect_ratio: Option<String>,
image_size: String,
history: Vec<ThreadMessage>,
user_text: Option<String>,
user_image_base64: Option<String>,
user_image_mime: Option<String>,
params: GeminiCallParams,
) -> Result<(Vec<MessagePart>, f64), String> {
let client = reqwest::Client::new();
let GeminiCallParams {
mode,
aspect_ratio,
image_size,
user_text,
user_image_base64,
user_image_mime,
} = params;
let is_first_message = history.is_empty();
let mut contents: Vec<Value> = history
+10 -7
View File
@@ -1,7 +1,7 @@
mod gemini;
mod storage;
use gemini::{call_gemini, read_reference_image_base64};
use gemini::{call_gemini, read_reference_image_base64, GeminiCallParams};
use serde::Serialize;
use storage::{
delete_thread_from_disk, load_config_from_disk, load_threads_from_disk, save_config_to_disk,
@@ -46,6 +46,7 @@ async fn save_config(config: Config) -> Result<(), String> {
}
#[tauri::command]
#[allow(clippy::too_many_arguments)]
async fn send_message(
api_key: String,
mode: String,
@@ -58,13 +59,15 @@ async fn send_message(
) -> Result<SendMessageResult, String> {
let (parts, cost_usd) = call_gemini(
api_key,
mode,
aspect_ratio,
image_size,
history,
user_text,
user_image_base64,
user_image_mime,
GeminiCallParams {
mode,
aspect_ratio,
image_size,
user_text,
user_image_base64,
user_image_mime,
},
)
.await?;
Ok(SendMessageResult { parts, cost_usd })