-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add log upload functionality to feedback settings #1298
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughA new log upload feature is added to the desktop application. A Tauri command Changes
Sequence DiagramsequenceDiagram
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
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Possibly related PRs
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this 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_inputat line 217,set_camera_inputat 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
📒 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 usingrustfmtand 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 runningpnpm format.Use strict TypeScript and avoid any; leverage shared types
Files:
apps/desktop/src/utils/tauri.tsapps/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.tsapps/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.tsapps/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
uploadLogscommand 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_logscommand 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
toastimport enables user feedback, and thecommandsimport provides access to theuploadLogsTauri command.
23-23: LGTM! State properly initialized.The
uploadingLogssignal is correctly initialized and follows SolidJS conventions for tracking async operation state.
28-39: LGTM! Excellent error handling and state management.The
handleUploadLogsfunction 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
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
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