gpui-component/docs
Jason Lee 9fa2669ff4
list, table: Refactor List, Table to have ListState, TableState. (#1468)
## Break Change

- Like Select, Input API design, now `List`, `Table` also has ListState
and TableState.

```diff
- let table = cx.new(|_| Table::new(delegate, window, cx).stripe(true).border(true))
+ let table = cx.new(|_| TableState::new(delegate, window, cx))
+ Table::new(&table).stripe(true).border(true) // for render

- let list = cx.new(|_| List::new(delegate, window, cx))
+ let list = cx.new(|_| ListState::new(delegate, window, cx))
+ List::new(&list) // for render
```

- ListDelegate, TableDelegate methods has changed some argument type:
  
- If first argument is `&mut self`, the `cx` has been changed to `&mut
Context<ListState<Self>>` or `&mut Context<TableState<Self>>`.
  

    ```diff
- fn confirm(&mut self, _secondary: bool, _: &mut Window, cx: &mut
Context<List<Self>>)
+ fn confirm(&mut self, _secondary: bool, _: &mut Window, cx: &mut
Context<ListState<Self>>)
    ```

- If first argument is `&self`, the `cx` has been changed to `&mut App`.

    ```diff
- fn render_item(&self, ix: IndexPath, _: &mut Window, _: &mut
Context<List<Self>>)
    + fn render_item(&self, ix: IndexPath, _: &mut Window, _: &mut App)
    ```
2025-11-02 12:59:37 +00:00
..
.vitepress docs: Improve docs add more details. (#1447) 2025-10-29 02:41:28 +00:00
data docs: Improve docs add more details. (#1447) 2025-10-29 02:41:28 +00:00
docs list, table: Refactor List, Table to have ListState, TableState. (#1468) 2025-11-02 12:59:37 +00:00
public docs: Update dark theme logo. (#1412) 2025-10-22 22:09:30 +08:00
src docs: Switch to use VitePress. (#1405) 2025-10-21 15:18:41 +08:00
.gitignore docs: Add Context & ElementId doc. (#1460) 2025-10-29 23:37:26 +08:00
bun.lock docs: Switch to use VitePress. (#1405) 2025-10-21 15:18:41 +08:00
contributors.md docs: Update docs links. 2025-10-22 22:27:49 +08:00
contributors.vue docs: Improve docs add more details. (#1447) 2025-10-29 02:41:28 +00:00
index.md docs: Improve docs add more details. (#1447) 2025-10-29 02:41:28 +00:00
index.vue docs: Update from 40+ to 60+ components. 2025-10-24 13:25:31 +08:00
package.json docs: Switch to use VitePress. (#1405) 2025-10-21 15:18:41 +08:00
postcss.config.mjs docs: Switch to use VitePress. (#1405) 2025-10-21 15:18:41 +08:00