refactor: replace shell with root view wrapping app content
Rust / build (macos-latest, stable) (push) Waiting to run
Rust / build (ubuntu-latest, stable) (push) Waiting to run
Rust / build (windows-latest, stable) (push) Waiting to run

This commit is contained in:
2026-11-22 21:45:09 +07:00
parent 531493008e
commit ccaa48a112
17 changed files with 259 additions and 284 deletions
+9 -15
View File
@@ -119,14 +119,11 @@ impl RepoFilesView {
fn rebuild_rows(&mut self) {
self.rows = TreeItemSeed::flatten_all(&self.seeds, &self.expanded);
self.selected_index = self
.selected_file
.as_ref()
.and_then(|path| {
self.rows
.iter()
.position(|row| row.key().to_string() == path.as_ref())
});
self.selected_index = self.selected_file.as_ref().and_then(|path| {
self.rows
.iter()
.position(|row| row.key().to_string() == path.as_ref())
});
}
fn toggle_folder(&mut self, id: &str) {
@@ -281,10 +278,7 @@ impl RepoFilesView {
let view = disclosure_view;
move |index, _, cx| {
if let Err(error) = view.update(cx, |this, cx| {
let id = this
.rows
.get(index)
.map(|row| row.key().to_string());
let id = this.rows.get(index).map(|row| row.key().to_string());
if let Some(id) = id {
this.toggle_folder(&id);
cx.emit(RepoFilesEvent::Activated);
@@ -310,9 +304,9 @@ impl RepoFilesView {
self.code_element(path.as_ref())
}
}
Some(FileContent::Binary) => EmptyState::centered(
"Binary file - preview not supported",
),
Some(FileContent::Binary) => {
EmptyState::centered("Binary file - preview not supported")
}
Some(FileContent::TooLarge) => EmptyState::centered("File is too large to preview"),
Some(FileContent::Failed(message)) => EmptyState::centered(message),
None => Spinner::centered("repo-preview-spinner"),