Add tag() action for CollectionService tags

Adds a built-in `vide.tag()` action that wraps `Instance:AddTag()` /
`Instance:RemoveTag()` so tags can be applied through `create()` props.

It accepts a static string or array of strings, or a reactive source
returning either. The reactive variant diffs the previous and new tag
sets so only the delta is applied. All tags added by the action are
removed when the surrounding scope is destroyed.

Includes mock support for `AddTag`/`RemoveTag`/`HasTag`/`GetTags`,
tests, API reference docs, and a closing note in the actions tutorial.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Andrea Fletcher 2026-05-26 22:10:47 -07:00
parent 19eaeb424f
commit 18c1d02d43
No known key found for this signature in database
7 changed files with 276 additions and 0 deletions

View file

@ -8,6 +8,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## Unreleased
### Added
- `tag()` action for adding CollectionService tags to instances. Supports
static strings and arrays as well as reactive sources for dynamic tag sets.
Tags are automatically removed when the surrounding scope is destroyed.
### Changed
- `branch()` is now allowed to be used within a reactive scope.