Remove OpenClaw and Camera tabs from mobile dashboard#85
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 streamlines the mobile dashboard user interface by eliminating the OpenClaw and Camera features. The changes focus on removing these modules from the UI and navigation, ensuring a cleaner and more focused user experience without altering core build systems or backend components. 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
This pull request effectively removes the OpenClaw and Camera tabs from the mobile dashboard UI. The changes in ninja_mobile_new.html correctly remove the corresponding sections and navigation buttons, and replacing the video icon with a static image is a good performance improvement. The JavaScript changes in dashboard.js correctly update the tab routing logic. I've identified one area for improvement regarding duplicated code in the JavaScript file, which could enhance the long-term maintainability of the code.
| 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 === "cameras" || (state.activeTab === "devices" && state.deviceMapMode)); | ||
| app?.classList.toggle("media-tab-active", state.activeTab === "networks" || state.activeTab === "speedtest" || (state.activeTab === "devices" && state.deviceMapMode)); |
There was a problem hiding this comment.
The logic for determining if a tab is a 'media tab' is duplicated here and in the setTab function (line 500). This creates a maintenance burden, as any future changes to this logic will need to be made in two places.
To improve maintainability and adhere to the DRY (Don't Repeat Yourself) principle, consider extracting this logic into a dedicated helper function. For example:
function isMediaTab(tabName, deviceMapMode) {
const mediaTabs = new Set(["networks", "speedtest"]);
return mediaTabs.has(tabName) || (tabName === "devices" && deviceMapMode);
}You can then call this function in both setDeviceMapMode and setTab:
// In setDeviceMapMode
app?.classList.toggle("media-tab-active", isMediaTab(state.activeTab, state.deviceMapMode));
// In setTab
app?.classList.toggle("media-tab-active", isMediaTab(resolvedTab, state.deviceMapMode));
Motivation
Description
#tab-openclawand#tab-cameras) fromweb-ui/ninja_mobile_new.htmlso those pages are no longer rendered.tabbtn-openclawandtabbtn-cameras) fromweb-ui/ninja_mobile_new.htmlso they do not appear in the tab bar.web-ui/ninja_mobile_new.htmlto remove OpenClaw branding in the main chrome.web-ui/js/dashboard.jsby removingopenclawandcamerasfromallowedTabsand from themedia-tab-activetoggles so navigation/state can't resolve to the removed tabs.web-ui/ninja_mobile_new.html,web-ui/js/dashboard.js.Testing
./gradlew :app:assembleDebugwhich failed in this environment due to missing Android SDK configuration (ANDROID_HOME/local.properties); build could not be validated here../gradlew testand./gradlew lint; both failed for the same missing Android SDK location in this environment and therefore could not run.web-ui/ninja_mobile_new.htmlto confirm that OpenClaw and Cameras entries were removed from the bottom nav and the header badge was updated; screenshot artifact saved during run (dashboard_no_openclaw_camera.png).allowedTabsno longer includesopenclaw/camerasand thatmedia-tab-activelogic was updated inweb-ui/js/dashboard.js.Notes: no Gradle/AGP/Kotlin versions, package names, modules, or build files were changed; modifications are limited to UI markup and client-side tab routing only. Please run the following locally to fully validate build/test:
./gradlew :app:assembleDebug,./gradlew test,./gradlew lint.Codex Task