Skip to content

Commit 490344e

Browse files
authored
Redering fixes (#378)
* start time, standardise on cidre, fix decoder skipping * more * ignore start time for now * cleanup
1 parent 6f7b927 commit 490344e

File tree

23 files changed

+391
-332
lines changed

23 files changed

+391
-332
lines changed

Cargo.lock

Lines changed: 29 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/cli/src/main.rs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ use clap::{Args, Parser, Subcommand};
1010
use record::RecordStart;
1111
use serde_json::json;
1212
use tracing::*;
13+
use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt};
1314

1415
#[derive(Parser)]
1516
struct Cli {
@@ -49,6 +50,21 @@ enum RecordCommands {
4950

5051
#[tokio::main]
5152
async fn main() -> Result<(), String> {
53+
// let (layer, handle) = tracing_subscriber::reload::Layer::new(None::<DynLoggingLayer>);
54+
55+
let registry = tracing_subscriber::registry().with(tracing_subscriber::filter::filter_fn(
56+
(|v| v.target().starts_with("cap_")) as fn(&tracing::Metadata) -> bool,
57+
));
58+
59+
registry
60+
// .with(layer)
61+
.with(
62+
tracing_subscriber::fmt::layer()
63+
.with_ansi(true)
64+
.with_target(true),
65+
)
66+
.init();
67+
5268
let cli = Cli::parse();
5369

5470
match cli.command {
@@ -177,7 +193,7 @@ impl Export {
177193
recording_meta,
178194
render_constants,
179195
&segments,
180-
fps,
196+
60,
181197
XY::new(1920, 1080),
182198
)
183199
.await

apps/desktop/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
"@tauri-apps/plugin-fs": "2.2.0",
4242
"@tauri-apps/plugin-http": "^2.0.1",
4343
"@tauri-apps/plugin-notification": "2.0.0",
44+
"@tauri-apps/plugin-opener": "^2.2.6",
4445
"@tauri-apps/plugin-os": "2.0.0",
4546
"@tauri-apps/plugin-process": "2.0.0",
4647
"@tauri-apps/plugin-shell": ">=2.0.1",

apps/desktop/src-tauri/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ relative-path = "1.9.3"
8989
cap-fail = { version = "0.1.0", path = "../../../crates/fail" }
9090
tokio-stream = { version = "0.1.17", features = ["sync"] }
9191
md5 = "0.7.0"
92+
tauri-plugin-opener = "2.2.6"
9293

9394
[target.'cfg(target_os = "macos")'.dependencies]
9495
core-graphics = "0.24.0"

apps/desktop/src-tauri/capabilities/default.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
{ "url": "http://localhost:*" }
6161
]
6262
},
63-
"clipboard-manager:allow-write-text"
63+
"clipboard-manager:allow-write-text",
64+
"opener:allow-reveal-item-in-dir"
6465
]
6566
}

apps/desktop/src-tauri/src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1453,12 +1453,13 @@ async fn take_screenshot(app: AppHandle, _state: MutableState<'_, App>) -> Resul
14531453
pretty_name: screenshot_name,
14541454
inner: RecordingMetaInner::Studio(cap_project::StudioRecordingMeta::SingleSegment {
14551455
segment: cap_project::SingleSegment {
1456-
display: Display {
1456+
display: VideoMeta {
14571457
path: RelativePathBuf::from_path(
14581458
&screenshot_path.strip_prefix(&recording_dir).unwrap(),
14591459
)
14601460
.unwrap(),
14611461
fps: 0,
1462+
start_time: None,
14621463
},
14631464
camera: None,
14641465
audio: None,
@@ -2159,6 +2160,7 @@ pub async fn run(recording_logging_handle: LoggingHandle) {
21592160
.plugin(tauri_plugin_deep_link::init())
21602161
.plugin(tauri_plugin_clipboard_manager::init())
21612162
.plugin(tauri_plugin_fs::init())
2163+
.plugin(tauri_plugin_opener::init())
21622164
.plugin(
21632165
tauri_plugin_window_state::Builder::new()
21642166
.with_state_flags({

apps/desktop/src/routes/(window-chrome)/settings/recordings.tsx

Lines changed: 48 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@ import {
1616
ParentProps,
1717
Show,
1818
} from "solid-js";
19+
import { revealItemInDir } from "@tauri-apps/plugin-opener";
1920

2021
import { ask } from "@tauri-apps/plugin-dialog";
21-
import { open } from "@tauri-apps/plugin-shell";
22+
import * as shell from "@tauri-apps/plugin-shell";
2223
import { trackEvent } from "~/utils/analytics";
2324
import { commands, events, RecordingMetaWithType } from "~/utils/tauri";
2425

@@ -117,7 +118,9 @@ export default function Recordings() {
117118
<Show
118119
when={recordings.data && recordings.data.length > 0}
119120
fallback={
120-
<p class="text-center text-[--text-tertiary] absolute flex items-center justify-center w-full h-full">No recordings found</p>
121+
<p class="text-center text-[--text-tertiary] absolute flex items-center justify-center w-full h-full">
122+
No recordings found
123+
</p>
121124
}
122125
>
123126
<div class="p-4 border-b border-gray-300 border-dashed">
@@ -176,21 +179,6 @@ function RecordingItem(props: {
176179

177180
const queryClient = useQueryClient();
178181

179-
const deleteButton = () => (
180-
<TooltipIconButton
181-
tooltipText="Delete"
182-
onClick={async () => {
183-
if (!(await ask("Are you sure you want to delete this recording?")))
184-
return;
185-
await remove(props.recording.path, { recursive: true });
186-
187-
queryClient.refetchQueries(recordingsQuery);
188-
}}
189-
>
190-
<IconCapTrash class="size-4" />
191-
</TooltipIconButton>
192-
);
193-
194182
return (
195183
<li class="flex flex-row justify-between items-center px-4 py-3 w-full rounded-xl transition-colors duration-200 hover:bg-gray-100">
196184
<div class="flex gap-5 items-center">
@@ -225,7 +213,7 @@ function RecordingItem(props: {
225213
</div>
226214
</div>
227215
</div>
228-
<div class="flex items-center">
216+
<div class="flex items-center gap-2">
229217
<Show when={type() === "studio"}>
230218
<TooltipIconButton
231219
tooltipText="Edit"
@@ -243,13 +231,12 @@ function RecordingItem(props: {
243231
{(sharing) => (
244232
<TooltipIconButton
245233
tooltipText="Open link"
246-
onClick={() => open(sharing().link)}
234+
onClick={() => shell.open(sharing().link)}
247235
>
248236
<IconCapLink class="size-4" />
249237
</TooltipIconButton>
250238
)}
251239
</Show>
252-
{deleteButton()}
253240
</Show>
254241
<Show when={type() === "instant"}>
255242
{(_) => {
@@ -260,34 +247,49 @@ function RecordingItem(props: {
260247
}));
261248

262249
return (
263-
<>
264-
<Show when={props.recording.meta.sharing}>
265-
{(sharing) => (
266-
<>
267-
<TooltipIconButton
268-
tooltipText="Reupload"
269-
onClick={() => reupload.mutate()}
270-
>
271-
{reupload.isPending ? (
272-
<IconLucideLoaderCircle class="animate-spin" />
273-
) : (
274-
<IconLucideRotateCcw class="size-4" />
275-
)}
276-
</TooltipIconButton>
277-
<TooltipIconButton
278-
tooltipText="Open link"
279-
onClick={() => open(sharing().link)}
280-
>
281-
<IconCapLink class="size-4" />
282-
</TooltipIconButton>
283-
</>
284-
)}
285-
</Show>
286-
{deleteButton()}
287-
</>
250+
<Show when={props.recording.meta.sharing}>
251+
{(sharing) => (
252+
<>
253+
<TooltipIconButton
254+
tooltipText="Reupload"
255+
onClick={() => reupload.mutate()}
256+
>
257+
{reupload.isPending ? (
258+
<IconLucideLoaderCircle class="animate-spin" />
259+
) : (
260+
<IconLucideRotateCcw class="size-4" />
261+
)}
262+
</TooltipIconButton>
263+
<TooltipIconButton
264+
tooltipText="Open link"
265+
onClick={() => shell.open(sharing().link)}
266+
>
267+
<IconCapLink class="size-4" />
268+
</TooltipIconButton>
269+
</>
270+
)}
271+
</Show>
288272
);
289273
}}
290274
</Show>
275+
<TooltipIconButton
276+
tooltipText="Open recording bundle"
277+
onClick={() => revealItemInDir(`${props.recording.path}/`)}
278+
>
279+
<IconLucideFolder class="size-4" />
280+
</TooltipIconButton>
281+
<TooltipIconButton
282+
tooltipText="Delete"
283+
onClick={async () => {
284+
if (!(await ask("Are you sure you want to delete this recording?")))
285+
return;
286+
await remove(props.recording.path, { recursive: true });
287+
288+
queryClient.refetchQueries(recordingsQuery);
289+
}}
290+
>
291+
<IconCapTrash class="size-4" />
292+
</TooltipIconButton>
291293
</div>
292294
</li>
293295
);
@@ -308,7 +310,7 @@ function TooltipIconButton(
308310
props.onClick();
309311
}}
310312
disabled={props.disabled}
311-
class="p-2.5 mr-2 opacity-70 will-change-transform hover:opacity-100 rounded-full transition-all duration-200 hover:bg-gray-200 dark:hover:bg-gray-300"
313+
class="p-2.5 opacity-70 will-change-transform hover:opacity-100 rounded-full transition-all duration-200 hover:bg-gray-200 dark:hover:bg-gray-300"
312314
>
313315
{props.children}
314316
</Tooltip.Trigger>

0 commit comments

Comments
 (0)