Skip to content

Commit de8cb48

Browse files
committed
sweep in behind popups
1 parent e3d5798 commit de8cb48

6 files changed

Lines changed: 25 additions & 8 deletions

File tree

src/client/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ pub enum PipelineStatus {
121121
impl Default for PollingConfig {
122122
fn default() -> Self {
123123
Self {
124-
projects_interval: Duration::from_secs(60),
124+
projects_interval: Duration::from_secs(15),
125125
jobs_interval: Duration::from_secs(30),
126126
}
127127
}

src/effect_registry.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,11 +184,17 @@ impl EffectRegistry {
184184
/// # Returns
185185
///
186186
/// A parallel effect combining coalescing and left-to-right sweep animation
187-
pub fn register_projects_table_new_data(&mut self) {
187+
pub fn register_projects_table_new_data(&mut self, exclude_popup_area: Option<RefRect>) {
188+
let filter = match exclude_popup_area {
189+
Some(area) => AllOf(vec![Inner(Margin::new(1, 1)), Not(ref_rect_filter(area).into())]),
190+
None => Inner(Margin::new(1, 1)),
191+
};
192+
188193
let fx = parallel(&[
189194
coalesce(550),
190195
sweep_in(Motion::LeftToRight, 50, 0, Dark0Hard, (450, Interpolation::QuadIn)),
191-
]);
196+
])
197+
.with_filter(filter);
192198

193199
self.effects.add_effect(fx);
194200
}
@@ -493,7 +499,7 @@ fn dim_screen_behind_popup(screen_area: RefRect, popup_area: RefRect) -> Effect
493499
/// # Returns
494500
///
495501
/// A `CellFilter` that matches cells within the specified rectangle
496-
fn ref_rect_filter(ref_rect: RefRect) -> CellFilter {
502+
pub fn ref_rect_filter(ref_rect: RefRect) -> CellFilter {
497503
CellFilter::PositionFn(ref_count(Box::new(move |pos| ref_rect.contains(pos))))
498504
}
499505

src/ui/popup/config_popup.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ pub struct ConfigPopupState {
2929
pub cursor_position: Position,
3030
input_fields: Vec<InputField>,
3131
pub error_message: Option<CompactString>,
32-
popup_area: RefRect,
32+
pub popup_area: RefRect,
3333
}
3434

3535
impl ConfigPopup {

src/ui/popup/pipeline_actions_popup.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ pub struct PipelineActionsPopup {}
1818
pub struct PipelineActionsPopupState {
1919
pub actions: Vec<GlimEvent>,
2020
pub list_state: ListState,
21-
popup_area: RefRect,
21+
pub popup_area: RefRect,
2222
}
2323

2424
impl PipelineActionsPopupState {

src/ui/popup/project_details_popup.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ pub struct ProjectDetailsPopupState {
2727
project_stat_summary: Text<'static>,
2828
pub pipelines: PipelineTable, // widget
2929
pub pipelines_table_state: TableState,
30-
popup_area: RefRect,
30+
pub popup_area: RefRect,
3131
}
3232

3333
impl ProjectDetailsPopup {

src/ui/stateful_widgets.rs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,10 @@ impl StatefulWidgets {
5454
match event {
5555
GlimEvent::ProjectNext => self.handle_project_selection(1, app),
5656
GlimEvent::ProjectPrevious => self.handle_project_selection(-1, app),
57-
GlimEvent::ProjectsLoaded(_) => effects.register_projects_table_new_data(),
57+
GlimEvent::ProjectsLoaded(_) => {
58+
let exclude_area_from_fx = self.current_popup_area();
59+
effects.register_projects_table_new_data(exclude_area_from_fx)
60+
},
5861
GlimEvent::ProjectDetailsOpen(id) => {
5962
let popup_area = RefRect::default();
6063
effects.register_project_details(popup_area.clone());
@@ -89,6 +92,14 @@ impl StatefulWidgets {
8992
}
9093
}
9194

95+
fn current_popup_area(&self) -> Option<RefRect> {
96+
if let Some(pd) = &self.project_details {
97+
Some(pd.popup_area.clone())
98+
} else if let Some(cp) = &self.config_popup_state {
99+
Some(cp.popup_area.clone())
100+
} else { self.pipeline_actions.as_ref().map(|pa| pa.popup_area.clone()) }
101+
}
102+
92103
fn refresh_project_details(&mut self, project: &Project) {
93104
let requires_refresh = self
94105
.project_details

0 commit comments

Comments
 (0)