Repository navigation
Live Activity apply: remove files for activities taken out of the spec - #5
Merged
Merged
Conversation
…longer in the spec apply records every file it writes, with a SHA-256, in .flutterflow_live_activity_manifest.json. A later apply deletes a recorded file the spec no longer generates only when its content is unchanged, takes the deleted Swift and entitlements files out of the Xcode target, and removes folders left empty. A changed file is left in place with a warning. Without a manifest nothing is deleted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sbis04
approved these changes
Nov 30, 2026
sbis04
left a comment
Collaborator
There was a problem hiding this comment.
LGTM.
Checked in a flutter create app on iOS as well as Android: applied a spec with a Custom card (Delivery) and a progress card, then applied it again without the Custom card. 11 files removed, rerun changes nothing, and the project file lost only the LiveActivityCards.swift / entitlements entries plus the 3 extension CODE_SIGN_ENTITLEMENTS lines. flutter build ios --simulator builds, with LiveActivity.appex embedded. A kept (edited) LiveActivityCards.swift doesn't depend on any removed file, so it still compiles. 150 tests pass, analyze clean.
Nits, non-blocking:
- Hashes are of the exact bytes, so a checkout with CRLF conversion (git
autocrlfon Windows) makes every stale file look edited and keeps it. That fails safe; normalizing\r\nbefore hashing would avoid it. _staleFileswarns ("changed since it was generated; left in place") before the project/bundle id checks, so those warnings print on a run that then refuses to apply.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ngs only once the run applies A checkout with CRLF conversion no longer makes every generated file look edited. Warnings about changed files are held back until the project and bundle id checks pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
Both nits fixed in d9a4dfa (main merged in first, both CHANGELOG entries kept).
Format, analyze (fatal infos) and 152 tests pass. |
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Live Activity
apply: remove files for activities taken out of the specBefore, removing a Custom card from the spec left its generated files, and the Xcode entries that compile them, in the app.
What changes
applynow writes.flutterflow_live_activity_manifest.jsonin the app's root: every file it generated and the SHA-256 of the content it wrote. On the next run, a recorded file the new spec no longer generates is removed.What it deletes
LiveActivityCards.swiftandLiveActivity.entitlements: their lines inproject.pbxproj(file reference, group entry, build file, sources phase, the extension'sCODE_SIGN_ENTITLEMENTS). Nothing else in the project file changes.What it never deletes
applywarns<path> changed since it was generated; left in place.on every run until you remove it.ios/LiveActivity/andpackages/ff_live_activity/, even if a manifest lists it (pubspec.yaml,project.pbxproj,Info.plist,Runner.entitlements, paths with..).applyonly edits and cannot tell from yours:NSSupportsLiveActivities, the keychain groups, the Runner'sCODE_SIGN_ENTITLEMENTS. Documented in the README.API
applyLiveActivities(..., onRemoved:),addLiveActivityTarget(..., removedFiles:, keptFiles:). New dependency:crypto. The CLI reportsremoved N.Tests
New
test/apply_manifest_test.dart: A+B then A only (B's files gone, A's intact, project file equals a fresh apply of A apart from the Runner's own entitlements setting, rerun changes nothing); one of two Custom cards removed (shared files stay); edited file survives with a warning and is cleaned up once deleted by hand; no manifest deletes nothing; unreadable manifest; tampered manifest paths; refused apply writes nothing. All three packages pass;dart analyze --fatal-infosanddart formatclean.Smoke test in a fresh
flutter createapp: apply A+B, apply A (removed 11 files, no Cards/entitlements entries in the target), apply again (0 changes),flutter analyzeclean,flutter build apk --debugbuilds.🤖 Generated with Claude Code