From 61848a591df84921a0f47d484f90017fee1cb54b Mon Sep 17 00:00:00 2001 From: SHU-red Date: Sun, 26 Oct 2025 11:53:22 +0000 Subject: [PATCH 1/6] Fixed defaults --- extension.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/extension.php b/extension.php index 8fc7e8f..437bbc5 100644 --- a/extension.php +++ b/extension.php @@ -112,22 +112,22 @@ private function generateNextEntryButton(): string { } public function showPreviousEntryButton(): bool { - return $this->getUserConfigurationValue('show_previous_entry_button'); + return (bool) ($this->getUserConfigurationValue('show_previous_entry_button') ?? true); } public function showSeeOnWebSiteButton(): bool { - return $this->getUserConfigurationValue('show_see_on_website_button'); + return (bool) ($this->getUserConfigurationValue('show_see_on_website_button') ?? true); } public function showUpButton(): bool { - return $this->getUserConfigurationValue('show_up_button'); + return (bool) ($this->getUserConfigurationValue('show_up_button') ?? true); } public function showFavoriteButton(): bool { - return $this->getUserConfigurationValue('show_favorite_button'); + return (bool) ($this->getUserConfigurationValue('show_favorite_button') ?? true); } public function showNextEntryButton(): bool { - return $this->getUserConfigurationValue('show_next_entry_button'); + return (bool) ($this->getUserConfigurationValue('show_next_entry_button') ?? true); } } From 5519a18febd0913ad31bbacfb9eb7369be8d56a3 Mon Sep 17 00:00:00 2001 From: SHU-red Date: Sat, 4 Apr 2026 17:40:12 +0200 Subject: [PATCH 2/6] fix: use string hook name for compatibility --- extension.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/extension.php b/extension.php index 437bbc5..706b1b8 100644 --- a/extension.php +++ b/extension.php @@ -8,11 +8,8 @@ class EnhancedNavigationExtension extends Minz_Extension { public function init(): void { $this->registerTranslates(); - if (version_compare(FRESHRSS_VERSION, '1.28') >= 0) { - $this->registerHook(Minz_HookType::NavEntries, [$this, 'generateEnhancedNavigation']); - } else { - $this->registerHook('nav_entries', [$this, 'generateEnhancedNavigation']); - } + // Use string hook name for compatibility with all versions + $this->registerHook('nav_entries', [$this, 'generateEnhancedNavigation']); Minz_View::appendStyle($this->getFileUrl('navigation.css', 'css')); Minz_View::appendScript($this->getFileUrl('navigation.js', 'js')); From 758a3c389dc5762a84b5040fe96033dae234a40d Mon Sep 17 00:00:00 2001 From: SHU-red Date: Sat, 4 Apr 2026 17:42:35 +0200 Subject: [PATCH 3/6] feat: add debugging to help diagnose button display issue --- extension.php | 7 ++++++- static/navigation.js | 6 ++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/extension.php b/extension.php index 706b1b8..0d1f87a 100644 --- a/extension.php +++ b/extension.php @@ -50,7 +50,7 @@ private function computeButtonWidth(): int { } public function generateEnhancedNavigation(): string { - return << NAV; + + // Debug: log to FreshRSS error log + error_log("EnhancedNavigation: Generated HTML: " . $html); + + return $html; } private function generateButton(string $class, string $title, string $icon): string { diff --git a/static/navigation.js b/static/navigation.js index 6301949..48f66d8 100644 --- a/static/navigation.js +++ b/static/navigation.js @@ -1,5 +1,11 @@ function init_nav_entries_enhanced() { + console.log('EnhancedNavigation: Initializing...'); const nav_entries = document.getElementById('nav_entries_enhanced'); + if (!nav_entries) { + console.log('EnhancedNavigation: nav_entries_enhanced element not found'); + } else { + console.log('EnhancedNavigation: nav_entries_enhanced element found'); + } if (nav_entries) { nav_entries.querySelector('.previous_entry').onclick = function (e) { prev_entry(false); From b8931f7ab7dd71249bab1baee0456220bf1491d2 Mon Sep 17 00:00:00 2001 From: SHU-red Date: Sat, 4 Apr 2026 17:44:25 +0200 Subject: [PATCH 4/6] fix: improve mobile responsiveness and button handling --- static/navigation.css | 7 +++- static/navigation.js | 79 +++++++++++++++++++++++++++---------------- 2 files changed, 55 insertions(+), 31 deletions(-) diff --git a/static/navigation.css b/static/navigation.css index 71cc67e..3a1372e 100644 --- a/static/navigation.css +++ b/static/navigation.css @@ -6,7 +6,7 @@ display: table; position: fixed; bottom: 0rem; left: 0; - width: 300px; + width: 100%; table-layout: fixed; padding-bottom: env(safe-area-inset-bottom); z-index: 50; @@ -39,4 +39,9 @@ #nav_entries_enhanced { width: 100%; } + + #nav_entries_enhanced button { + font-size: 0.9rem; + padding: 0 0.3rem; + } } diff --git a/static/navigation.js b/static/navigation.js index 48f66d8..36f43fa 100644 --- a/static/navigation.js +++ b/static/navigation.js @@ -7,36 +7,55 @@ function init_nav_entries_enhanced() { console.log('EnhancedNavigation: nav_entries_enhanced element found'); } if (nav_entries) { - nav_entries.querySelector('.previous_entry').onclick = function (e) { - prev_entry(false); - return false; - }; - nav_entries.querySelector('.next_entry').onclick = function (e) { - next_entry(false); - return false; - }; - nav_entries.querySelector('.up').onclick = function (e) { - const active_item = (document.querySelector('.flux.current') || document.querySelector('.flux')); - const windowTop = document.scrollingElement.scrollTop; - const item_top = active_item.offsetParent.offsetTop + active_item.offsetTop; - const nav_menu = document.querySelector('.nav_menu'); - let nav_menu_height = 0; - if (getComputedStyle(nav_menu).position === 'fixed' || getComputedStyle(nav_menu).position === 'sticky') { - nav_menu_height = nav_menu.offsetHeight; - } - document.scrollingElement.scrollTop = windowTop > item_top ? item_top - nav_menu_height : 0 - nav_menu_height; - return false; - }; - nav_entries.querySelector('.favorite').onclick = function (e) { - const active_item = (document.querySelector('.flux.current') || document.querySelector('.flux')); - mark_favorite(active_item); - return false; - }; - nav_entries.querySelector('.link').onclick = function (e) { - const active_item = (document.querySelector('.flux.current') || document.querySelector('.flux')); - window.open(active_item.dataset.link, '_blank'); - return false; - }; + const previousBtn = nav_entries.querySelector('.previous_entry'); + if (previousBtn) { + previousBtn.onclick = function (e) { + prev_entry(false); + return false; + }; + } + + const nextBtn = nav_entries.querySelector('.next_entry'); + if (nextBtn) { + nextBtn.onclick = function (e) { + next_entry(false); + return false; + }; + } + + const upBtn = nav_entries.querySelector('.up'); + if (upBtn) { + upBtn.onclick = function (e) { + const active_item = (document.querySelector('.flux.current') || document.querySelector('.flux')); + const windowTop = document.scrollingElement.scrollTop; + const item_top = active_item.offsetParent.offsetTop + active_item.offsetTop; + const nav_menu = document.querySelector('.nav_menu'); + let nav_menu_height = 0; + if (getComputedStyle(nav_menu).position === 'fixed' || getComputedStyle(nav_menu).position === 'sticky') { + nav_menu_height = nav_menu.offsetHeight; + } + document.scrollingElement.scrollTop = windowTop > item_top ? item_top - nav_menu_height : 0 - nav_menu_height; + return false; + }; + } + + const favoriteBtn = nav_entries.querySelector('.favorite'); + if (favoriteBtn) { + favoriteBtn.onclick = function (e) { + const active_item = (document.querySelector('.flux.current') || document.querySelector('.flux')); + mark_favorite(active_item); + return false; + }; + } + + const linkBtn = nav_entries.querySelector('.link'); + if (linkBtn) { + linkBtn.onclick = function (e) { + const active_item = (document.querySelector('.flux.current') || document.querySelector('.flux')); + window.open(active_item.dataset.link, '_blank'); + return false; + }; + } } } From e1dea985496266a29eb30a887c5fefc9ecac5f40 Mon Sep 17 00:00:00 2001 From: SHU-red Date: Sat, 4 Apr 2026 17:46:17 +0200 Subject: [PATCH 5/6] fix: restore desktop navbar width and improve mobile button visibility --- static/navigation.css | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/static/navigation.css b/static/navigation.css index 3a1372e..f6100b4 100644 --- a/static/navigation.css +++ b/static/navigation.css @@ -6,7 +6,7 @@ display: table; position: fixed; bottom: 0rem; left: 0; - width: 100%; + width: 300px; table-layout: fixed; padding-bottom: env(safe-area-inset-bottom); z-index: 50; @@ -43,5 +43,17 @@ #nav_entries_enhanced button { font-size: 0.9rem; padding: 0 0.3rem; + min-width: 0; /* Allow buttons to shrink */ + overflow: hidden; /* Prevent content overflow */ + white-space: nowrap; /* Prevent text wrapping */ + } + + /* Ensure buttons take equal space and don't disappear */ + #nav_entries_enhanced { + table-layout: fixed; + } + + #nav_entries_enhanced button { + width: 1%; /* Distribute space equally */ } } From 0992659c44bc5d63b799205ce0002652a0b3edd2 Mon Sep 17 00:00:00 2001 From: SHU-red Date: Sat, 4 Apr 2026 17:48:04 +0200 Subject: [PATCH 6/6] debug: add visual indicators and hide mobile navigation --- extension.php | 2 +- static/navigation.css | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/extension.php b/extension.php index 0d1f87a..837abd4 100644 --- a/extension.php +++ b/extension.php @@ -51,7 +51,7 @@ private function computeButtonWidth(): int { public function generateEnhancedNavigation(): string { $html = <<