Ref UITableView API: https://developer.apple.com/documentation/uikit/uitableviewdatasource ## Changes - Added some section related API to `ListDelegeate` and `DropdownDelegate` with default implement, so if you don't need section that you can just keep the default. - Added `sections_count` method to get the number of sections, default is 1. - Added `render_section_header` for special the section header by if needed, default return None. - Added `render_section_footer` for special the section footer by if needed, default return None. ## Break Changes - The `DropdownState` have change new method to use IndexPath type: ```diff - DropdownState::new(vec![], Some(1), window, cx); + DropdownState::new(vec![], Some(IndexPath::new(1)), window, cx); ``` - The `ListDelegeate`, `DropdownDelegate` has changed API: - The `ix` are change from `usize` to `IndexPath`. ```diff - fn render_item(&self, ix: usize, window: &mut Window, cx: &mut Context<List<Self>>) -> Option<Self::Item> + fn render_item(&self, ix: IndexPath, window: &mut Window, cx: &mut Context<List<Self>>) -> Option<Self::Item> - fn set_selected_index(&mut self, ix: Option<usize>, window: &mut Window, cx: &mut Context<List<Self>>) + fn set_selected_index(&mut self, ix: Option<IndexPath>, window: &mut Window, cx: &mut Context<List<Self>>) ``` - The `items_count` method have added `section` argument to support list section. ```diff - fn items_count(&self, cx: &App) -> usize + fn items_count(&self, section: usize, cx: &App) -> usize ``` - The `can_load_more` method has renamed to `is_eof` in `ListDelegate` and `TableDelegate`. ```diff - fn can_load_more(&self, cx: &App) -> bool + fn is_eof(&self, cx: &App) -> bool ``` - The `can_search` method has renamed to `searchable` in `ListDelegate`. ```diff - fn can_search(&self) -> bool + fn searchable(&self) -> bool ``` ## Showcase <img width="1196" height="925" alt="image" src="https://github.com/user-attachments/assets/22750abe-cc3f-427e-903b-51758bd4e027" /> <img width="1214" height="934" alt="image" src="https://github.com/user-attachments/assets/52d42546-e6e7-4448-9c0f-43cd659fb630" /> --------- Co-authored-by: Floyd Wang <gassnake999@gmail.com>
31 lines
701 B
TOML
31 lines
701 B
TOML
[package]
|
|
edition = "2021"
|
|
name = "story"
|
|
publish = false
|
|
version = "0.1.0"
|
|
|
|
[dependencies]
|
|
anyhow.workspace = true
|
|
gpui.workspace = true
|
|
gpui-component = { workspace = true, features = ["webview"] }
|
|
|
|
chrono = "0.4"
|
|
fake = { version = "2.10.0", features = ["dummy"] }
|
|
rand = "0.8"
|
|
raw-window-handle = { version = "0.6", features = ["std"] }
|
|
regex = "1"
|
|
reqwest_client.workspace = true
|
|
rust-embed = "8.5.0"
|
|
serde = "1"
|
|
serde_json = "1"
|
|
unindent = "0.2.3"
|
|
tracing.workspace = true
|
|
tracing-subscriber = { version = "0.3.19", features = ["env-filter"] }
|
|
tree-sitter-navi = "0.2.2"
|
|
itertools = "0.14.0"
|
|
|
|
[target.'cfg(target_os = "linux")'.dependencies]
|
|
gtk = { version = "0.18" }
|
|
|
|
[lints]
|
|
workspace = true
|