Skip to content

Comments

Add support for folders in Watch app#4376

Draft
joelhawksley wants to merge 22 commits intohome-assistant:mainfrom
joelhawksley:watch-folders
Draft

Add support for folders in Watch app#4376
joelhawksley wants to merge 22 commits intohome-assistant:mainfrom
joelhawksley:watch-folders

Conversation

@joelhawksley
Copy link

@joelhawksley joelhawksley commented Feb 19, 2026

Summary

It's pretty unwieldy to navigate a long list of items in the current Watch app. By adding the ability to group items into folders, you can now create a mini dashboard of sorts that is significantly easier to use.

For full disclosure, this was my first time writing Swift and otherwise working with Xcode. I had a lot of help from Claude Opus but did what I could to self-review and test.

Screenshots

Screenshot 2026-02-19 at 3 08 35 PM
demo.mov

Link to pull request in Documentation repository

TODO: I will write docs assuming the UI flow is approved.

Any other notes

Related issue: #1422

@joelhawksley joelhawksley marked this pull request as ready for review February 19, 2026 22:31
Copilot AI review requested due to automatic review settings February 19, 2026 22:31
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request adds folder support to the Home Assistant Watch app, allowing users to organize their watch items into collapsible folders for better navigation. This addresses issue #1422 which requested folder organization for the watch app.

Changes:

  • Adds a new folder type to MagicItem.ItemType with nested items support via the items property
  • Implements iOS UI for creating, editing, and managing folders in the Watch configuration view
  • Implements watchOS UI for navigating into folders and displaying folder contents
  • Updates the communication service to properly handle folder items and their children
  • Adds comprehensive unit tests for folder management functionality

Reviewed changes

Copilot reviewed 13 out of 15 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
Sources/Shared/MagicItem/MagicItem.swift Adds folder type and items property to support nested folder structure
Sources/Shared/MagicItem/MagicItemProvider.swift Adds folder info provider with folder icon and default name
Sources/App/Settings/AppleWatch/HomeCustomization/WatchConfigurationViewModel.swift Implements folder management methods (add, update, delete, move items)
Sources/App/Settings/AppleWatch/HomeCustomization/WatchConfigurationView.swift Adds UI for creating folders with name input sheet
Sources/App/Settings/AppleWatch/HomeCustomization/FolderDetailView.swift Implements folder content editing view with item management
Sources/App/Settings/AppleWatch/HomeCustomization/FolderEditView.swift Implements folder customization view for icon, colors, and name
Sources/Extensions/Watch/Home/WatchHomeView.swift Adds folder navigation with back button and folder row display
Sources/Extensions/Watch/Home/MagicItemRow/WatchFolderRow.swift Implements Watch folder row UI component with chevron indicator
Sources/Extensions/Watch/Home/MagicItemRow/WatchMagicViewRow.swift Refactors icon color handling for consistency
Sources/Watch/WatchCommunicatorService.swift Updates to send folder and nested item info to Watch, handles folder press events
Tests/App/Watch/WatchConfig.test.swift Adds comprehensive unit tests for folder operations
FolderDetailView.swift Duplicate file in project root (should be removed)
HomeAssistant.xcworkspace/contents.xcworkspacedata Adds workspace file reference (likely unintended)
Podfile.lock Updates HAKit checksum and CocoaPods version (likely unintended)
HomeAssistant.xcodeproj/project.pbxproj Adds new files to Xcode project
Files not reviewed (1)
  • HomeAssistant.xcworkspace/contents.xcworkspacedata: Language not supported
Comments suppressed due to low confidence (2)

FolderDetailView.swift:64

  • The project uses SFSafeSymbols for type-safe SF Symbol references. Use systemSymbol parameter instead of systemName with string literals to comply with the coding guidelines and avoid runtime errors from invalid symbol names.
                Image(systemName: "line.3.horizontal")

FolderDetailView.swift:77

  • The project uses SFSafeSymbols for type-safe SF Symbol references. Use systemSymbol parameter instead of systemName with string literals to comply with the coding guidelines and avoid runtime errors from invalid symbol names.
                    Image(systemName: "line.3.horizontal")

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@bgoncal
Copy link
Member

bgoncal commented Feb 19, 2026

Looking good! I'll be able to review it on Monday, meanwhile feel free to evaluate Copilots comments and address if necessary.

joelhawksley and others added 4 commits February 19, 2026 15:42
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 14 out of 15 changed files in this pull request and generated 8 comments.

Comments suppressed due to low confidence (1)

Sources/App/Settings/AppleWatch/HomeCustomization/WatchConfigurationView.swift:257

  • This passes a hard-coded fallback folder name ("Folder"). Prefer L10n.Watch.Configuration.Folder.defaultName for localization consistency. Also, consider not passing folderName as a separate constant—after editing a folder name in FolderEditView, FolderDetailView’s navigation title won’t update because it uses this captured value.
            NavigationLink {
                FolderDetailView(
                    folderId: item.id,
                    folderName: item.displayText ?? "Folder",
                    viewModel: viewModel
                )

joelhawksley and others added 5 commits February 19, 2026 19:52
…ew.swift

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…rationView.swift

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…rationView.swift

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 47 out of 48 changed files in this pull request and generated no new comments.

@joelhawksley
Copy link
Author

Thanks @bgoncal! I did a few cleanup rounds with Copilot and verified that things still work locally. I recognize that newbie/AI PRs can be a burden on reviewers, so please let me know if you'd like me to do some more learning before trying to land this change ❤️

@bgoncal
Copy link
Member

bgoncal commented Feb 20, 2026

If you have some extra time before Monday, could you check if your changes do not impact database parsing coming from a version of the app without the folder feature?

Flow:

  • Install app without your changes
  • Configure some watch items for it
  • Check all works
  • Update to the version of the app without your changes
  • Check all works
  • Add folder
  • Check again that all works

Just to be sure it won't fail decoding from SQLite (GRDB)

@joelhawksley
Copy link
Author

@bgoncal I am away from my computer until Monday morning. Happy to do that test when I get in 👍

Copy link
Member

@bgoncal bgoncal left a comment

Choose a reason for hiding this comment

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

I tried the updating flow that I mentioned during the weekend and it looks like all good. Something I noticed is that when you tap the folder on your watch it does not do the push navigation animation, it just changes the view contents to the folder contents without any animation, I think this should be improved as well

"watch.config.migration_error.failed_create_new_config" = "儲存起始手錶設定失敗,錯誤:%@";
"watch.config.migration_error.failed_migrate_actions" = "遷移動作至手錶設定失敗,錯誤:%@";
"watch.config.migration_error.failed_to_save" = "儲存新手錶設定失敗,錯誤:%@";
"watch.configuration.add_folder.title" = "Add Folder";
Copy link
Member

Choose a reason for hiding this comment

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

Remove all changes to localizable files besides english one. Later on localization will be handled in "Lokalise".

PODFILE CHECKSUM: 4e98e76c5198159e1291eb551b129c0a38fd0c43

COCOAPODS: 1.15.2
COCOAPODS: 1.16.2
Copy link
Member

Choose a reason for hiding this comment

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

Remove this file change from the PR

import Shared
import SwiftUI

struct FolderDetailView: View {
Copy link
Member

Choose a reason for hiding this comment

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

We use dark mode always for Apple Watch related screens, to mimic what Apple does in the Apple Watch App, please update this view and others in this PR

}

private var folderItems: [MagicItem] {
if let folder = viewModel.watchConfig.items.first(where: { $0.type == .folder && $0.id == folderId }) {
Copy link
Member

Choose a reason for hiding this comment

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

Cant you use the computed variable that you have at the top?

}

@ViewBuilder
private var addFolderSheet: some View {
Copy link
Member

Choose a reason for hiding this comment

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

This one is currently displaying in light mode as well

@home-assistant home-assistant bot marked this pull request as draft February 23, 2026 10:12
@home-assistant
Copy link

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

@bgoncal
Copy link
Member

bgoncal commented Feb 23, 2026

Oh btw I fixed lint issues on your branch but for the future you can use bundle exec fastlane autocorrect

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