Skip to content

Conversation

@richiemcilroy
Copy link
Member

@richiemcilroy richiemcilroy commented Oct 27, 2025

Introduces a new Tauri command and UI in the feedback settings tab to allow users to upload logs for debugging purposes. Updates the backend, frontend logic, and command utilities to support log uploads, providing user feedback on upload status.

Summary by CodeRabbit

  • New Features
    • Added log upload capability in the settings feedback section. Users can now submit debug information via a new "Debug Information" section with an upload button. Uploading state is reflected in the UI, and users receive success or error notifications upon completion.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 27, 2025

Walkthrough

A new log upload feature is added to the desktop application. A Tauri command upload_logs is registered on the backend, exposed through a frontend API wrapper, and integrated into the settings feedback UI with uploading state and error handling.

Changes

Cohort / File(s) Summary
Backend command
apps/desktop/src-tauri/src/lib.rs
New async Tauri command upload_logs() registered and delegating to logging::upload_log_file(&app_handle)
Frontend API wrapper
apps/desktop/src/utils/tauri.ts
New uploadLogs(): Promise<null> method added to exported commands object, invoking the "upload_logs" IPC endpoint
Settings UI
apps/desktop/src/routes/(window-chrome)/settings/feedback.tsx
New "Debug Information" section with upload button, uploading state management, and error toast notifications

Sequence Diagram

sequenceDiagram
    actor User
    participant UI as Feedback Settings
    participant API as tauri.ts
    participant Tauri as Tauri Command
    participant Backend as logging module
    
    User->>UI: Click Upload Logs button
    UI->>API: commands.uploadLogs()
    API->>Tauri: TAURI_INVOKE("upload_logs")
    Tauri->>Backend: upload_log_file(&app_handle)
    
    alt Success
        Backend-->>Tauri: Ok()
        Tauri-->>API: Success
        API-->>UI: Promise resolves
        UI->>User: Show success toast
    else Error
        Backend-->>Tauri: Error
        Tauri-->>API: Error
        API-->>UI: Promise rejects
        UI->>User: Show error toast + console log
    end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Straightforward additions following established patterns across three files
  • Each change is isolated and follows existing conventions (new Tauri command, API wrapper, UI integration)
  • Error handling is basic but adequate
  • All changes are additive with no modifications to existing logic

Possibly related PRs

  • Cap#1221: Directly related as it implements the logging::upload_log_file function that this PR invokes through the new Tauri command.

Poem

🐰 A log-filled warren we now explore,
With buttons bright that open doors—
Upload! Upload! the rabbit cries,
As errors surface to our eyes,
Debug and trace, no stone unturned,
From logs we've sent, more wisdom earned! 📋

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The pull request title "Add log upload functionality to feedback settings" directly aligns with the main changes across all three modified files. The changeset introduces a new Tauri command for uploading logs, implements the frontend UI component in the feedback settings, and adds the corresponding command wrapper. The title clearly communicates the primary objective: enabling log uploads within the feedback settings interface. The phrasing is concise, specific, and avoids vague terminology, making it immediately clear to a reviewer what the change accomplishes.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch logs-button

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
apps/desktop/src-tauri/src/lib.rs (1)

241-245: Consider adding instrumentation for consistency.

Most other commands in this file use the #[instrument] attribute for better tracing and debugging (e.g., set_mic_input at line 217, set_camera_input at line 249). Consider adding it here for consistency:

 #[tauri::command]
 #[specta::specta]
+#[instrument(skip(app_handle))]
 async fn upload_logs(app_handle: AppHandle) -> Result<(), String> {
     logging::upload_log_file(&app_handle).await
 }
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0cbd594 and d50b290.

📒 Files selected for processing (3)
  • apps/desktop/src-tauri/src/lib.rs (2 hunks)
  • apps/desktop/src/routes/(window-chrome)/settings/feedback.tsx (3 hunks)
  • apps/desktop/src/utils/tauri.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (5)
**/*.rs

📄 CodeRabbit inference engine (AGENTS.md)

**/*.rs: Format Rust code using rustfmt and ensure all Rust code passes workspace-level clippy lints.
Rust modules should be named with snake_case, and crate directories should be in kebab-case.

Files:

  • apps/desktop/src-tauri/src/lib.rs
**/*.{ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx}: Use a 2-space indent for TypeScript code.
Use Biome for formatting and linting TypeScript/JavaScript files by running pnpm format.

Use strict TypeScript and avoid any; leverage shared types

Files:

  • apps/desktop/src/utils/tauri.ts
  • apps/desktop/src/routes/(window-chrome)/settings/feedback.tsx
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx,js,jsx}: Use kebab-case for filenames for TypeScript/JavaScript modules (e.g., user-menu.tsx).
Use PascalCase for React/Solid components.

Files:

  • apps/desktop/src/utils/tauri.ts
  • apps/desktop/src/routes/(window-chrome)/settings/feedback.tsx
**/tauri.ts

📄 CodeRabbit inference engine (AGENTS.md)

Do not edit auto-generated files named tauri.ts.

NEVER EDIT auto-generated IPC bindings file: tauri.ts

Files:

  • apps/desktop/src/utils/tauri.ts
apps/desktop/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

apps/desktop/src/**/*.{ts,tsx}: Desktop icons are auto-imported (unplugin-icons); do not import icons manually
Desktop IPC: Call generated tauri_specta commands/events; listen to generated events and use typed interfaces
Use @tanstack/solid-query for server state in the desktop app

Files:

  • apps/desktop/src/utils/tauri.ts
  • apps/desktop/src/routes/(window-chrome)/settings/feedback.tsx
🧬 Code graph analysis (2)
apps/desktop/src-tauri/src/lib.rs (1)
apps/desktop/src-tauri/src/logging.rs (1)
  • upload_log_file (32-83)
apps/desktop/src/routes/(window-chrome)/settings/feedback.tsx (1)
packages/ui-solid/src/Button.tsx (1)
  • Button (40-50)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Clippy
  • GitHub Check: Build Desktop (aarch64-apple-darwin, macos-latest)
  • GitHub Check: Build Desktop (x86_64-pc-windows-msvc, windows-latest)
  • GitHub Check: Analyze (rust)
🔇 Additional comments (6)
apps/desktop/src/utils/tauri.ts (1)

14-16: LGTM! Auto-generated command correctly reflects backend registration.

The uploadLogs command wrapper is properly auto-generated from the backend Tauri command registration. The signature matches the backend implementation.

apps/desktop/src-tauri/src/lib.rs (1)

1958-1958: LGTM! Command properly registered.

The upload_logs command is correctly registered in the Specta command list, making it available to the frontend.

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

6-8: LGTM! Imports correctly added for log upload feature.

The toast import enables user feedback, and the commands import provides access to the uploadLogs Tauri command.


23-23: LGTM! State properly initialized.

The uploadingLogs signal is correctly initialized and follows SolidJS conventions for tracking async operation state.


28-39: LGTM! Excellent error handling and state management.

The handleUploadLogs function properly:

  • Manages loading state with try/catch/finally pattern
  • Ensures state is always reset in the finally block
  • Provides user feedback via toasts
  • Logs errors for debugging

93-106: LGTM! UI properly integrated with clear user guidance.

The debug information section is well-implemented:

  • Clear description reassures users about privacy ("No personal information is included")
  • Button correctly disabled during upload to prevent duplicate requests
  • Loading state reflected in button text
  • Consistent styling with the rest of the settings UI

@richiemcilroy
Copy link
Member Author

@coderabbitai review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 27, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@richiemcilroy richiemcilroy merged commit c2ed071 into main Oct 27, 2025
14 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants