Skip to content

Fix watch folder bugs#4404

Merged
bgoncal merged 4 commits intohome-assistant:mainfrom
joelhawksley:fix-watch-bugs
Mar 4, 2026
Merged

Fix watch folder bugs#4404
bgoncal merged 4 commits intohome-assistant:mainfrom
joelhawksley:fix-watch-bugs

Conversation

@joelhawksley
Copy link
Copy Markdown
Contributor

@joelhawksley joelhawksley commented Mar 3, 2026

Summary

This PR aims to fix a couple of bugs I noticed while testing the new watch folders feature in the latest Test Flight build:

  1. Changing the folder name, icon, and icon after it was created did not work.
  2. When adding a folder, the folder name should be a placeholder, not a pre-filled field.
  3. When switching between a folder and the root view, the items should not resize after rendering (see the last item here):
IMG_2557.mov

Note: I could not reproduce the resizing bug in the simulator, and haven't been able to get Xcode to let me build to my devices locally. Would you be up for trying to reproduce it/verify my fix on your end?

Link to pull request in Documentation repository

N/A

Copilot AI review requested due to automatic review settings March 3, 2026 20:32
Copy link
Copy Markdown
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

Fixes issues in the Apple Watch “folders” feature so folder edits apply correctly, folder creation uses a placeholder name, and navigation/UI behavior is more consistent between root and folder views.

Changes:

  • Adjust MagicItem Equatable/Hashable behavior to treat more fields as “different” (intended to help UI reflect folder edits).
  • Hide the watch navigation bar in folder content view to better match the root view’s custom header/navigation behavior.
  • Change “Add Folder” flow to start with an empty text field (placeholder) and fall back to the default name when saved empty.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
Sources/Shared/MagicItem/MagicItem.swift Expands equality comparison and tweaks hashing inputs for MagicItem.
Sources/Extensions/Watch/Home/WatchFolderContentView.swift Hides navigation chrome to reduce layout/transition artifacts and rely on custom header/back.
Sources/App/Settings/AppleWatch/HomeCustomization/WatchConfigurationView.swift Uses placeholder behavior for new folder name and defaults on save if empty.
Comments suppressed due to low confidence (1)

Sources/Shared/MagicItem/MagicItem.swift:21

  • This PR changes the semantics of MagicItem’s Equatable/Hashable conformance in a way that affects multiple subsystems (watch config, widgets, CarPlay). There are existing tests for watch configuration behavior, but there are no tests asserting that widget state caching continues to work when MagicItem content changes (e.g., customization/name changes should not prevent retrieving cached state for the same entity). Adding a focused unit test around the widget cache keying/lookup behavior would help prevent regressions here, especially if MagicItem remains a dictionary key.
    public static func == (lhs: MagicItem, rhs: MagicItem) -> Bool {
        lhs.id == rhs.id
            && lhs.serverId == rhs.serverId
            && lhs.type == rhs.type
            && lhs.customization == rhs.customization
            && lhs.action == rhs.action
            && lhs.displayText == rhs.displayText
            && lhs.items == rhs.items
    }

    public func hash(into hasher: inout Hasher) {
        hasher.combine(id)
        hasher.combine(serverId)
    }

Comment thread Sources/Shared/MagicItem/MagicItem.swift Outdated
@bgoncal bgoncal merged commit b816f4c into home-assistant:main Mar 4, 2026
6 checks passed
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@6cdba80). Learn more about missing BASE report.

Additional details and impacted files
@@          Coverage Diff           @@
##             main   #4404   +/-   ##
======================================
  Coverage        ?       0           
======================================
  Files           ?       0           
  Lines           ?       0           
  Branches        ?       0           
======================================
  Hits            ?       0           
  Misses          ?       0           
  Partials        ?       0           

☔ View full report in Codecov by Sentry.
📢 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.

@joelhawksley joelhawksley deleted the fix-watch-bugs branch March 4, 2026 13:27
@joelhawksley
Copy link
Copy Markdown
Contributor Author

@bgoncal just tested on TestFlight. Looks better, but bug 3) above is still present for me. Any ideas what might be causing it?

@bgoncal
Copy link
Copy Markdown
Member

bgoncal commented Mar 5, 2026

@joelhawksley I can't reproduce it on my Apple Watch, whats your watch and watchOS version?

@joelhawksley
Copy link
Copy Markdown
Contributor Author

@bgoncal iPhone 15 Pro @ 26.3.1 and Apple Watch Ultra 3 @ 26.3. What's yours?

@bgoncal
Copy link
Copy Markdown
Member

bgoncal commented Mar 5, 2026

17 Pro, 26.4 Beta 3, Watch ultra 2 @ 26.3, the results should be the same since the screen size didnt change or anything like that between the 2 versions, I'll see if I can reproduce it early next week, I'm a bit busy right now with mTLS (feature in development), so if you find something please let me know

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.

3 participants