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:
+17
-3
@@ -55,6 +55,13 @@ impl gpui::Render for App {
|
||||
}
|
||||
|
||||
impl App {
|
||||
fn reload_tasks(&mut self, cx: &mut gpui::Context<Self>) {
|
||||
let task_service = &mut self.task_service;
|
||||
self.task_table.update(cx, |table, cx| {
|
||||
table.reload_tasks(task_service, cx);
|
||||
});
|
||||
}
|
||||
|
||||
pub fn run() -> () {
|
||||
let app = gpui::Application::new();
|
||||
|
||||
@@ -102,13 +109,20 @@ impl App {
|
||||
table.reload_tasks(&mut task_service, cx);
|
||||
});
|
||||
|
||||
App {
|
||||
let app = App {
|
||||
sidebar,
|
||||
filter_state,
|
||||
filter_state: filter_state.clone(),
|
||||
status_bar,
|
||||
task_table,
|
||||
task_service,
|
||||
}
|
||||
};
|
||||
|
||||
cx.observe(&filter_state, |app, _, cx| {
|
||||
app.reload_tasks(cx);
|
||||
})
|
||||
.detach();
|
||||
|
||||
app
|
||||
})
|
||||
},
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user