Skip to content

Commit acedfe3

Browse files
authored
Merge pull request #335 from cosmic-utils/feat/comprehensive-bug-report
feat: include full insights, settings, and libcamera metadata in bug report
2 parents 0c6205d + f070add commit acedfe3

4 files changed

Lines changed: 726 additions & 21 deletions

File tree

src/app/handlers/system.rs

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -414,24 +414,35 @@ impl AppModel {
414414
Task::none()
415415
}
416416

417-
pub(crate) fn handle_generate_bug_report(&self) -> Task<cosmic::Action<Message>> {
417+
pub(crate) fn handle_generate_bug_report(&mut self) -> Task<cosmic::Action<Message>> {
418418
info!("Generating bug report...");
419419

420+
// Ensure insights are up-to-date (normally only refreshed when the
421+
// Insights drawer is open, so they may be stale/empty here).
422+
let _ = self.handle_update_insights_metrics();
423+
420424
let video_devices = self.available_cameras.clone();
421425
let audio_devices = self.available_audio_devices.clone();
422426
let video_encoders = self.available_video_encoders.clone();
423-
let selected_encoder_index = self.current_video_encoder_index;
424427
let save_folder_name = self.config.save_folder_name.clone();
428+
let insights = self.insights.clone();
429+
let config = self.config.clone();
430+
let snapshot = crate::bug_report::AppStateSnapshot {
431+
current_camera_index: self.current_camera_index,
432+
current_audio_device_index: self.current_audio_device_index,
433+
current_video_encoder_index: self.current_video_encoder_index,
434+
};
425435

426436
Task::perform(
427437
async move {
428438
crate::bug_report::BugReportGenerator::generate(
429439
&video_devices,
430440
&audio_devices,
431441
&video_encoders,
432-
selected_encoder_index,
433-
None,
434442
&save_folder_name,
443+
&insights,
444+
&config,
445+
&snapshot,
435446
)
436447
.await
437448
.map(|p| p.display().to_string())
@@ -825,6 +836,7 @@ impl AppModel {
825836
self.insights.meta_lens_position = meta.lens_position;
826837
self.insights.meta_lux = meta.lux;
827838
self.insights.meta_focus_fom = meta.focus_fom;
839+
self.insights.frame_metadata = Some(meta.clone());
828840
}
829841
}
830842
}

src/app/insights/types.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ pub struct InsightsState {
7777
pub meta_focus_fom: Option<i32>,
7878
/// Whether libcamera metadata is present at all
7979
pub has_libcamera_metadata: bool,
80+
/// Full libcamera FrameMetadata snapshot (includes fields not shown in UI:
81+
/// sensor_timestamp, colour_correction_matrix, af/ae/awb state)
82+
pub frame_metadata: Option<crate::backends::camera::types::FrameMetadata>,
8083

8184
// Recording pipeline info (populated while recording)
8285
/// Recording pipeline diagnostics (None when not recording)

src/app/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ pub mod frame_processor;
3838
mod gallery_primitive;
3939
mod gallery_widget;
4040
mod handlers;
41-
mod insights;
41+
pub mod insights;
4242
mod motor_picker;
4343
pub mod qr_overlay;
4444
pub mod settings;

0 commit comments

Comments
 (0)