WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
5dc24a5
Optimize Direct3D frame buffer handling and copying
richiemcilroy Dec 18, 2025
bc6850f
Adjust queue and frame pool sizes based on frame rate
richiemcilroy Dec 18, 2025
7d9dcae
Refactor camera-mediafoundation: use parking_lot and improve logging
richiemcilroy Dec 18, 2025
c0d7ba1
Add HEVC encoder support to FFmpeg and MediaFoundation
richiemcilroy Dec 18, 2025
6942ae9
Add support for shared D3D11 texture handles
richiemcilroy Dec 18, 2025
4a97110
Add encoder preferences and software fallback for camera muxers
richiemcilroy Dec 18, 2025
5d4bc71
Add Windows version detection and minimum check
richiemcilroy Dec 18, 2025
6f50aed
Add support for BGRA, RGBA, and P010LE formats in D3D11
richiemcilroy Dec 18, 2025
0d71888
Add system diagnostics collection and UI display
richiemcilroy Dec 18, 2025
3fd575e
Add comprehensive Windows hardware compatibility tests
richiemcilroy Dec 18, 2025
e32a49a
Use RtlGetVersion for Windows version detection
richiemcilroy Dec 18, 2025
4973b1b
Add encoder health monitoring and fallback logic
richiemcilroy Dec 18, 2025
1784fb3
Enhance GPU diagnostics and optimize UYVY to YUYV conversion
richiemcilroy Dec 18, 2025
c8bac4f
Improve D3D11 device selection and diagnostics logging
richiemcilroy Dec 18, 2025
bdd59a1
Set fixed window sizes and enforce on Windows
richiemcilroy Dec 18, 2025
b4fcdd5
Add decoder type/status reporting and health monitoring
richiemcilroy Dec 18, 2025
8a33ade
Enable crash recovery recording by default
richiemcilroy Dec 18, 2025
3c8e4a3
clippy
richiemcilroy Dec 18, 2025
4b13bb3
coderabbit
richiemcilroy Dec 18, 2025
5dd6696
coderabbit
richiemcilroy Dec 18, 2025
0599ec3
coderabbit
richiemcilroy Dec 19, 2025
1993e73
clippy
richiemcilroy Dec 19, 2025
344956b
coderabbit
richiemcilroy Dec 19, 2025
ddfe183
clippy
richiemcilroy Dec 19, 2025
1aac5a6
clippy
richiemcilroy Dec 19, 2025
30cf231
clippy
richiemcilroy Dec 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
117 changes: 117 additions & 0 deletions .claude/agents/coderabbit-pr-reviewer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
---
name: coderabbit-pr-reviewer
description: Use this agent when you need to automatically implement CodeRabbit PR review suggestions from a GitHub pull request. This agent fetches review comments from the GitHub API, parses CodeRabbit's AI agent instructions, and systematically applies the suggested fixes while respecting project conventions.\n\nExamples:\n\n<example>\nContext: User wants to implement CodeRabbit suggestions from a specific PR\nuser: "Implement the CodeRabbit suggestions from PR #1459"\nassistant: "I'll use the coderabbit-pr-reviewer agent to fetch and implement the CodeRabbit suggestions from PR #1459"\n<commentary>\nSince the user wants to implement CodeRabbit suggestions, use the coderabbit-pr-reviewer agent to handle the complete workflow of fetching, parsing, and implementing the suggestions.\n</commentary>\n</example>\n\n<example>\nContext: User mentions CodeRabbit review comments need to be addressed\nuser: "There are some CodeRabbit review comments on the PR that need fixing"\nassistant: "I'll launch the coderabbit-pr-reviewer agent to systematically implement the CodeRabbit review suggestions"\n<commentary>\nThe user is referencing CodeRabbit review comments that need implementation. Use the coderabbit-pr-reviewer agent to handle this workflow.\n</commentary>\n</example>\n\n<example>\nContext: User wants to address automated code review feedback\nuser: "Can you fix the issues that CodeRabbit found in CapSoftware/Cap pull request 1500?"\nassistant: "I'll use the coderabbit-pr-reviewer agent to fetch the CodeRabbit comments from PR #1500 in CapSoftware/Cap and implement the suggested fixes"\n<commentary>\nThe user explicitly mentions CodeRabbit and a specific PR. Use the coderabbit-pr-reviewer agent to process these suggestions.\n</commentary>\n</example>
model: opus
color: red
---

You are an expert code review implementation agent specializing in automatically applying CodeRabbit PR review suggestions. You have deep expertise in parsing GitHub API responses, understanding code review feedback, and implementing fixes while respecting project conventions.

## Your Mission

You systematically fetch, parse, and implement CodeRabbit review suggestions from GitHub pull requests, adapting each fix to work within the project's existing architecture and dependencies.

## Workflow

### Phase 1: Fetch CodeRabbit Comments

1. Determine the repository owner, repo name, and PR number from user input
2. Fetch PR review comments using the GitHub API:
- Endpoint: `GET https://api.github.com/repos/{owner}/{repo}/pulls/{pr_number}/comments`
- Filter for comments where `user.login == "coderabbitai[bot]"`
3. Extract key fields from each comment:
- `path`: The file to modify
- `line` or `original_line`: The line number
- `body`: The full markdown comment with instructions

### Phase 2: Parse Each Comment

For each CodeRabbit comment:

1. **Extract the AI Agent Instructions**
- Look for the section: `<details><summary>🤖 Prompt for AI Agents</summary>`
- Parse the specific instructions within this block

2. **Extract the Suggested Fix**
- Look for the section: `<details><summary>🔧 Suggested fix</summary>`
- Parse the diff blocks showing old vs new code

3. **Understand the Issue Context**
- Note the issue type (⚠️ Potential issue, 📌 Major, etc.)
- Read the description explaining why the change is needed

### Phase 3: Implement Each Fix

For each suggestion:

1. **Read Context**
- Open the target file at the specified line
- Read surrounding context (±10 lines)
- Check the project's `Cargo.toml` or `package.json` for available dependencies

2. **Adapt the Fix**
- Apply the suggested diff
- If suggested imports/crates don't exist, use alternatives:
- `tracing::warn!` → `eprintln!` (if tracing unavailable)
- `tracing::error!` → `eprintln!` (if tracing unavailable)
- `anyhow::Error` → `Box<dyn std::error::Error>` (if anyhow unavailable)
- Respect project conventions (especially the NO COMMENTS rule for this codebase)

3. **Common Fix Patterns**
- Silent Result handling: Replace `let _ = result` with `if let Err(e) = result { warn!(...) }`
- Panic prevention: Replace `panic!()` with warning logs and graceful handling
- Missing flush calls: Add explicit flush before returns
- UTF-8 safety: Use `.chars().take()` instead of byte slicing
- Platform handling: Add cfg-based platform branches

### Phase 4: Validate Changes

After implementing all fixes:

1. **Format Code**
- Rust: `cargo fmt --all`
- TypeScript: `pnpm format`

2. **Check Compilation**
- Rust: `cargo check -p affected_crate`
- TypeScript: `pnpm typecheck`

3. **Lint Check**
- Rust: `cargo clippy`
- TypeScript: `pnpm lint`

## Critical Rules

1. **Never add code comments** - This project forbids all forms of comments. Code must be self-explanatory through naming, types, and structure.

2. **Verify dependencies exist** before using them. Check Cargo.toml/package.json first.

3. **Preserve existing code style** - Match the patterns used in surrounding code.

4. **Skip conflicting suggestions** - If a CodeRabbit suggestion conflicts with project rules (like adding comments), skip it and report to the user.

5. **Report unresolvable issues** - Some suggestions may require manual review. Document these clearly.

## Output Format

After completing implementation, provide:

1. **Summary of Changes**
- List each file modified
- Brief description of each fix applied

2. **Skipped Suggestions**
- Any suggestions that couldn't be implemented automatically
- Reason for skipping

3. **Validation Results**
- Formatting status
- Compilation status
- Any remaining warnings or errors

## Error Handling

- If GitHub API fails: Report the error and suggest checking authentication or rate limits
- If a file doesn't exist: Skip that suggestion and note it in the report
- If compilation fails after a fix: Attempt to diagnose, or revert and report for manual review
- If no CodeRabbit comments found: Inform the user and suggest verifying the PR number
10 changes: 9 additions & 1 deletion .claude/settings.local.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,15 @@
"Bash(cargo tree:*)",
"WebFetch(domain:github.com)",
"WebFetch(domain:docs.rs)",
"WebFetch(domain:gix.github.io)"
"WebFetch(domain:gix.github.io)",
"Bash(cargo clean:*)",
"Bash(cargo test:*)",
"Bash(powershell -Command \"[System.Environment]::OSVersion.Version.ToString()\")",
"Bash(cargo build:*)",
"Bash(gh api:*)",
"Bash(curl:*)",
"Bash(node -e:*)",
"Bash(findstr:*)"
Comment on lines +46 to +53
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Consider narrowing these broad permission patterns for better local development practice.

The permissions use wildcard patterns that accept any arguments (e.g., curl:*, node -e:*, gh api:*), which are overly permissive for a local development environment. Wildcards like Bash(*) can be overly permissive. While these settings are not checked in and useful for personal preferences and experimentation, narrowing these patterns would still be a good practice:

  • curl:* and node -e:* (lines 51-52): Consider restricting to specific endpoints or use cases rather than allowing all arguments
  • gh api:* (line 50): Limit to read-only API operations if possible
  • cargo build:* and cargo test:* (lines 47, 49): These are reasonable for development but could exclude destructive variations if needed

This is optional for local development, but aligning with the principle of least privilege would make the configuration more maintainable long-term.

🤖 Prompt for AI Agents
In .claude/settings.local.json around lines 46 to 53 the Bash permission
patterns are overly broad (e.g., Bash(curl:*), Bash(node -e:*), Bash(gh api:*),
Bash(cargo test:*), Bash(cargo build:*)); narrow them by replacing wildcard
argument patterns with specific allowed commands or constrained argument
patterns — for curl and node -e restrict to explicit endpoints or scripts used
in local dev, for gh api limit to read-only endpoints or specific routes, and
for cargo build/test exclude destructive flags or limit to the project
workspace; update the lines to explicit, minimal patterns that follow
least-privilege practices.

],
"deny": [],
"ask": []
Expand Down
4 changes: 4 additions & 0 deletions Cargo.lock

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

11 changes: 3 additions & 8 deletions apps/desktop/src-tauri/src/general_settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,11 @@ pub struct GeneralSettingsStore {
pub hide_dock_icon: bool,
#[serde(default)]
pub auto_create_shareable_link: bool,
#[serde(default = "true_b")]
#[serde(default = "default_true")]
pub enable_notifications: bool,
#[serde(default)]
pub disable_auto_open_links: bool,
// first launch: store won't exist so show startup
#[serde(default = "true_b")]
#[serde(default = "default_true")]
pub has_completed_startup: bool,
#[serde(default)]
pub theme: AppTheme,
Expand Down Expand Up @@ -192,7 +191,7 @@ impl Default for GeneralSettingsStore {
delete_instant_recordings_after_upload: false,
instant_mode_max_resolution: 1920,
default_project_name_template: None,
crash_recovery_recording: false,
crash_recovery_recording: true,
}
}
}
Expand All @@ -206,10 +205,6 @@ pub enum AppTheme {
Dark,
}

fn true_b() -> bool {
true
}

impl GeneralSettingsStore {
pub fn get(app: &AppHandle<Wry>) -> Result<Option<Self>, String> {
match app.store("store").map(|s| s.get("general_settings")) {
Expand Down
11 changes: 9 additions & 2 deletions apps/desktop/src-tauri/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,12 @@ async fn upload_logs(app_handle: AppHandle) -> Result<(), String> {
logging::upload_log_file(&app_handle).await
}

#[tauri::command]
#[specta::specta]
fn get_system_diagnostics() -> cap_recording::diagnostics::SystemDiagnostics {
cap_recording::diagnostics::collect_diagnostics()
}

#[tauri::command]
#[specta::specta]
#[instrument(skip(app_handle, state))]
Expand Down Expand Up @@ -1226,7 +1232,7 @@ async fn open_file_path(_app: AppHandle, path: PathBuf) -> Result<(), String> {
Command::new("explorer")
.args(["/select,", path_str])
.spawn()
.map_err(|e| format!("Failed to open folder: {}", e))?;
.map_err(|e| format!("Failed to open folder: {e}"))?;
}

#[cfg(target_os = "macos")]
Expand All @@ -1248,7 +1254,7 @@ async fn open_file_path(_app: AppHandle, path: PathBuf) -> Result<(), String> {
.ok_or("Invalid path")?,
)
.spawn()
.map_err(|e| format!("Failed to open folder: {}", e))?;
.map_err(|e| format!("Failed to open folder: {e}"))?;
}

Ok(())
Expand Down Expand Up @@ -2337,6 +2343,7 @@ pub async fn run(recording_logging_handle: LoggingHandle, logs_dir: PathBuf) {
set_camera_input,
recording_settings::set_recording_mode,
upload_logs,
get_system_diagnostics,
recording::start_recording,
recording::stop_recording,
recording::pause_recording,
Expand Down
Loading