feat: Add sidebar filtering and fix layout issues
Connect sidebar project/tag clicks to filter the task table. App now observes FilterState changes and triggers task reload. Removed redundant observer from TaskTable since App handles it. Fix Panel component that was overwriting its own styles, breaking flex layouts. Sidebar sections now split space equally and scroll properly.
This commit is contained in:
+4
-14
@@ -222,14 +222,8 @@ impl TaskTable {
|
||||
pub fn new(
|
||||
id: impl Into<gpui::ElementId>,
|
||||
filter_state: gpui::Entity<FilterState>,
|
||||
cx: &mut gpui::Context<Self>,
|
||||
_cx: &mut gpui::Context<Self>,
|
||||
) -> Self {
|
||||
cx.observe(&filter_state, |table, _filter, cx| {
|
||||
table.need_reload = true;
|
||||
cx.notify();
|
||||
})
|
||||
.detach();
|
||||
|
||||
Self {
|
||||
id: id.into(),
|
||||
filter_state,
|
||||
@@ -315,13 +309,9 @@ impl TaskTable {
|
||||
self.cached_tasks = filtered_tasks;
|
||||
self.apply_sort();
|
||||
self.pagination.total_items(self.cached_tasks.len());
|
||||
|
||||
if let Some(idx) = self.selected_global_idx {
|
||||
if idx >= self.cached_tasks.len() {
|
||||
self.selected_global_idx = None;
|
||||
self.selected_page_idx = None;
|
||||
}
|
||||
}
|
||||
self.pagination.current_page(1);
|
||||
self.selected_global_idx = None;
|
||||
self.selected_page_idx = None;
|
||||
|
||||
self.recalculate_rows();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user