fix(tabs): refresh metadata on navigation

This commit is contained in:
2026-05-15 23:31:12 -04:00
parent ca8f118785
commit 225a998642
2 changed files with 62 additions and 0 deletions
+13
View File
@@ -429,6 +429,7 @@ impl BrowserCore {
TabUrlUpdate::PushHistory => self.tabs[tab_index].navigate_to(url),
TabUrlUpdate::PreserveHistory => self.tabs[tab_index].set_url(url),
}
self.refresh_tab_url_metadata(tab_index)?;
self.tabs[tab_index].mark_ready();
let snapshot_tab = self.tabs[tab_index].clone();
self.record_history_entry(&snapshot_tab);
@@ -450,6 +451,7 @@ impl BrowserCore {
return Ok(false);
};
self.refresh_tab_url_metadata(tab_index)?;
self.tabs[tab_index].mark_ready();
let snapshot_tab = self.tabs[tab_index].clone();
self.record_history_entry(&snapshot_tab);
@@ -457,6 +459,17 @@ impl BrowserCore {
Ok(true)
}
fn refresh_tab_url_metadata(&mut self, tab_index: usize) -> Result<(), CoreError> {
let title = tab_title(self.tabs[tab_index].url());
self.tabs[tab_index].set_title(title);
if let Some(favicon_key) = self.tabs[tab_index].url().favicon_url() {
self.tabs[tab_index].set_favicon_key(favicon_key)?;
} else {
self.tabs[tab_index].clear_favicon_key();
}
Ok(())
}
pub(super) fn build_tab(&self, url: UrlText) -> BrowserTab {
self.build_tab_for(self.active_space_id.clone(), self.active_profile_id.clone(), url)
.with_parent_tab_id(self.active_tab_id.clone())