fix(android): hide the Databricks workspace nav chrome in the WebView shell - #4555
Merged
github-actions[bot] merged 1 commit intoAug 10, 2026
Conversation
… shell ## Related issue Closes # ## Summary - A workspace-hosted Omnigent is mounted as a Databricks workspace *page*, so the workspace wraps the SPA in its top-nav shell (the dark bar with the workspace switcher). In the Android shell that bar was still painted: it wastes vertical space and, worse, lets a user navigate into another workspace app with no way back into Omnigent. - The electron and iOS shells already hide it; port the same fix to Android. New `WorkspaceChromeScript` holds the CSS plus the install-once JS, and `OmnigentWebViewClient.onPageFinished` evaluates it on every finished pinned-origin load. - Keyed on the pinned origin, never on the URL path: the workspace serves the SPA on more than one mount (`/ml/omnigents`, `/omnigent`) and an auth redirect can land on neither, so a path guard leaves the chrome visible. The rule targets Omnigent's own `.omnigent-app` root rather than the monolith-owned nav markup, so it can't silently break when Databricks reshuffles its chrome, and is a no-op on standalone builds. ## Test Plan - `cd web/android && ./gradlew :app:testDebugUnitTest --tests '*WorkspaceChromeScriptTest' --tests '*OmnigentWebViewClientTest'` — 22 tests, all green. - New `WorkspaceChromeScriptTest` covers the CSS contract, the install-once guard, and that the CSS is embedded as an escaped JS string literal. - `OmnigentWebViewClientTest` now asserts injection order (chrome CSS before the facade, whose callback declares the page ready), injection without the facade fallback, that injection is *not* gated on the UI mount path, and that an off-origin load injects nothing. ## Demo N/A — logic-only parity port; the CSS is unchanged from the electron and iOS shells, which already ship this behaviour. ## Type of change - [x] Bug fix - [ ] Feature - [ ] UI / frontend change - [ ] Refactor / chore - [ ] Docs - [ ] Test / CI - [ ] Breaking change ## Test coverage - [x] Unit tests added / updated - [ ] Integration tests added / updated - [ ] E2E tests added / updated - [ ] Manual verification completed - [ ] Existing tests cover this change - [ ] Not applicable ## Coverage notes Unit tests cover the script contents and the injection points in the WebView client. The visual result is the same CSS the electron and iOS shells already apply. ## Changelog The Android app no longer shows the Databricks workspace navigation bar around Omnigent when connecting to a workspace-hosted server. Signed-off-by: Zeyi (Rice) Fan <zeyi.f@databricks.com>
fanzeyi
force-pushed
the
fanzeyi/android-hide-workspace-chrome
branch
from
August 10, 2026 22:38
729a4a4 to
8d660a8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related issue
Closes #
Summary
the workspace wraps the SPA in its top-nav shell (the dark bar with the
workspace switcher). In the Android shell that bar was still painted: it
wastes vertical space and, worse, lets a user navigate into another workspace
app with no way back into Omnigent.
New
WorkspaceChromeScriptholds the CSS plus the install-once JS, andOmnigentWebViewClient.onPageFinishedevaluates it on every finishedpinned-origin load.
SPA on more than one mount (
/ml/omnigents,/omnigent) and an authredirect can land on neither, so a path guard leaves the chrome visible. The
rule targets Omnigent's own
.omnigent-approot rather than themonolith-owned nav markup, so it can't silently break when Databricks
reshuffles its chrome, and is a no-op on standalone builds.
Test Plan
cd web/android && ./gradlew :app:testDebugUnitTest --tests '*WorkspaceChromeScriptTest' --tests '*OmnigentWebViewClientTest'— 22 tests, all green.WorkspaceChromeScriptTestcovers the CSS contract, the install-onceguard, and that the CSS is embedded as an escaped JS string literal.
OmnigentWebViewClientTestnow asserts injection order (chrome CSS beforethe facade, whose callback declares the page ready), injection without the
facade fallback, that injection is not gated on the UI mount path, and that
an off-origin load injects nothing.
Demo
Type of change
Test coverage
Coverage notes
Unit tests cover the script contents and the injection points in the WebView
client. The visual result is the same CSS the electron and iOS shells already
apply.
Changelog
The Android app no longer shows the Databricks workspace navigation bar around
Omnigent when connecting to a workspace-hosted server.
Signed-off-by: Zeyi (Rice) Fan zeyi.f@databricks.com