Continue #1137
Forked html5minify to improve:
- Resolve `\n` not replaced issue, now no need Regexp to replace.
- Resolve the difference version of html5ever dependency.
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>
The `virtual_list` scroll range issue because recently GPUI changed the
`ScrollHandle` API, now we only get the `max_offset`.
So #1086 have fixed this to implementation a `content_size` method to
calculate `max_offset` and `bounds` of the `ScrollHandle`.
But I found that the `Interactivity` prepaint (This is used in
VirtualList) was not to update the `bounds` of the `ScrollHandle`.
Wait https://github.com/zed-industries/zed/pull/35013 to merge.
| Before | After |
| -- | --- |
| <img width="620" alt="image"
src="https://github.com/user-attachments/assets/6ffb8f30-93b4-42ec-a837-90f80ecb2bf5"
/> | <img width="620" alt="image"
src="https://github.com/user-attachments/assets/21466332-030c-495f-8c84-e3a2c6eeb403"
/> |
- Split `Scrollbale` and `VirtualList` story.
## Break Changes
- The `content_size` argument has been removed from `virtual_list`
callback.
This change to fix some incorrect style use, that will break in Taffy
0.5.2+
Ref https://github.com/zed-industries/zed/pull/34827
- Add `Tab::empty` to create a Tab without label.
- Fix form layout in Taffy new version.
- Update GPUI for scroll API changes.
- Added a lot of default fallbacks for theme colors based on `base`
colors.
- Added `hue`, `saturation`, `lightness` method to change Hsla color.
- Update stories to use theme colors, not a direct color.
- Improve `Badge`, `Avatar` to use theme colors.
- Added a new theme: `Fahrenheit`.
Bumps [gpui](https://github.com/zed-industries/zed) from `0852912` to
`a067c16`.
<details>
<summary>Commits</summary>
<ul>
<li><a
href="a067c16c82"><code>a067c16</code></a>
windows: Use drop target helper (<a
href="https://redirect.github.com/zed-industries/zed/issues/33203">#33203</a>)</li>
<li><a
href="1a6c1b2159"><code>1a6c1b2</code></a>
windows: Fix window close animation (<a
href="https://redirect.github.com/zed-industries/zed/issues/33228">#33228</a>)</li>
<li><a
href="8718019b52"><code>8718019</code></a>
file finder: Ensure filter options keybinding is displayed (<a
href="https://redirect.github.com/zed-industries/zed/issues/33244">#33244</a>)</li>
<li><a
href="a32505fcc2"><code>a32505f</code></a>
agent: Fix token limit callout to show burn mode only for zed provider
(<a
href="https://redirect.github.com/zed-industries/zed/issues/33096">#33096</a>)</li>
<li><a
href="980917bb7c"><code>980917b</code></a>
agent: Preserve chat box text on 'New From Summary' (<a
href="https://redirect.github.com/zed-industries/zed/issues/33220">#33220</a>)</li>
<li><a
href="bd8471bb40"><code>bd8471b</code></a>
agent: Add soft-wrap to long terminal command JSON (<a
href="https://redirect.github.com/zed-industries/zed/issues/33188">#33188</a>)</li>
<li><a
href="16f1da1b7e"><code>16f1da1</code></a>
agent: Fix long previous user message double scroll (<a
href="https://redirect.github.com/zed-industries/zed/issues/33056">#33056</a>)</li>
<li><a
href="272fc672af"><code>272fc67</code></a>
windows: Dialog QoL improvements (<a
href="https://redirect.github.com/zed-industries/zed/issues/33241">#33241</a>)</li>
<li><a
href="e68b95c61b"><code>e68b95c</code></a>
agent: Ensure tool names are unique (<a
href="https://redirect.github.com/zed-industries/zed/issues/33237">#33237</a>)</li>
<li><a
href="28f56ad7ae"><code>28f56ad</code></a>
windows: Avoid setting the mouse cursor while the window is disabled (<a
href="https://redirect.github.com/zed-industries/zed/issues/33230">#33230</a>)</li>
<li>Additional commits viewable in <a
href="0852912fd6...a067c16c82">compare
view</a></li>
</ul>
</details>
<br />
Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
<details>
<summary>Dependabot commands and options</summary>
<br />
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
</details>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [gpui](https://github.com/huacnlee/zed) from `04c0a54` to
`c56b5d8`.
<details>
<summary>Commits</summary>
<ul>
<li><a
href="c56b5d8099"><code>c56b5d8</code></a>
gpui: Fix VRAM leak caused by drawing large textures and resize
textures</li>
<li><a
href="3862d87e27"><code>3862d87</code></a>
gpui: Fix <code>window_handle</code> method on Linux.</li>
<li><a
href="7675ad9f8f"><code>7675ad9</code></a>
gpui: Fix <code>update_window</code> to <code>borrow_mut</code> will
crash on Windows.</li>
<li><a
href="5e31d86f1f"><code>5e31d86</code></a>
Fix panic in vim selection restoration (<a
href="https://redirect.github.com/huacnlee/zed/issues/29251">#29251</a>)</li>
<li><a
href="4a8f114528"><code>4a8f114</code></a>
Fix panic when collaborating with new multibuffers (<a
href="https://redirect.github.com/huacnlee/zed/issues/29245">#29245</a>)</li>
<li><a
href="ce1a674eba"><code>ce1a674</code></a>
eval: Fine-grained assertions (<a
href="https://redirect.github.com/huacnlee/zed/issues/29246">#29246</a>)</li>
<li><a
href="0d3fe474db"><code>0d3fe47</code></a>
editor: Use quantize score for code completions sort + Add code
completions t...</li>
<li><a
href="6a009b447a"><code>6a009b4</code></a>
debugger: Open debugger panel on session startup (<a
href="https://redirect.github.com/huacnlee/zed/issues/29186">#29186</a>)</li>
<li><a
href="75ab8ff9a1"><code>75ab8ff</code></a>
zlog: Add default filters (<a
href="https://redirect.github.com/huacnlee/zed/issues/29244">#29244</a>)</li>
<li><a
href="3705986fac"><code>3705986</code></a>
Adjust image cache APIs to enable ElementState based APIs (<a
href="https://redirect.github.com/huacnlee/zed/issues/29243">#29243</a>)</li>
<li>Additional commits viewable in <a
href="04c0a545a7...c56b5d8099">compare
view</a></li>
</ul>
</details>
<br />
Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
<details>
<summary>Dependabot commands and options</summary>
<br />
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
</details>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [gpui](https://github.com/huacnlee/zed) from `236d6f9` to
`04c0a54`.
<details>
<summary>Commits</summary>
<ul>
<li><a
href="04c0a545a7"><code>04c0a54</code></a>
gpui: Add ImageCache.</li>
<li><a
href="a430d24139"><code>a430d24</code></a>
gpui: Fix <code>window_handle</code> method on Linux.</li>
<li><a
href="cd35ff91f7"><code>cd35ff9</code></a>
gpui: Fix <code>update_window</code> to <code>borrow_mut</code> will
crash on Windows.</li>
<li><a
href="d4736a5427"><code>d4736a5</code></a>
debugger: Fix bug where deleting a breakpoint could delete multiple
breakpoin...</li>
<li><a
href="353ae2335b"><code>353ae23</code></a>
Fix staging/unstaging hunks remotely (<a
href="https://redirect.github.com/huacnlee/zed/issues/28560">#28560</a>)</li>
<li><a
href="ad39d3226f"><code>ad39d32</code></a>
Add new actions <code>editor::FindNextMatch</code> and
<code>editor::FindPreviousMatch</code> (<a
href="https://redirect.github.com/huacnlee/zed/issues/28559">#28559</a>)</li>
<li><a
href="c35238bd72"><code>c35238b</code></a>
debugger: Add support for setting multiple breakpoints via actions (<a
href="https://redirect.github.com/huacnlee/zed/issues/28437">#28437</a>)</li>
<li><a
href="5757e352b0"><code>5757e35</code></a>
agent: Fix bug where wrong crease for <a
href="https://github.com/mention"><code>@mention</code></a> would be
displayed (<a
href="https://redirect.github.com/huacnlee/zed/issues/28558">#28558</a>)</li>
<li><a
href="c124838a73"><code>c124838</code></a>
agent: Fix "new text thread" action name (<a
href="https://redirect.github.com/huacnlee/zed/issues/28555">#28555</a>)</li>
<li><a
href="5ebac7e30c"><code>5ebac7e</code></a>
agent: Clean up thread auto-capturing (<a
href="https://redirect.github.com/huacnlee/zed/issues/28550">#28550</a>)</li>
<li>Additional commits viewable in <a
href="236d6f902e...04c0a545a7">compare
view</a></li>
</ul>
</details>
<br />
Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.
[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)
---
<details>
<summary>Dependabot commands and options</summary>
<br />
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
</details>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>