From f2ab7302abce113804b156d5380b731f4b6fbd6e Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Sat, 24 Jan 2026 18:29:26 +0000 Subject: [PATCH] =?UTF-8?q?fix(ai):=20frontend=20console=20error=20?= =?UTF-8?q?=E2=80=94=20double=20load=20and=20lint=20fixes=20(agent)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- css/tailwind.source.css | 2 +- css/tokens.css | 1 + js/app.js | 31 +-------------------------- js/ui/components/SearchFilterModal.js | 6 ++++-- scripts/agent/debug_frontend.py | 11 ++++++---- server.log | 1 - 6 files changed, 14 insertions(+), 38 deletions(-) delete mode 100644 server.log diff --git a/css/tailwind.source.css b/css/tailwind.source.css index df2a6e1d..02fbc6cf 100644 --- a/css/tailwind.source.css +++ b/css/tailwind.source.css @@ -492,7 +492,7 @@ @media (min-width: theme("screens.md")) { .search-filters-panel.is-advanced-open { - width: 40rem; + width: var(--size-40rem); } } diff --git a/css/tokens.css b/css/tokens.css index e2020f53..4c7d1fae 100644 --- a/css/tokens.css +++ b/css/tokens.css @@ -321,6 +321,7 @@ --size-20rem: 20rem; --size-28rem: 28rem; --size-34rem: 34rem; + --size-40rem: 40rem; --size-45rem: 45rem; --size-70rem: 70rem; diff --git a/js/app.js b/js/app.js index 99e6dbd5..65de9dc1 100644 --- a/js/app.js +++ b/js/app.js @@ -895,36 +895,7 @@ class Application { ); }) || Promise.resolve(); - // 6) Load the default view ONLY if there's no #view= already - if (!window.location.hash || !window.location.hash.startsWith("#view=")) { - devLogger.log( - "[app.init()] No #view= in the URL, loading default home view" - ); - const defaultView = this.isUserLoggedIn() - ? "views/for-you.html" - : "views/most-recent-videos.html"; - if (typeof this.loadView === "function") { - await Promise.all([ - this.loadView(defaultView), - watchHistoryInitPromise, - ]); - } else { - await watchHistoryInitPromise; - } - } else { - devLogger.log( - "[app.init()] Found hash:", - window.location.hash, - "so skipping default load" - ); - await watchHistoryInitPromise; - } - - // 7. Once loaded, get a reference to #videoList - this.mountVideoListView(); - - // 8. Subscribe or fetch videos - await this.loadVideos(); + await watchHistoryInitPromise; // 9. Check URL ?v= param this.checkUrlParams(); diff --git a/js/ui/components/SearchFilterModal.js b/js/ui/components/SearchFilterModal.js index 8e1bdcbe..9fa66d52 100644 --- a/js/ui/components/SearchFilterModal.js +++ b/js/ui/components/SearchFilterModal.js @@ -168,10 +168,12 @@ function toggleAdvanced(forceState = null) { if (newState) { advancedPanel.classList.remove("hidden"); - advancedChevron.style.transform = "rotate(180deg)"; + advancedChevron.classList.add("rotate-180"); + advancedChevron.classList.remove("rotate-0"); } else { advancedPanel.classList.add("hidden"); - advancedChevron.style.transform = "rotate(0deg)"; + advancedChevron.classList.add("rotate-0"); + advancedChevron.classList.remove("rotate-180"); } } diff --git a/scripts/agent/debug_frontend.py b/scripts/agent/debug_frontend.py index d9f76dcb..3bb97531 100644 --- a/scripts/agent/debug_frontend.py +++ b/scripts/agent/debug_frontend.py @@ -1,8 +1,9 @@ -import sys from playwright.sync_api import sync_playwright +import sys def run(): with sync_playwright() as p: + # Launch browser browser = p.chromium.launch() page = browser.new_page() @@ -12,12 +13,14 @@ def run(): # Listen for uncaught exceptions page.on("pageerror", lambda exc: print(f"pageerror: {exc}")) - # Listen for failed network requests + # Listen for failed requests page.on("requestfailed", lambda req: print(f"requestfailed: {req.url} {req.failure}")) - print("Navigating to http://localhost:8000 ...") try: - page.goto("http://localhost:8000", wait_until="networkidle") + print("Navigating to http://localhost:8000") + page.goto("http://localhost:8000") + # Wait for a bit to capture initial errors + page.wait_for_timeout(5000) except Exception as e: print(f"Navigation failed: {e}") diff --git a/server.log b/server.log deleted file mode 100644 index 40bff257..00000000 --- a/server.log +++ /dev/null @@ -1 +0,0 @@ -127.0.0.1 - - [23/Jan/2026 18:34:01] "GET /js/ui/components/SearchFiltersPopover.js HTTP/1.1" 200 -