Skip to content

Add confirmation dialog before executing tag#4617

Merged
bgoncal merged 3 commits intomainfrom
tag-url-scan-protection
May 8, 2026
Merged

Add confirmation dialog before executing tag#4617
bgoncal merged 3 commits intomainfrom
tag-url-scan-protection

Conversation

@bgoncal
Copy link
Copy Markdown
Member

@bgoncal bgoncal commented May 7, 2026

Summary

Before forwarding unknown tags to Home Assistant, present a confirmation dialog.

Android implementation: home-assistant/android#6814

Screenshots

CleanShot 2026-05-07 at 15 56 54@2x

Link to pull request in Documentation repository

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

Any other notes

@bgoncal bgoncal self-assigned this May 7, 2026
Copilot AI review requested due to automatic review settings May 7, 2026 13:53
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

This PR adds an approval step before forwarding newly encountered NFC tag scans to Home Assistant, plus supporting UI and persistence for “always allow” tag identifiers.

Changes:

  • Introduces an approval bottom sheet for unapproved tags, with “Allow Once” and “Allow Always” actions.
  • Persists approved tags in a new GRDB table (allowedTags) and adds Settings UI to view/remove allowed tags.
  • Updates settings navigation/strings to group NFC read/write and allowed-tag management under a new “Tags” entry.

Reviewed changes

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

Show a summary per file
File Description
Sources/Shared/Resources/Swiftgen/Strings.swift Adds generated string accessors for tag approval + allowed tags UI.
Sources/Shared/Environment/TagManagerProtocol.swift Adds requiresApproval(tag:type:) result for tag handling.
Sources/Shared/Database/Tables/AllowedTagTable.swift New GRDB table definition + legacy UserDefaults migration.
Sources/Shared/Database/GRDB+Initialization.swift Registers the new AllowedTagTable in schema setup.
Sources/Shared/Database/DatabaseTables.swift Adds allowedTags table and column enum definitions.
Sources/Shared/Database/AllowedTag.swift Adds persistence/query helpers for approved tags.
Sources/App/Settings/Settings/SettingsItem.swift Routes Settings “NFC” entry to a new Tags hub view.
Sources/App/Settings/NFC/TagsView.swift New Settings hub view linking to NFC read/write and allowed tags list.
Sources/App/Settings/NFC/iOSTagManager.swift Gates tag event firing on approval and returns requiresApproval when needed.
Sources/App/Settings/NFC/AllowedTagsView.swift New UI to list/delete allowed tags and clear all.
Sources/App/Settings/DebugView.swift Adds a developer action to clear approved tags.
Sources/App/Resources/en.lproj/Localizable.strings Adds new strings for approval + allowed tags UI.
Sources/App/Frontend/TagApprovalBottomSheet.swift New approval bottom sheet UI shown for unapproved tags.
Sources/App/Frontend/IncomingURLHandler.swift Presents approval sheet when required and refactors tag read confirmation display.
HomeAssistant.xcodeproj/project.pbxproj Adds new Swift files to the project build.

Comment thread Sources/Shared/Database/GRDB+Initialization.swift
Comment thread Sources/App/Frontend/TagApprovalBottomSheet.swift
Comment thread Sources/App/Frontend/TagApprovalBottomSheet.swift
@bgoncal bgoncal merged commit 45e05e6 into main May 8, 2026
12 checks passed
@bgoncal bgoncal deleted the tag-url-scan-protection branch May 8, 2026 08:55
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