Skip to content

Hide status and navigation bar setting (fixes burger menu with hideNavbar) - #1379

Merged
TAKeanice merged 40 commits into
developfrom
mainui-js-bridge-fixes
Nov 14, 2026
Merged

TAKeanice merged 40 commits into
developfrom
mainui-js-bridge-fixes

Conversation

@TAKeanice

@TAKeanice TAKeanice commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #1375

Adds an app setting that hides the status bar, the navigation bar and the menu button, so pages that request hideNavbar=true no longer leave an empty bar with a burger menu.

Decisions on the menu bar hiding:

  • The bars are hidden by an app setting, also exposed in the iOS Settings app.
  • Holding three fingers on the screen shows the bars for a few seconds, so the menu stays reachable.
  • A page made without a navbar hides the bars and explains the way back.
  • Under Guided Access the bars are hidden and the reveal gesture is turned off.
  • The bars are never hidden while VoiceOver or Switch Control is on.
  • In the app settings, the toggle has its own section so the explanation footer clearly belongs to it.
  • The three-finger hold runs on a window recognizer that never takes the touches from the page. It follows the fingers that are down, in any landing order, and each may drift 40 pt: fingers held flat on a phone are far less steady than one in a long press, and a stricter rule failed silently on a device.
  • While the bars are hidden, a dot per finger shows in the top right corner and the dots meet over the hold time, so a failed hold is visible.

🤖 Generated with Claude Code

TAKeanice and others added 10 commits October 28, 2026 21:58
The menu data could show the previous home's pages: a fetch that was
still running when the home was switched wrote its result into the
freshly cleared menu.

MenuDataService now loads the server properties, sitemaps, tiles and
pages in one task each. Starting a load cancels the one before it,
and clearAll()/clearForHomeSwitch() cancel all of them. A task checks
for cancellation and hands over its data without a suspension point
in between, on the main actor, so a cancelled load can never write.
Parts apply independently instead of waiting for the slowest one.

Remove hasSuccessfullyLoaded: it only hid the Home row until the
first load and had no documented purpose. The Home row is always
shown now.

Tests for the removed flag and for the removed whileLoading /
refresh(running:) helpers are deleted; the cancellation behaviour
still needs tests.

Co-Authored-By: Claude Code <noreply@anthropic.com>

Signed-off-by: Tassilo Karge <tassilo.karge@web.de>
The network tracker publishes its whole state on every change of
status, retry deadline, reachability and connection, so one new
connection reached MenuDataService as several states with the same
activeConnection. Each of them started the four loads again, and each
cancelled the one before.

MenuDataService now remembers the previous connection and loads only
when it differs, including the nil between two homes that share a
connection. Reload on menu open, pull-to-refresh and the reload button
still always load.

Co-Authored-By: Claude Code <noreply@anthropic.com>

Signed-off-by: Tassilo Karge <tassilo.karge@web.de>
.agents/docs/MENU_DATA_SERVICE_TESTS.md records what the MenuDataService
tests deleted with the per-part loading change covered, the behaviour
that has no test yet, and follow-ups (review of the root-view-tabbed-
swiftui branches, adding swift-async-algorithms, remaining Combine
imports).

ToolbarMenuUITests gets two smoke tests that tap the real menu button:
right after launch, and after picking a home in the menu. Neither fails
on the code as it was; the menu is unresponsive for about 1.2 to 1.4 s
while its popover is dismissed, which is the system transition and is
not covered.

Co-Authored-By: Claude Code <noreply@anthropic.com>

Signed-off-by: Tassilo Karge <tassilo.karge@web.de>
…rithms

Result of scanning all local and remote branches and the open PRs, so the
Combine follow-up can start from it.

Co-Authored-By: Claude Code <noreply@anthropic.com>

Signed-off-by: Tassilo Karge <tassilo.karge@web.de>
… them with three fingers

The "Hide Status Bar" setting hid only the status bar, and since the native
navigation bar it did nothing at all (#1375). It now hides the status bar,
the navigation bar and the menu button on Main UI, tiles and sitemaps.

Hidden bars must not trap the user, so:
- holding three fingers on the screen shows them for 8 seconds. A custom
  recognizer on the window takes the touches when the third finger lands,
  so the page and its scrolling give way, and fails if a finger moves or lifts.
  Its rules live in ThreeFingerHoldTracker so they can be tested without touches.
- they stay while the menu is open
- they stay while there is no connection or Main UI has not loaded, since the
  connection indicator is in the bar
- the setting's footer explains how to get them back

The toggle is renamed, so the old string is replaced (English and German).

Tests: ThreeFingerHoldTrackerTests, BarVisibilityTests and HiddenBarsUITests.
XCUITest cannot hold three fingers, so the UI test runs the reveal through the
UITestRevealBarsAfter hook.

Co-Authored-By: Claude Code <noreply@anthropic.com>
Signed-off-by: Tassilo Karge <tassilo.karge@web.de>
A user who hid the bars and cannot reach the in-app setting can switch it off
in Settings > openHAB. The Settings app writes to the standard defaults, the
app keeps its settings in the app group's, so HideBarsSystemSetting reconciles
the two on launch, after a settings save and whenever the app becomes active:
a difference means the switch was changed in the Settings app, which wins.

Co-Authored-By: Claude Code <noreply@anthropic.com>
Signed-off-by: Tassilo Karge <tassilo.karge@web.de>
… gesture

Guided Access is iOS's own kiosk mode and has its own way out, a triple click
of the side button that asks for the passcode. So while it is on, the bars are
hidden whatever the setting says and holding three fingers does nothing, which
leaves that exit as the only one. An error or an unloaded page still shows the
bars. The state is read at start and on guidedAccessStatusDidChange.

The UI tests decide for themselves whether they run under Guided Access
(UITestGuidedAccess), and read the bars' state from a report instead of the
menu button, which is also shown during launch before the setting is read.

Co-Authored-By: Claude Code <noreply@anthropic.com>
Signed-off-by: Tassilo Karge <tassilo.karge@web.de>
… the way back

A Main UI page with hideNavbar (kiosk mode) left the system bar on screen as an
empty bar with the menu button (#1375). The shim now sends noNavbar in
navbar.state for a page rendered without a navbar, as opposed to one whose
navbar scrolled away, and BarVisibility hides the bars for it, like the setting.
The page only counts once it has held for 300 ms, so a page change in which the
new page is up before its navbar does not make the bar flicker.

The same three-finger hold shows the bars again. The person at the device may
not know that, since the page's author chose it, so a toast explains it the
first time a page hides the bars.

Tests: the shim's report, the model's rules, and a UI test with a page without
navbar. The UI tests now read the bars' state from reports, not from the menu
button, whose queries are too slow to catch a reveal.

Co-Authored-By: Claude Code <noreply@anthropic.com>
Signed-off-by: Tassilo Karge <tassilo.karge@web.de>
VoiceOver takes the touches for its own gestures and Switch Control has none,
so neither can hold three fingers on the screen, and the people who use them
need the menu button and the connection indicator more than a clear page.
While either is on, nothing is hidden, whatever the setting, the page or
Guided Access says, and the gesture is off. The bars hide again when it is
turned off. Both are read at start and on their status change notifications.

AssistiveTouch is left out on purpose: it is also how wall tablets get a
home button, which is the case the setting is for.

The footer of the setting, in the app and in the Settings app, says so.

Co-Authored-By: Claude Code <noreply@anthropic.com>
Signed-off-by: Tassilo Karge <tassilo.karge@web.de>
…ion belongs to it

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: Tassilo Karge <tassilo.karge@web.de>
@TAKeanice
TAKeanice marked this pull request as draft October 31, 2026 09:50
TAKeanice and others added 2 commits October 31, 2026 13:44
…gs, port the web menu UI tests

- Each finger may drift 40 pt instead of 12 before the hold fails.
- Order the types as SwiftLint expects, name files after their types, and split
  the long view bodies that were slow to type-check.
- WebMenuUITests drove a menu built from the page's menu.state, which the
  native menu no longer reads. Remove it and add the cases that still matter
  to AdministrationAccessUITests: the account entry, tapping the lock, and the
  remembered open/closed state.
- AGENTS.md: prefer the Xcode MCP for editing files.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: Tassilo Karge <tassilo.karge@web.de>
While the bars are hidden nothing says that fingers are down or that the hold
is running. A dot per finger shows in the top right corner, moving into one
over the hold time. It is only there while the bars are hidden.

The hold itself now follows the fingers that are down instead of failing at the
first one that lifts: the fingers may land in any order, a finger that lifts or
lands restarts the hold, and the recognizer no longer takes the touches from the
page. Each finger may drift 40 pt.

- Tracker rules and 15 tests for them.
- UI tests for the indicator's count, place and absence while the bars show.
- German translation of the indicator's accessibility label.
- Order the test helpers as SwiftLint expects.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: Tassilo Karge <tassilo.karge@web.de>
@TAKeanice
TAKeanice marked this pull request as ready for review October 31, 2026 14:56
TAKeanice and others added 3 commits October 31, 2026 19:21
They sat inside the top safe area, below the camera cutout. The indicator now
ignores it and reads the safe area to place itself: centred in the band beside
a cutout or the Dynamic Island where there is one, else near the top edge, and
inset from the side by the safe area plus enough to clear the display's rounded
corner (and the iPhone Duo's hinge, which the side inset covers).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: Tassilo Karge <tassilo.karge@web.de>
Spanish, Finnish, French, Italian, Norwegian Bokmål, Dutch and Russian for the
setting, its explanation, the toast and the indicator's accessibility label.
German was already there.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: Tassilo Karge <tassilo.karge@web.de>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: Tassilo Karge <tassilo.karge@web.de>
@TAKeanice

TAKeanice commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor Author

@timbms can we create a testflight version from this especially for @egoist6 , so he can test whether these changes meet his taste?
I can now see that several variations of settings for the MainUI pages are clashing with the button-in-menubar design, especially because the menu bar does not capture a non-hidden MainUI menu button on the top left, but for the case where both are hidden, menu bar hiding works.
Also, not sure whether we really should make the "hide status bar" setting of the app also "hide menu bar" or to separate the settings. @DigiH what´s your opinion here?

@TAKeanice
TAKeanice requested a review from digitaldan November 1, 2026 09:08
@DigiH

DigiH commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Also, not sure whether we really should make the "hide status bar" setting of the app also "hide menu bar" or to separate the settings. @DigiH what´s your opinion here?

I think it should work as before, with a discrete Hide Status Bar, and a separate new Hide Navigation Bar, allowing for any combination other users might want, not just one single use case.

…settings

"Hide Status Bar" is back as its own setting and only hides the status bar.
"Hide Navigation Bar" hides the navigation bar with the menu button, and
the three-finger hold, the reveal and the dots apply to it alone, as the
status bar cannot leave anyone stuck.

The iOS Settings app switch is now hide_navigation_bar_preference.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: Tassilo Karge <tassilo.karge@web.de>
@TAKeanice

Copy link
Copy Markdown
Contributor Author

Also, not sure whether we really should make the "hide status bar" setting of the app also "hide menu bar" or to separate the settings. @DigiH what´s your opinion here?

I think it should work as before, with a discrete Hide Status Bar, and a separate new Hide Navigation Bar, allowing for any combination other users might want, not just one single use case.

We now have an app setting for hiding the status bar and one for hiding the navigation bar. Hide navigation bar on a MainUI page now also hides it, as well as guided access.

@digitaldan what are your thoughts on the other MainUI page options, like hideMenuButton, how should they (inter)act with the navigation bar setting?

TAKeanice and others added 4 commits November 1, 2026 18:39
The indicator read the safe area inside the view that ignores it, which reported
no inset, so the dots always sat 8 points from the top. It is now read outside,
and the dots go below the status bar while "Hide Status Bar" is off.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: Tassilo Karge <tassilo.karge@web.de>
Replaces the "prefer" wording with one rule: when the Xcode MCP is available,
use its tools instead of any other tool for what they can do. AGENTS.md and
.agents/ are part of the Xcode project, so they are not an exception.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Signed-off-by: Tassilo Karge <tassilo.karge@web.de>
Signed-off-by: openhab-bot <info@openhabfoundation.org>
…ixes

Signed-off-by: Tassilo Karge <tassilo.karge@web.de>

# Conflicts:
#	CHANGELOG.md
#	Version.xcconfig
@TAKeanice
TAKeanice force-pushed the mainui-js-bridge-fixes branch from 50be833 to 7418dfe Compare November 1, 2026 22:11
Signed-off-by: openhab-bot <info@openhabfoundation.org>
@timbms

timbms commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

TestFlight version is available. @egoist6 please test 3.4.38 (336)

@egoist6

egoist6 commented Nov 4, 2026

Copy link
Copy Markdown

TestFlight version is available. @egoist6 please test 3.4.38 (336)

Sure. Waiting for the version to become available. As soon as it’s available I’ll have a look.

@digitaldan

digitaldan commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Nice work!

timbms and others added 3 commits November 5, 2026 16:52
pageMarks fails on CI with no marks at all, even after 60 seconds, but
passes locally, and the CI log keeps no failure text. On a timeout,
record what the page did: its navigation steps with times and errors,
whether the web content process ended, the requests the fake server
answered, and the web view's state. Write it to stderr as well, since
the CI log's formatter drops the text of Swift Testing issues.

Signed-off-by: Tim Mueller-Seydlitz <timbms@gmail.com>
@TAKeanice

Copy link
Copy Markdown
Contributor Author

Nice work!

Thanks @digitaldan !

As our MainUI connoisseur, could you share your thoughts on #1379 (comment) with me to make it even nicer?

timbms and others added 12 commits November 5, 2026 18:29
The CI log's formatter drops the text of Swift Testing issues and the
test host's output, so a failing test shows only its name. Have scan
write a result bundle and upload fastlane/test_output as an artifact
when the tests fail, kept for 14 days.

Signed-off-by: Tim Mueller-Seydlitz <timbms@gmail.com>
On CI's simulator, loading ohtest://openhab/ through the fake server
never started: no navigation step and no request within a minute, while
the pages the shim tests load as HTML worked. Load the page as HTML with
that address as its base instead, so its REST calls and state streams
still go to the fake server, and drop the server's HTML page.

Signed-off-by: Tim Mueller-Seydlitz <timbms@gmail.com>
Signed-off-by: openhab-bot <info@openhabfoundation.org>
…t update

#1380: the states stream opens on time, but the first update can take
seconds. Log each chunk Main UI reads on the fetch stream before its first
update, with its size and the event names it completes, never its data,
so a log shows whether the update arrives late on its own or held back
behind other data. Also log the page's visibility at the start and when it
changes, since WebKit can throttle a hidden page.

Only unnamed events count as the first update now: a named event with
data, like a keep-alive, used to count as one.

Signed-off-by: Tim Mueller-Seydlitz <timbms@gmail.com>
Signed-off-by: Tim Mueller-Seydlitz <timbms@gmail.com>
Raises the minimum Firebase version from 12.19.1 to 13.1.1 and resolves
its dependencies to match, among them gRPC 1.83.1 and abseil
1.2025051202.0.

Signed-off-by: Tim Mueller-Seydlitz <timbms@gmail.com>
Signed-off-by: openhab-bot <info@openhabfoundation.org>
A CI simulator stalled the web content process for about ten minutes
before the page started. The bridge shim tests, which wait by calling
evaluateJavaScript, passed through the stall; pageMarks counted a minute
per mark on the clock and failed with no marks at all.

TimingPage.load() now asks the page whether it has loaded from the fake
server, so the wait lasts as long as the process takes to answer. The
per-mark waits start once the page is there.

Signed-off-by: Tim Mueller-Seydlitz <timbms@gmail.com>
Choosing Notifications in the menu closed the popover and asked the root
view for a sheet in the same moment, and the sheet did not show. The
notifications now hang off the menu like the settings do, so there is no
presentation that has to wait for another to end.

Closing the notifications leaves the menu open. Choosing a notification
or one of its actions closes the menu too, since it takes the user
elsewhere.

The root view no longer has a notifications sheet of its own, nor the
notifications target that asked for it. UITestNotifications now puts the
entry in the menu (demo mode has no notification connection) and fills the
list, so the notification UI tests open it from the menu like a user.

Co-Authored-By: Claude Code <noreply@anthropic.com>

Signed-off-by: Tassilo Karge <tassilo.karge@web.de>
One UI test per kind of entry: notifications, a sitemap, Home, a Main UI
page, a Main UI entry and the app settings. They open the menu from its
button and only hold that the screen differs from before, so they say
nothing about what an entry opens or in which kind of view.

The screen is compared with the menu closed on both sides: while the
popover is open the screen behind it is hidden from the tests, so a
comparison across the closing would pass for any entry.

Two more tests hold that closing the notifications keeps the menu open
and that choosing one of their actions closes it.

Co-Authored-By: Claude Code <noreply@anthropic.com>

Signed-off-by: Tassilo Karge <tassilo.karge@web.de>
Nothing ever created a browser target: it came in with the SwiftUI
migration as a case whose handler did nothing, and the side menu
replacement gave the handler a body without adding a menu entry that
produces it. Removed with the one thing that only it used,
SafariPresenter.

The switches in switchContent covered the removed modal targets with
default arms. They now name the one case left over, Main UI pages, which
showMainUI sets itself and which are never passed to switchContent.

Co-Authored-By: Claude Code <noreply@anthropic.com>

Signed-off-by: Tassilo Karge <tassilo.karge@web.de>
@digitaldan

Copy link
Copy Markdown
Contributor

Sorry for the late response. If i understand correctly, the issue is there is a case when depending on the options set on a MainUI page , the MainUI will still draw its own burger menu on the left side. I think owning the menu system is mutually exclusive, either the host app (IOS/Android) handles rendering the menu, or the Web app does. So i would vote to modify the Bridge logic to ensure the MainUI does not try and render its own left hand menu. Happy to make that change.... if thats the issue being discussed.

@TAKeanice

Copy link
Copy Markdown
Contributor Author

Hi @digitaldan , the main question is how you would suggest to handle different combinations of options for the MainUI pages:

config:
  hideNavbar: true|false
  hideSidebarIcon: true|false
  showFullscreenIcon: true|false

Because in the iOS app, the navbar and the menu icon are coupled and I have no idea what the fullscreen icon would be expected to do if it is shown.

I'd assume the navbar parameter is the relevant one and should hide the menu icon, too? And all values of hideSidebarIcon can be ignored?

I think your suggested bridge logic modification makes sense, plus maybe it should be extended to forward fullscreen button presses?

@egoist6

egoist6 commented Nov 9, 2026

Copy link
Copy Markdown

Just to clarify. hideSidebarIcon is not related to hideNavbar. The new burger menu in iOS app is the equivalent to MainUI’s sidebarIcon in a browser. MainUI in a browser shows the sidebarIcon independently from the navbar. The new burger menu seems to be part of the navbar now. Maybe this makes it a little bit confusing.

@TAKeanice

Copy link
Copy Markdown
Contributor Author

Just to clarify. hideSidebarIcon is not related to hideNavbar. The new burger menu in iOS app is the equivalent to MainUI’s sidebarIcon in a browser. MainUI in a browser shows the sidebarIcon independently from the navbar. The new burger menu seems to be part of the navbar now. Maybe this makes it a little bit confusing.

Yes, the app menu button is part of the navigation bar. My question: what's your suggestion if only the navigation bar hidden property is true and the house sidebar icon is false, or vice versa?

@egoist6

egoist6 commented Nov 9, 2026

Copy link
Copy Markdown

Yes, the app menu button is part of the navigation bar. My question: what's your suggestion if only the navigation bar hidden property is true and the house sidebar icon is false, or vice versa?

In order to avoid confusion, I‘d handle it seperately as the browser does.
Even if the app menu button is part of the navbar, some users may want to hide the navbar but keep the app menu button.

Signed-off-by: openhab-bot <info@openhabfoundation.org>
@TAKeanice

Copy link
Copy Markdown
Contributor Author

Even if the app menu button is part of the navbar, some users may want to hide the navbar but keep the app menu button.

That's kind of the issue. If that was easily possible, I would not have asked. But menu button without Navbar does not really work. Navbar without menu button would though.

Over HTTP/2, WebKit can hold the end of a large item-state event until
more data arrives on the stream. openHAB's keep-alive comes every 10 s,
so states showed up 3 to 9 s late. Over HTTP/1.1 they arrived at once.

The timing script now logs nextHopProtocol of the first REST call that
reports one. It goes over the connection the item-state stream uses, so
a log shows h2 next to a states event cut in two. The document is not
logged: it usually comes from a cache and names no protocol.

Signed-off-by: Tim Mueller-Seydlitz <timbms@gmail.com>
@timbms

timbms commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

LGTM
Could you merge it?

@TAKeanice

Copy link
Copy Markdown
Contributor Author

I will record an issue to finetune the behavior as discussed in this PR, but for now I will merge it so we can get Duo support through the door!

@TAKeanice
TAKeanice merged commit ec00ae9 into develop Nov 14, 2026
8 checks passed
@TAKeanice
TAKeanice deleted the mainui-js-bridge-fixes branch November 14, 2026 06:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Burger menu not disappearing when hideNavbar=true

5 participants