Hide and show dashboards from the native tab bar - #5702
Conversation
|
Found 2 unused localization strings in the codebase. Click to see detailsTo remove them, run the |
There was a problem hiding this comment.
🟡 Changes recommended
Unavailability-guarding is needed for iOS 17+ scroll-view APIs used by the frontend slot (and its test) to keep compilation compatible with targets that still build for iOS 16.4.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR extends the iOS App Labs native tab bar customization flow to support hiding/showing sidebar pages (persisted via the same frontend sidebar user data used by the web UI and Mac sidebar), and adds automatic tab bar minimization while the frontend scrolls.
Changes:
- Add hidden-page support to the native tab bar view model and customization UI, including “More” vs “Hidden” sections and hide/show actions.
- Extend localization/SwiftGen strings for the new UI copy and actions.
- Add/extend unit + snapshot tests covering hidden pages and the frontend slot’s scroll-view handoff.
File summaries
| File | Description |
|---|---|
| Tests/App/WebView/NativeTabBarViewModelTests.swift | Adds coverage for hidden pages behavior and hide/show interactions. |
| Tests/App/WebView/NativeTabBarSnapshotTests.swift | Adds snapshot coverage for the customize UI when hidden pages exist. |
| Tests/App/WebView/NativeTabBarFrontendSlotTests.swift | Adds a test verifying scroll-view handoff behavior for tab bar minimization. |
| Sources/Shared/Resources/Swiftgen/Strings.swift | Updates SwiftGen accessors for new tab bar customization strings/sections. |
| Sources/App/Resources/en.lproj/Localizable.strings | Adds/renames Localizable keys for “More/Hidden” sections and Hide/Show actions. |
| Sources/App/Frontend/WebView/NativeTabBar/NativeTabBarViewModel+Preview.swift | Extends previews to simulate hidden panels. |
| Sources/App/Frontend/WebView/NativeTabBar/NativeTabBarViewModel.swift | Introduces hiddenItems and hide/show APIs wired to the sidebar model. |
| Sources/App/Frontend/WebView/NativeTabBar/NativeTabBarFrontendSlot.swift | Hooks the web view’s scroll view into the hosting slot for minimize-on-scroll. |
| Sources/App/Frontend/WebView/NativeTabBar/NativeTabBarCustomizeView.swift | Updates the customize UI to show More + Hidden sections and hide/show buttons. |
| Sources/App/Frontend/WebView/NativeTabBar/NativeTabBarContainerView.swift | Enables .tabBarMinimizeBehavior(.onScrollDown) on the tab view. |
Review details
Suppressed comments (1)
Sources/App/Frontend/WebView/NativeTabBar/NativeTabBarFrontendSlot.swift:78
setContentScrollView(_:for:)is an iOS 17+ API; detaching should also be guarded the same way as attach to keep compilation compatible with iOS 16.4 deployment targets.
setContentScrollView(nil, for: .bottom)
- Files reviewed: 10/16 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…ity' into bgoncal/tabbar-dashboard-visibility
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #5702 +/- ##
==========================================
+ Coverage 41.59% 41.82% +0.23%
==========================================
Files 1108 1107 -1
Lines 77099 77388 +289
==========================================
+ Hits 32066 32366 +300
+ Misses 45033 45022 -11
☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Test coverage of this pull request is below 90%
The unit tests run 82.42% of the lines this pull request
adds or changes (136 of 165 coverable lines).
The per-file breakdown, and the changed lines no test runs, are in the
job summary. Adding tests for those lines and pushing dismisses this
review automatically.
Lines that carry no executable code, and files the unit test targets do not
build, are not counted. If the new code genuinely cannot be unit tested, a
maintainer can dismiss this review.
Patch coverage could not be measured on this run, so the gate no longer applies.
AI Policy
Select exactly one option that describes AI usage in this contribution:
Summary
The native tab bar's Customize Tabs screen now edits the sidebar order the tab bar is built from: one reorderable list of dashboards where the first three are the tabs (labelled Tab 1 to Tab 3) and the rest fill More, with a minus to hide a dashboard and a Hidden section at the bottom with a plus to show it again. Order and visibility are saved in the same sidebar user data the frontend and the Mac native sidebar use, so all three stay in sync. The separate per-server tab store is gone.
With more than one server, the profile header of the More tab is a menu that switches server or opens the profile page.
The tab bar also minimizes while the web view scrolls down and comes back when scrolling up.
The stand-by loader now covers only the web view inside the selected tab, not the tab bar or the More list. The frontend stops reconnecting while its document is hidden, which is the case for the web view in an unselected tab, so a loader over the whole screen could wait forever for a frontend the user had no way to bring back on screen.
Screenshots
Link to pull request in Documentation repository
Documentation: home-assistant/companion.home-assistant#
Any other notes
App Labs feature, TestFlight only.