Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
28c833f
project name formatter, new util moment_format_to_chrono with test
ItsEeleeya Nov 7, 2025
19ee096
use LazyLock and lazy_static instead
ItsEeleeya Nov 8, 2025
7127d9f
Add command `format_project_name`
ItsEeleeya Nov 8, 2025
b1e4a60
Add UI + update collapsible animations with a little blur
ItsEeleeya Nov 10, 2025
c5a2878
Make the new DefaultProjectNameCard more consistent with ExcludedWind…
ItsEeleeya Nov 10, 2025
aceefc8
remove unused + sanitize using default options
ItsEeleeya Nov 10, 2025
e665245
Merge remote-tracking branch 'upstream/main' into custom-default-proj…
ItsEeleeya Nov 10, 2025
a42da8c
Add project filename migration from UUID to project name
ItsEeleeya Nov 10, 2025
f72e79a
Fix rustdoc for format_project_name
ItsEeleeya Nov 10, 2025
56996e2
Update rustdoc for format_project_name (again)
ItsEeleeya Nov 10, 2025
1cfe4a3
Merge branch 'CapSoftware:main' into custom-default-project-name
ItsEeleeya Nov 10, 2025
2ae52b8
Update to main
ItsEeleeya Nov 19, 2025
925927d
Update tauri.ts
ItsEeleeya Nov 19, 2025
eb12d2f
Remove needless borrowing
ItsEeleeya Nov 19, 2025
ffbf6b8
Measure project name migration times
ItsEeleeya Nov 19, 2025
81d395c
format
ItsEeleeya Nov 19, 2025
2f5a267
Avoid race condition (TOCTOU) is multiple files have the same pretty …
ItsEeleeya Nov 19, 2025
c147e8b
cargo fmt
ItsEeleeya Nov 19, 2025
03d737b
Use NonZero
ItsEeleeya Nov 19, 2025
0902535
don't use static ref for in_flight_bases + cleanup and update comments
ItsEeleeya Nov 19, 2025
9331f84
More tests for cap-utils
ItsEeleeya Nov 19, 2025
bd32090
Don't propagate migration error
ItsEeleeya Nov 19, 2025
897f777
use tauri::command(async) on cap_desktop::format_project_name
ItsEeleeya Nov 19, 2025
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
19 changes: 17 additions & 2 deletions Cargo.lock

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

9 changes: 8 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
[workspace]
resolver = "2"
members = ["apps/cli", "apps/desktop/src-tauri", "crates/*", "crates/workspace-hack"]
members = [
"apps/cli",
"apps/desktop/src-tauri",
"crates/*",
"crates/workspace-hack",
]

[workspace.dependencies]
anyhow = { version = "1.0.86" }
Expand All @@ -22,6 +27,7 @@ specta = { version = "=2.0.0-rc.20", features = [
"derive",
"serde_json",
"uuid",
"chrono"
] }
serde = { version = "1", features = ["derive"] }

Expand All @@ -40,6 +46,7 @@ sentry = { version = "0.42.0", features = [
] }
tracing = "0.1.41"
futures = "0.3.31"
aho-corasick = "1.1.4"

cidre = { git = "https://github.com/CapSoftware/cidre", rev = "bf84b67079a8", features = [
"macos_12_7",
Expand Down
29 changes: 16 additions & 13 deletions apps/desktop/src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ swift-rs = { version = "1.0.6", features = ["build"] }

[dependencies]
tauri = { workspace = true, features = [
"macos-private-api",
"protocol-asset",
"tray-icon",
"image-png",
"devtools",
"macos-private-api",
"protocol-asset",
"tray-icon",
"image-png",
"devtools",
] }
tauri-specta = { version = "=2.0.0-rc.20", features = ["derive", "typescript"] }
tauri-plugin-dialog = "2.2.0"
Expand Down Expand Up @@ -60,6 +60,7 @@ tracing.workspace = true
tempfile = "3.9.0"
ffmpeg.workspace = true
chrono = { version = "0.4.31", features = ["serde"] }
regex = "1.10.4"
rodio = "0.19.0"
png = "0.17.13"
device_query = "4.0.1"
Expand Down Expand Up @@ -106,22 +107,24 @@ tauri-plugin-sentry = "0.5.0"
thiserror.workspace = true
bytes = "1.10.1"
async-stream = "0.3.6"
sanitize-filename = "0.6.0"
tracing-futures = { version = "0.2.5", features = ["futures-03"] }
tracing-opentelemetry = "0.32.0"
opentelemetry = "0.31.0"
opentelemetry-otlp = "0.31.0" #{ version = , features = ["http-proto", "reqwest-client"] }
opentelemetry-otlp = "0.31.0" #{ version = , features = ["http-proto", "reqwest-client"] }
opentelemetry_sdk = { version = "0.31.0", features = ["rt-tokio", "trace"] }
posthog-rs = "0.3.7"
workspace-hack = { version = "0.1", path = "../../../crates/workspace-hack" }
aho-corasick.workspace = true


[target.'cfg(target_os = "macos")'.dependencies]
core-graphics = "0.24.0"
core-foundation = "0.10.0"
objc2-app-kit = { version = "0.3.0", features = [
"NSWindow",
"NSResponder",
"NSHapticFeedback",
"NSWindow",
"NSResponder",
"NSHapticFeedback",
] }
cocoa = "0.26.0"
objc = "0.2.7"
Expand All @@ -131,10 +134,10 @@ cidre = { workspace = true }

[target.'cfg(target_os= "windows")'.dependencies]
windows = { workspace = true, features = [
"Win32_Foundation",
"Win32_System",
"Win32_UI_WindowsAndMessaging",
"Win32_Graphics_Gdi",
"Win32_Foundation",
"Win32_System",
"Win32_UI_WindowsAndMessaging",
"Win32_Graphics_Gdi",
] }
windows-sys = { workspace = true }

Expand Down
3 changes: 3 additions & 0 deletions apps/desktop/src-tauri/src/general_settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ pub struct GeneralSettingsStore {
pub delete_instant_recordings_after_upload: bool,
#[serde(default = "default_instant_mode_max_resolution")]
pub instant_mode_max_resolution: u32,
#[serde(default)]
pub default_project_name_template: Option<String>,
}

fn default_enable_native_camera_preview() -> bool {
Expand Down Expand Up @@ -187,6 +189,7 @@ impl Default for GeneralSettingsStore {
excluded_windows: default_excluded_windows(),
delete_instant_recordings_after_upload: false,
instant_mode_max_resolution: 1920,
default_project_name_template: None,
}
}
}
Expand Down
27 changes: 26 additions & 1 deletion apps/desktop/src-tauri/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ mod recording_settings;
mod target_select_overlay;
mod thumbnails;
mod tray;
mod update_project_names;
mod upload;
mod web_api;
mod window_exclusion;
Expand Down Expand Up @@ -2298,7 +2299,8 @@ pub async fn run(recording_logging_handle: LoggingHandle, logs_dir: PathBuf) {
target_select_overlay::display_information,
target_select_overlay::get_window_icon,
target_select_overlay::focus_window,
editor_delete_project
editor_delete_project,
format_project_name,
])
.events(tauri_specta::collect_events![
RecordingOptionsChanged,
Expand Down Expand Up @@ -2442,6 +2444,11 @@ pub async fn run(recording_logging_handle: LoggingHandle, logs_dir: PathBuf) {
.invoke_handler(specta_builder.invoke_handler())
.setup(move |app| {
let app = app.handle().clone();

if let Err(err) = update_project_names::migrate_if_needed(&app) {
tracing::error!("Failed to migrate project file names: {}", err);
}

specta_builder.mount_events(&app);
hotkeys::init(&app);
general_settings::init(&app);
Expand Down Expand Up @@ -3052,6 +3059,24 @@ async fn write_clipboard_string(
.map_err(|e| format!("Failed to write text to clipboard: {e}"))
}

#[tauri::command(async)]
#[specta::specta]
fn format_project_name(
template: Option<String>,
target_name: String,
target_kind: String,
recording_mode: RecordingMode,
datetime: Option<chrono::DateTime<chrono::Local>>,
) -> String {
recording::format_project_name(
template.as_deref(),
target_name.as_str(),
target_kind.as_str(),
recording_mode,
datetime,
)
}

trait EventExt: tauri_specta::Event {
fn listen_any_spawn<Fut>(
app: &AppHandle,
Expand Down
Loading