diff --git a/crates/weaver-app/assets/styling/notebook-cover.css b/crates/weaver-app/assets/styling/notebook-cover.css index 934414f..192d5d4 100644 --- a/crates/weaver-app/assets/styling/notebook-cover.css +++ b/crates/weaver-app/assets/styling/notebook-cover.css @@ -52,6 +52,8 @@ height: 48px; min-width: 48px; min-height: 48px; + max-width: 48px; + max-height: 48px; } .notebook-cover-description { diff --git a/crates/weaver-app/src/components/entry.rs b/crates/weaver-app/src/components/entry.rs index 446f6c0..abea2d1 100644 --- a/crates/weaver-app/src/components/entry.rs +++ b/crates/weaver-app/src/components/entry.rs @@ -463,7 +463,7 @@ pub fn EntryCard( rsx! { span { class: "embed-author entry-card-author", if let Some(ref avatar_url) = profile.avatar { - img { class: "embed-avatar", src: avatar_url.as_ref(), alt: "" } + img { class: "embed-avatar", src: avatar_url.as_ref(), alt: "", width: "42", height: "42" } } span { class: "embed-author-info", span { class: "embed-author-name", "{display_name}" } @@ -478,7 +478,7 @@ pub fn EntryCard( rsx! { span { class: "embed-author entry-card-author", if let Some(ref avatar_url) = profile.avatar { - img { class: "embed-avatar", src: avatar_url.as_ref(), alt: "" } + img { class: "embed-avatar", src: avatar_url.as_ref(), alt: "", width: "42", height: "42" } } span { class: "embed-author-info", span { class: "embed-author-name", "{display_name}" } @@ -629,7 +629,7 @@ pub fn FeedEntryCard( to: Route::RepositoryIndex { ident: AtIdentifier::Handle(handle.clone()) }, class: "embed-author entry-card-author", if let Some(ref avatar_url) = profile.avatar { - img { class: "embed-avatar", src: avatar_url.as_ref(), alt: "" } + img { class: "embed-avatar", src: avatar_url.as_ref(), alt: "", width: "42", height: "42" } } span { class: "embed-author-info", span { class: "embed-author-name", "{display_name}" } @@ -646,7 +646,7 @@ pub fn FeedEntryCard( to: Route::RepositoryIndex { ident: AtIdentifier::Handle(handle.clone()) }, class: "embed-author entry-card-author", if let Some(ref avatar_url) = profile.avatar { - img { class: "embed-avatar", src: avatar_url.as_ref(), alt: "" } + img { class: "embed-avatar", src: avatar_url.as_ref(), alt: "", width: "42", height: "42" } } span { class: "embed-author-info", span { class: "embed-author-name", "{display_name}" } @@ -762,7 +762,7 @@ pub fn EntryMetadata( to: Route::RepositoryIndex { ident: AtIdentifier::Handle(handle.clone()) }, class: "embed-author", if let Some(ref avatar_url) = profile.avatar { - img { class: "embed-avatar", src: avatar_url.as_ref(), alt: "" } + img { class: "embed-avatar", src: avatar_url.as_ref(), alt: "", width: "42", height: "42" } } span { class: "embed-author-info", span { class: "embed-author-name", "{display_name}" } @@ -779,7 +779,7 @@ pub fn EntryMetadata( to: Route::RepositoryIndex { ident: AtIdentifier::Handle(handle.clone()) }, class: "embed-author", if let Some(ref avatar_url) = profile.avatar { - img { class: "embed-avatar", src: avatar_url.as_ref(), alt: "" } + img { class: "embed-avatar", src: avatar_url.as_ref(), alt: "", width: "42", height: "42" } } span { class: "embed-author-info", span { class: "embed-author-name", "{display_name}" } diff --git a/crates/weaver-app/src/components/notebook_cover.rs b/crates/weaver-app/src/components/notebook_cover.rs index b045cc3..9622a04 100644 --- a/crates/weaver-app/src/components/notebook_cover.rs +++ b/crates/weaver-app/src/components/notebook_cover.rs @@ -130,7 +130,7 @@ fn NotebookAuthor(author: weaver_api::sh_weaver::notebook::AuthorListView<'stati rsx! { span { class: "embed-author notebook-author", if let Some(ref avatar) = p.avatar { - img { class: "embed-avatar", src: avatar.as_ref(), alt: "" } + img { class: "embed-avatar", src: avatar.as_ref(), alt: "", width: "48", height: "48" } } span { class: "embed-author-info", span { class: "embed-author-name", "{display_name}" } @@ -149,7 +149,7 @@ fn NotebookAuthor(author: weaver_api::sh_weaver::notebook::AuthorListView<'stati rsx! { span { class: "embed-author notebook-author", if let Some(ref avatar) = p.avatar { - img { class: "embed-avatar", src: avatar.as_ref(), alt: "" } + img { class: "embed-avatar", src: avatar.as_ref(), alt: "", width: "48", height: "48" } } span { class: "embed-author-info", span { class: "embed-author-name", "{display_name}" } diff --git a/crates/weaver-renderer/src/atproto/embed_renderer.rs b/crates/weaver-renderer/src/atproto/embed_renderer.rs index b4a14ff..488a8ab 100644 --- a/crates/weaver-renderer/src/atproto/embed_renderer.rs +++ b/crates/weaver-renderer/src/atproto/embed_renderer.rs @@ -250,7 +250,7 @@ fn render_profile_data_view( if let Some(avatar) = &profile.avatar { html.push_str("\"\""); + html.push_str("\" alt=\"\" width=\"42\" height=\"42\" />"); } html.push_str(""); if let Some(display_name) = &profile.display_name { @@ -288,7 +288,7 @@ fn render_profile_data_view( if let Some(avatar) = &profile.avatar { html.push_str("\"\""); + html.push_str("\" alt=\"\" width=\"42\" height=\"42\" />"); } html.push_str(""); if let Some(display_name) = &profile.display_name { @@ -573,12 +573,12 @@ fn render_author_block_inner( html.push_str("\" target=\"_blank\" rel=\"noopener\">"); html.push_str("\"\""); + html.push_str("\" alt=\"\" width=\"42\" height=\"42\" />"); html.push_str(""); } else { html.push_str("\"\""); + html.push_str("\" alt=\"\" width=\"42\" height=\"42\" />"); } } @@ -886,7 +886,7 @@ fn render_record_embed(record: &ViewUnionRecord<'_>) -> String { if let Some(avatar) = &generator.avatar { html.push_str("\"\""); + html.push_str("\" alt=\"\" width=\"42\" height=\"42\" />"); } html.push_str(""); html.push_str(""); @@ -927,7 +927,7 @@ fn render_record_embed(record: &ViewUnionRecord<'_>) -> String { if let Some(avatar) = &list.avatar { html.push_str("\"\""); + html.push_str("\" alt=\"\" width=\"42\" height=\"42\" />"); } html.push_str(""); html.push_str(""); @@ -968,7 +968,7 @@ fn render_record_embed(record: &ViewUnionRecord<'_>) -> String { if let Some(avatar) = &labeler.creator.avatar { html.push_str("\"\""); + html.push_str("\" alt=\"\" width=\"42\" height=\"42\" />"); } html.push_str(""); if let Some(name) = &labeler.creator.display_name { @@ -1001,7 +1001,7 @@ fn render_record_embed(record: &ViewUnionRecord<'_>) -> String { if let Some(avatar) = &sp.creator.avatar { html.push_str("\"\""); + html.push_str("\" alt=\"\" width=\"42\" height=\"42\" />"); } html.push_str(""); diff --git a/crates/weaver-renderer/src/css.rs b/crates/weaver-renderer/src/css.rs index 0fc8705..2eb5ac4 100644 --- a/crates/weaver-renderer/src/css.rs +++ b/crates/weaver-renderer/src/css.rs @@ -356,10 +356,10 @@ img {{ .embed-avatar {{ width: 42px; height: 42px; - min-width: 42px; - min-height: 42px; + max-width: 42px; + max-height: 42px; + aspect-ratio: 1; margin: 0; - flex-shrink: 0; object-fit: cover; }} @@ -617,6 +617,8 @@ a.embed-author-name:hover {{ height: 24px; min-width: 24px; min-height: 24px; + max-width: 24px; + max-height: 24px; }} .embed-quote .embed-content {{