Skip to content

Commit b98c85b

Browse files
committed
refactor: clean up unused dependencies, simplify imports, and update menu bar implementation
1 parent bf44bc1 commit b98c85b

8 files changed

Lines changed: 11 additions & 41 deletions

File tree

src/app/capture.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
use super::*;
2-
use crate::engine::{RenderSurfaceMetadata};
3-
use eframe::egui::ColorImage;
42

53
impl BrazenApp {
64
pub(super) fn update_render_frame(&mut self, ctx: &eframe::egui::Context) {

src/app/input.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use super::*;
2-
use crate::engine::{InputEvent, AlphaMode};
2+
use crate::engine::InputEvent;
33

44
impl BrazenApp {
55
pub(super) fn forward_input_events(&mut self, ctx: &eframe::egui::Context) {

src/app/mod.rs

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,32 +11,27 @@ pub mod recovery;
1111
pub mod workspace;
1212
pub use state::*;
1313

14-
1514
use chrono::Utc;
16-
use serde::{Deserialize, Serialize};
17-
use eframe::egui::Color32;
1815
use std::collections::{HashMap, VecDeque};
19-
use std::path::PathBuf;
2016
use std::sync::{Arc, RwLock};
2117
use std::time::{Duration, Instant};
2218

2319
use crate::automation::{
2420
AutomationCapabilityEvent, AutomationCommand, AutomationHandle, AutomationNavigationEvent,
25-
AutomationActivityStatus, drain_automation_commands,
21+
drain_automation_commands,
2622
};
27-
use crate::cache::{AssetQuery, AssetStore};
23+
use crate::cache::AssetStore;
2824
use crate::commands::{AppCommand, dispatch_command};
2925
use crate::config::BrazenConfig;
3026
use crate::engine::{
31-
AlphaMode, BrowserEngine, BrowserTab, DialogKind, EngineEvent, EngineFactory, EngineLoadStatus,
32-
EngineStatus, FocusState, InputEvent, RenderSurfaceHandle, RenderSurfaceMetadata,
33-
SecurityWarningKind, WindowDisposition,
27+
AlphaMode, BrowserEngine, EngineFactory, EngineLoadStatus, FocusState,
28+
RenderSurfaceHandle, RenderSurfaceMetadata, WindowDisposition,
3429
};
3530
use crate::navigation::{normalize_url_input, resolve_startup_url};
3631
use crate::permissions::Capability;
3732
use crate::platform_paths::RuntimePaths;
3833
use crate::rendering::{normalize_pixels, probe_frame_stats};
39-
use crate::session::{NavigationEntry, SessionSnapshot, load_session};
34+
use crate::session::{SessionSnapshot, load_session};
4035
use crate::profile_db::ProfileDb;
4136
use tokio::sync::mpsc;
4237

@@ -724,7 +719,3 @@ impl BrazenApp {
724719
#[cfg(test)]
725720
mod tests;
726721

727-
728-
fn extract_entities(html: &str) -> Vec<ExtractedEntity> {
729-
crate::extraction::extract_entities(html)
730-
}

src/app/secondary_ui.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use super::state::*;
1+
use super::*;
22
use crate::cache::AssetQuery;
33

44
impl super::BrazenApp {

src/app/state.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
1-
use crate::engine::{BrowserEngine, EngineEvent, EngineStatus, FocusState, RenderSurfaceMetadata, SecurityWarningKind, WindowDisposition, BrowserTab, DialogKind};
1+
use crate::engine::{BrowserEngine, EngineEvent, EngineStatus, SecurityWarningKind, WindowDisposition, BrowserTab, DialogKind};
22
use crate::extraction::extract_entities;
3-
use std::time::Duration;
43
use std::collections::VecDeque;
54
use crate::platform_paths::RuntimePaths;
65
use std::sync::{Arc, RwLock};
76

87
use chrono::Utc;
9-
use crate::session::{NavigationEntry, SessionSnapshot, load_session};
8+
use crate::session::{NavigationEntry, SessionSnapshot};
109
use crate::engine::EngineLoadStatus;
1110
use crate::profile_db::ProfileDb;
12-
use std::time::Instant;
1311
use serde::{Deserialize, Serialize};
1412
use std::collections::HashMap;
15-
use std::path::PathBuf;
1613

1714

1815
#[derive(Debug, Clone, Serialize, Deserialize)]

src/app/ui_components.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ impl super::BrazenApp {
304304

305305
pub fn render_top_menu(&mut self, ctx: &eframe::egui::Context) {
306306
eframe::egui::TopBottomPanel::top("top_menu_bar").show(ctx, |ui| {
307-
eframe::egui::menu::bar(ui, |ui| {
307+
eframe::egui::MenuBar::new().ui(ui, |ui| {
308308
ui.menu_button("File", |ui| {
309309
if ui.button("New Tab").clicked() {
310310
self.apply_palette_command(PaletteCommand::NewTab);

src/app/ui_main.rs

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
use super::state::*;
2-
use crate::engine::RenderSurfaceMetadata;
1+
use super::*;
32
use crate::navigation::normalize_url_input;
4-
use std::collections::VecDeque;
53

64
impl super::BrazenApp {
75

@@ -31,16 +29,6 @@ impl super::BrazenApp {
3129

3230

3331

34-
fn empty_to_none(value: &str) -> Option<String> {
35-
let trimmed = value.trim();
36-
if trimmed.is_empty() {
37-
None
38-
} else {
39-
Some(trimmed.to_string())
40-
}
41-
}
42-
43-
4432

4533

4634

src/app/workspace.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
use super::*;
22

33
impl BrazenApp {
4-
pub(super) fn load_workspace_layout(path: &PathBuf) -> Option<WorkspaceLayout> {
5-
let data = std::fs::read_to_string(path).ok()?;
6-
serde_json::from_str(&data).ok()
7-
}
84

95
pub(super) fn save_workspace_layout(&self) {
106
let Some(db) = &self.profile_db else {

0 commit comments

Comments
 (0)