Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,6 @@ blob-report/

.direnv
.envrc

# Gumroad
gumroad-delivery.txt
2 changes: 1 addition & 1 deletion src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions src-tauri/resources/tray_idle.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 9 additions & 7 deletions src-tauri/src/obsidian_export.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ pub fn export_to_obsidian(
let export_dir = PathBuf::from(&vault_path).join(subfolder);

if let Err(e) = fs::create_dir_all(&export_dir) {
error!("Failed to create Obsidian export directory {:?}: {}", export_dir, e);
error!(
"Failed to create Obsidian export directory {:?}: {}",
export_dir, e
);
return;
}

Expand Down Expand Up @@ -84,15 +87,14 @@ pub fn export_to_obsidian(

/// Build a short title from the transcription text
fn build_title(text: &str) -> String {
let cleaned: String = text
.chars()
.take(60)
.take_while(|c| *c != '\n')
.collect();
let cleaned: String = text.chars().take(60).take_while(|c| *c != '\n').collect();

let trimmed = cleaned.trim();
if trimmed.len() < text.len() {
format!("{}...", trimmed.trim_end_matches(|c: char| c.is_whitespace() || c == '.'))
format!(
"{}...",
trimmed.trim_end_matches(|c: char| c.is_whitespace() || c == '.')
)
} else {
trimmed.to_string()
}
Expand Down
10 changes: 2 additions & 8 deletions src-tauri/src/shortcut/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1068,10 +1068,7 @@ pub fn change_show_tray_icon_setting(app: AppHandle, enabled: bool) -> Result<()

#[tauri::command]
#[specta::specta]
pub fn change_obsidian_export_enabled_setting(
app: AppHandle,
enabled: bool,
) -> Result<(), String> {
pub fn change_obsidian_export_enabled_setting(app: AppHandle, enabled: bool) -> Result<(), String> {
let mut settings = settings::get_settings(&app);
settings.obsidian_export_enabled = enabled;
settings::write_settings(&app, settings);
Expand All @@ -1080,10 +1077,7 @@ pub fn change_obsidian_export_enabled_setting(

#[tauri::command]
#[specta::specta]
pub fn change_obsidian_vault_path_setting(
app: AppHandle,
path: String,
) -> Result<(), String> {
pub fn change_obsidian_vault_path_setting(app: AppHandle, path: String) -> Result<(), String> {
let mut settings = settings::get_settings(&app);
settings.obsidian_vault_path = if path.is_empty() { None } else { Some(path) };
settings::write_settings(&app, settings);
Expand Down
11 changes: 3 additions & 8 deletions src-tauri/src/tray.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,14 +172,9 @@ pub fn update_tray_menu(app: &AppHandle, state: &TrayIconState, locale: Option<&
format!("{} ({})", strings.start_dictation, binding_str)
}
};
let start_dictation_i = MenuItem::with_id(
app,
"start_dictation",
&shortcut_label,
true,
None::<&str>,
)
.expect("failed to create start dictation item");
let start_dictation_i =
MenuItem::with_id(app, "start_dictation", &shortcut_label, true, None::<&str>)
.expect("failed to create start dictation item");

Menu::with_items(
app,
Expand Down
Loading