Add basic ico support (#40822)

Closes https://github.com/zed-industries/zed/discussions/40763

<img width="867" height="1088" alt="Screenshot 2025-10-21 at 23 14 47"
src="https://github.com/user-attachments/assets/d691fb2a-afc6-4445-a335-054ef164e0d3"
/>

Also improves error handling on image open failure:

<img width="864" height="1083" alt="Screenshot 2025-10-21 at 23 14 30"
src="https://github.com/user-attachments/assets/d5388b61-995f-441b-b375-ad5136d1533b"
/>


Release Notes:

- Added basic ico support, improved unsupported image handling
This commit is contained in:
Kirill Bulatov
2025-10-22 12:07:32 +03:00
committed by GitHub
parent 8ceb2f2c61
commit bc0bace81f
13 changed files with 166 additions and 17 deletions
+2 -2
View File
@@ -62,7 +62,7 @@ use util::{
use workspace::{
CloseActiveItem, CloseAllItems, CloseOtherItems, MoveItemToPaneInDirection, NavigationEntry,
OpenOptions, ViewId,
invalid_buffer_view::InvalidBufferView,
invalid_item_view::InvalidItemView,
item::{FollowEvent, FollowableItem, Item, ItemHandle, SaveOptions},
register_project_item,
};
@@ -26251,7 +26251,7 @@ async fn test_non_utf_8_opens(cx: &mut TestAppContext) {
assert_eq!(
handle.to_any().entity_type(),
TypeId::of::<InvalidBufferView>()
TypeId::of::<InvalidItemView>()
);
}
+3 -3
View File
@@ -42,7 +42,7 @@ use ui::{IconDecorationKind, prelude::*};
use util::{ResultExt, TryFutureExt, paths::PathExt};
use workspace::{
CollaboratorId, ItemId, ItemNavHistory, ToolbarItemLocation, ViewId, Workspace, WorkspaceId,
invalid_buffer_view::InvalidBufferView,
invalid_item_view::InvalidItemView,
item::{FollowableItem, Item, ItemBufferKind, ItemEvent, ProjectItem, SaveOptions},
searchable::{
Direction, FilteredSearchRange, SearchEvent, SearchableItem, SearchableItemHandle,
@@ -1392,8 +1392,8 @@ impl ProjectItem for Editor {
e: &anyhow::Error,
window: &mut Window,
cx: &mut App,
) -> Option<InvalidBufferView> {
Some(InvalidBufferView::new(abs_path, is_local, e, window, cx))
) -> Option<InvalidItemView> {
Some(InvalidItemView::new(abs_path, is_local, e, window, cx))
}
}