From b96b61e6da8f3252f3b1db1cc65eb21ebac836cb Mon Sep 17 00:00:00 2001 From: Andrew Zambazos Date: Thu, 31 Jul 2025 21:41:21 +1200 Subject: [PATCH] Improve webview tab activation and styling Ensure the webviews container is visible when converting a home tab to a webview, and activate the converted tab in the UI. Also, update webview CSS to set width and height to 100% for better layout consistency. --- renderer/script.js | 6 ++++++ renderer/style.css | 2 ++ site-history.json | 4 +++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/renderer/script.js b/renderer/script.js index c829882..dadb7e9 100644 --- a/renderer/script.js +++ b/renderer/script.js @@ -276,6 +276,9 @@ function convertHomeTabToWebview(tabId, inputUrl, resolvedUrl) { const tab = tabs.find(t => t.id === tabId); if (!tab) return; + // Ensure webviews container is visible + const webviewsEl = document.getElementById('webviews'); + if (webviewsEl) webviewsEl.classList.remove('hidden'); // Create a new webview for this tab const webview = document.createElement('webview'); webview.id = `tab-${tabId}`; @@ -339,6 +342,9 @@ function convertHomeTabToWebview(tabId, inputUrl, resolvedUrl) { webview.classList.add('active'); updateNavButtons(); + // Activate converted webview tab and update UI + setActiveTab(tabId); + renderTabs(); } function handleNavigation(tabId, newUrl) { diff --git a/renderer/style.css b/renderer/style.css index a79d97b..e055104 100644 --- a/renderer/style.css +++ b/renderer/style.css @@ -136,6 +136,8 @@ html, body { #webviews webview { flex: 1; + width: 100%; + height: 100%; border: none; display: none; } diff --git a/site-history.json b/site-history.json index fcc5204..e558dde 100644 --- a/site-history.json +++ b/site-history.json @@ -1,7 +1,9 @@ [ - "https://www.youtube.com/", "https://github.com/", "file:///X:/Projects/Code/NebulaBrowser/renderer/index.html", + "file:///X:/Projects/Code/NebulaBrowser/renderer/index.html", + "https://www.youtube.com/", + "file:///X:/Projects/Code/NebulaBrowser/renderer/index.html", "https://youtube.com/", "file:///X:/Projects/Code/NebulaBrowser/renderer/index.html", "https://youtube.com/",