Fix web UI navigation reliability and bottom-nav label rendering#84
Conversation
Summary of ChangesHello @aztr0nutzs, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses several critical web UI issues to enhance user experience and application stability. It resolves navigation failures caused by missing action button IDs, corrects the display of the cameras tab to use the intended full-bleed media layout, and eliminates mojibake issues by replacing non-ASCII characters and emojis with ASCII-safe alternatives in navigation labels and icons. These changes collectively improve the robustness and visual consistency of the web interface across different devices. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
The pull request effectively addresses reported issues with web UI navigation reliability and rendering. By replacing non-ASCII characters and emojis with ASCII-safe alternatives, it resolves potential mojibake issues on various devices. The inclusion of the "cameras" tab in the media layout ensures a consistent full-bleed experience for media-centric pages. Additionally, the hardening of event listener registrations in the device-detail view improves runtime stability. My feedback focuses on improving the maintainability of the tab-switching logic.
| document.getElementById("nnDeviceListBtn")?.classList.toggle("active", !state.deviceMapMode); | ||
| const app = document.getElementById("app"); | ||
| app?.classList.toggle("media-tab-active", state.activeTab === "networks" || state.activeTab === "openclaw" || state.activeTab === "speedtest" || (state.activeTab === "devices" && state.deviceMapMode)); | ||
| app?.classList.toggle("media-tab-active", state.activeTab === "networks" || state.activeTab === "openclaw" || state.activeTab === "speedtest" || state.activeTab === "cameras" || (state.activeTab === "devices" && state.deviceMapMode)); |
There was a problem hiding this comment.
The list of tabs that trigger the media layout is becoming long and is duplicated in multiple places. Refactoring this to use an array with .includes() would improve maintainability and readability, making it easier to add or remove tabs in the future.
| app?.classList.toggle("media-tab-active", state.activeTab === "networks" || state.activeTab === "openclaw" || state.activeTab === "speedtest" || state.activeTab === "cameras" || (state.activeTab === "devices" && state.deviceMapMode)); | |
| app?.classList.toggle("media-tab-active", ["networks", "openclaw", "speedtest", "cameras"].includes(state.activeTab) || (state.activeTab === "devices" && state.deviceMapMode)); |
|
|
||
| const app = document.getElementById("app"); | ||
| app?.classList.toggle("media-tab-active", tab === "networks" || tab === "openclaw" || tab === "speedtest" || (tab === "devices" && state.deviceMapMode)); | ||
| app?.classList.toggle("media-tab-active", tab === "networks" || tab === "openclaw" || tab === "speedtest" || tab === "cameras" || (tab === "devices" && state.deviceMapMode)); |
There was a problem hiding this comment.
Similar to the logic in setDeviceMapMode, using an array for the media tab check here would improve consistency and maintainability.
| app?.classList.toggle("media-tab-active", tab === "networks" || tab === "openclaw" || tab === "speedtest" || tab === "cameras" || (tab === "devices" && state.deviceMapMode)); | |
| app?.classList.toggle("media-tab-active", ["networks", "openclaw", "speedtest", "cameras"].includes(tab) || (tab === "devices" && state.deviceMapMode)); |
Motivation
android-app/src/main/assets/web-ui/js/dashboard.js(around the device-detail render block, ~L750-L780).dashboard.js(navigation/media-mode toggle at ~L463-L491).android-app/src/main/assets/web-ui/ninja_mobile_new.htmlbottom-nav icon nodes (~L505-L541) and related CSS emoji font fallback inandroid-app/src/main/assets/web-ui/css/dashboard.css(~L698-L709).Description
#mPause,#mBlock,#mTrust,#mPort) inandroid-app/src/main/assets/web-ui/js/dashboard.js(changed listener bindings at the device-detail wiring near ~L774-L780).camerastab in the media layout activation so media-style pages get full-bleed behavior, updating both media-mode checks inandroid-app/src/main/assets/web-ui/js/dashboard.js(~L463-L471 and ~L489-L491).android-app/src/main/assets/web-ui/ninja_mobile_new.html(bottom-nav icons and text replacements around ~L507-L540 and top labels at ~L24-L81)..tabbtn .ticonstyling inandroid-app/src/main/assets/web-ui/css/dashboard.css(~L698-L709).Testing
./gradlew :app:assembleDebug,./gradlew testand./gradlew lintas required by repository rules, but all three fail in this environment due to missing Android SDK location (ANDROID_HOME/local.properties), not code errors.cameras(local check againsthttp://127.0.0.1:8787/ninja_mobile_new.htmlsucceeded)../gradlew :app:assembleDebug,./gradlew test, and./gradlew lint.Codex Task