Skip to content

Commit e580265

Browse files
Merge pull request #56 from gitcoder89431/polish-accessibility-01
refactor: clean up code formatting for better readability in app and …
2 parents 4c8bb59 + 9624bb6 commit e580265

File tree

2 files changed

+28
-18
lines changed

2 files changed

+28
-18
lines changed

crates/agentic-tui/src/ui/app.rs

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ pub struct App {
169169
autocomplete_index: usize,
170170
ruixen_reaction_state: Option<RuixenState>, // Temporary reaction state
171171
reaction_timer: Option<std::time::Instant>, // When reaction started
172-
last_api_call: Option<std::time::Instant>, // Rate limiting protection
172+
last_api_call: Option<std::time::Instant>, // Rate limiting protection
173173
}
174174

175175
impl App {
@@ -515,10 +515,13 @@ impl App {
515515
modal_height,
516516
);
517517
// Add subtle backdrop darkening for better modal focus
518-
let backdrop = Block::default()
519-
.style(self.theme.ratatui_style(Element::Background).bg(ratatui::style::Color::Rgb(20, 20, 20)));
518+
let backdrop = Block::default().style(
519+
self.theme
520+
.ratatui_style(Element::Background)
521+
.bg(ratatui::style::Color::Rgb(20, 20, 20)),
522+
);
520523
frame.render_widget(backdrop, size);
521-
524+
522525
frame.render_widget(Clear, modal_area); // clears the background
523526

524527
if self.mode == AppMode::SelectingLocalModel {
@@ -580,10 +583,13 @@ impl App {
580583
modal_height,
581584
);
582585
// Add subtle backdrop darkening for better modal focus
583-
let backdrop = Block::default()
584-
.style(self.theme.ratatui_style(Element::Background).bg(ratatui::style::Color::Rgb(20, 20, 20)));
586+
let backdrop = Block::default().style(
587+
self.theme
588+
.ratatui_style(Element::Background)
589+
.bg(ratatui::style::Color::Rgb(20, 20, 20)),
590+
);
585591
frame.render_widget(backdrop, size);
586-
592+
587593
frame.render_widget(Clear, modal_area);
588594
self.render_synthesize_modal(frame, modal_area);
589595
} else if self.mode == AppMode::CoachingTip {
@@ -602,10 +608,13 @@ impl App {
602608
modal_height,
603609
);
604610
// Add subtle backdrop darkening for better modal focus
605-
let backdrop = Block::default()
606-
.style(self.theme.ratatui_style(Element::Background).bg(ratatui::style::Color::Rgb(20, 20, 20)));
611+
let backdrop = Block::default().style(
612+
self.theme
613+
.ratatui_style(Element::Background)
614+
.bg(ratatui::style::Color::Rgb(20, 20, 20)),
615+
);
607616
frame.render_widget(backdrop, size);
608-
617+
609618
frame.render_widget(Clear, modal_area);
610619
self.render_coaching_tip_modal(frame, modal_area);
611620
} else if self.mode == AppMode::Complete {
@@ -1094,8 +1103,11 @@ impl App {
10941103
// Synthesize - send proposal to cloud for synthesis
10951104
// Rate limiting: only allow if not already processing and sufficient cooldown
10961105
let can_make_request = self.agent_status != AgentStatus::Searching
1097-
&& self.last_api_call.map(|t| t.elapsed().as_secs() >= 2).unwrap_or(true);
1098-
1106+
&& self
1107+
.last_api_call
1108+
.map(|t| t.elapsed().as_secs() >= 2)
1109+
.unwrap_or(true);
1110+
10991111
if can_make_request {
11001112
if let Some(proposal) =
11011113
self.proposals.get(self.current_proposal_index)

crates/agentic-tui/src/ui/settings_modal.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,10 @@ pub fn render_settings_modal(
5050

5151
if is_selected {
5252
// Selected: highlight background + bright text (full focus treatment)
53-
Line::from(vec![
54-
Span::styled(
55-
format!("{:<15}{}", label, display_value),
56-
theme.highlight_style(), // Highlight background for entire row
57-
),
58-
])
53+
Line::from(vec![Span::styled(
54+
format!("{:<15}{}", label, display_value),
55+
theme.highlight_style(), // Highlight background for entire row
56+
)])
5957
} else {
6058
// Unselected: dim label + dim value (fades away)
6159
Line::from(vec![

0 commit comments

Comments
 (0)