Skip to content

Hide and show dashboards from the native tab bar - #5702

Draft
bgoncal wants to merge 8 commits into
mainfrom
bgoncal/tabbar-dashboard-visibility
Draft

Hide and show dashboards from the native tab bar#5702
bgoncal wants to merge 8 commits into
mainfrom
bgoncal/tabbar-dashboard-visibility

Conversation

@bgoncal

@bgoncal bgoncal commented Sep 8, 2026

Copy link
Copy Markdown
Member

AI Policy

Select exactly one option that describes AI usage in this contribution:

  • I have not used AI for this contribution.
  • AI assistance was used for this contribution.
  • AI fully generated the code for this contribution, but I've reviewed and understood it before submitting and will respond without AI during review.

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

Light Dark

Link to pull request in Documentation repository

Documentation: home-assistant/companion.home-assistant#

Any other notes

App Labs feature, TestFlight only.

Copilot AI lite review requested due to automatic review settings September 8, 2026 23:26
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

⚠️ Unused L10n strings detected

Found 2 unused localization strings in the codebase.

Click to see details
Parsing Strings.swift...
Found 2855 L10n strings

Reading all Swift source code...
Read 11608648 characters of Swift code

Checking for unused strings...
Checked 100/2855 strings...
Checked 200/2855 strings...
Checked 300/2855 strings...
Checked 400/2855 strings...
Checked 500/2855 strings...
Checked 600/2855 strings...
Checked 700/2855 strings...
Checked 800/2855 strings...
Checked 900/2855 strings...
Checked 1000/2855 strings...
Checked 1100/2855 strings...
Checked 1200/2855 strings...
Checked 1300/2855 strings...
Checked 1400/2855 strings...
Checked 1500/2855 strings...
Checked 1600/2855 strings...
Checked 1700/2855 strings...
Checked 1800/2855 strings...
Checked 1900/2855 strings...
Checked 2000/2855 strings...
Checked 2100/2855 strings...
Checked 2200/2855 strings...
Checked 2300/2855 strings...
Checked 2400/2855 strings...
Checked 2500/2855 strings...
Checked 2600/2855 strings...
Checked 2700/2855 strings...
Checked 2800/2855 strings...

================================================================================
UNUSED STRINGS REPORT
================================================================================

Found 2 unused strings:


APPINTENTS:
  - L10n.AppIntents.ActiveEntities.Filter.climates
    Key: app_intents.active_entities.filter.climates
    Line: 297
  - L10n.AppIntents.ActiveEntities.Filter.locks
    Key: app_intents.active_entities.filter.locks
    Line: 305

================================================================================
Total unused: 2
================================================================================

================================================================================
Copy-paste these keys into the "Lokalise: Delete Keys" workflow (keys input):
================================================================================
app_intents.active_entities.filter.climates,app_intents.active_entities.filter.locks

To remove them, run the
Lokalise: Delete Keys
workflow — it deletes the keys from Lokalise and opens a PR removing them from
Localizable.strings and regenerating Strings.swift. Copy-paste these keys into the keys input:

app_intents.active_entities.filter.climates,app_intents.active_entities.filter.locks

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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.

Comment thread Tests/App/WebView/NativeTabBarFrontendSlotTests.swift
@bgoncal
bgoncal marked this pull request as draft September 8, 2026 23:46
@codecov

codecov Bot commented Sep 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.46575% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 41.82%. Comparing base (4637f09) to head (d3c4cdc).

Files with missing lines Patch % Lines
...nd/WebView/NativeTabBar/NativeTabBarMoreView.swift 85.00% 6 Missing ⚠️
...bView/NativeTabBar/NativeTabBarCustomizeView.swift 92.85% 3 Missing ⚠️
.../WebView/HomeAssistantView/HomeAssistantView.swift 50.00% 2 Missing ⚠️
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     
Files with missing lines Coverage Δ
...ntend/WebView/MacSidebar/MacSidebarViewModel.swift 59.69% <100.00%> (+5.84%) ⬆️
...bView/NativeTabBar/NativeTabBarContainerView.swift 100.00% <100.00%> (+18.18%) ⬆️
...ebView/NativeTabBar/NativeTabBarFrontendSlot.swift 95.74% <100.00%> (+9.07%) ⬆️
...w/NativeTabBar/NativeTabBarViewModel+Preview.swift 100.00% <100.00%> (ø)
...d/WebView/NativeTabBar/NativeTabBarViewModel.swift 96.52% <100.00%> (-0.31%) ⬇️
Sources/App/Settings/AppLabs/AppLabsFeature.swift 77.77% <100.00%> (+14.81%) ⬆️
.../WebView/HomeAssistantView/HomeAssistantView.swift 67.76% <50.00%> (-0.24%) ⬇️
...bView/NativeTabBar/NativeTabBarCustomizeView.swift 95.16% <92.85%> (+6.48%) ⬆️
...nd/WebView/NativeTabBar/NativeTabBarMoreView.swift 76.80% <85.00%> (-0.13%) ⬇️

... and 44 files with indirect coverage changes

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@github-actions
github-actions Bot dismissed their stale review September 9, 2026 01:22

Patch coverage could not be measured on this run, so the gate no longer applies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants