Compare commits

..

1 Commits

Author SHA1 Message Date
hikari 05af2d3695 feat: add user-selectable aspect ratio and resolution per thread
Security Scan and Upload / Security & DefectDojo Upload (pull_request) Successful in 1m25s
CI / Lint & Check (pull_request) Failing after 8m33s
CI / Build Windows (pull_request) Has been skipped
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:29:09 -07:00
2 changed files with 13 additions and 29 deletions
+6 -19
View File
@@ -115,31 +115,18 @@ 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>,
params: GeminiCallParams,
user_text: Option<String>,
user_image_base64: Option<String>,
user_image_mime: Option<String>,
) -> 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
+7 -10
View File
@@ -1,7 +1,7 @@
mod gemini;
mod storage;
use gemini::{call_gemini, read_reference_image_base64, GeminiCallParams};
use gemini::{call_gemini, read_reference_image_base64};
use serde::Serialize;
use storage::{
delete_thread_from_disk, load_config_from_disk, load_threads_from_disk, save_config_to_disk,
@@ -46,7 +46,6 @@ async fn save_config(config: Config) -> Result<(), String> {
}
#[tauri::command]
#[allow(clippy::too_many_arguments)]
async fn send_message(
api_key: String,
mode: String,
@@ -59,15 +58,13 @@ async fn send_message(
) -> Result<SendMessageResult, String> {
let (parts, cost_usd) = call_gemini(
api_key,
mode,
aspect_ratio,
image_size,
history,
GeminiCallParams {
mode,
aspect_ratio,
image_size,
user_text,
user_image_base64,
user_image_mime,
},
user_text,
user_image_base64,
user_image_mime,
)
.await?;
Ok(SendMessageResult { parts, cost_usd })