feat(editor): auto-assign binder View and Id from context menu - #127
Draft
VPDPersonal wants to merge 2 commits into
Draft
feat(editor): auto-assign binder View and Id from context menu#127VPDPersonal wants to merge 2 commits into
VPDPersonal wants to merge 2 commits into
Conversation
Complete the ASP-5 binder auto-assigner. Alongside the opt-in "auto-assign on component add" toggle, add an always-available component context-menu command (⋮ ▸ Auto-Assign View And Id) that resolves the single valid (View, Id) slot and assigns it non-destructively; the entry greys out when the binder is already assigned or the target is ambiguous. Both entry points now share one resolution core (TryResolveSingleTarget), reusing BinderEditorUtilities.GetIds so auto-assign never picks a slot the manual dropdowns would not offer. Refs ASP-5 Co-Authored-By: Claude <noreply@anthropic.com>
…n-binder-view-ids
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.
Summary
Unity/Editor/Scripts/Binders/BinderAutoAssigner.cs).⋮) → Auto-Assign View And Id — that resolves the single valid(View, Id)slot across the parent chain and assigns it non-destructively.Tools/Aspid 🐍/Experimental, OFF by default).TryResolveSingleTarget), reusingBinderEditorUtilities.GetIdsso auto-assign never offers a slot the manual dropdowns would not.Validation
Verified in Unity 6000.4.0f1 via UniCli:
View+Idrestored) and became non-reassignable afterwards (idempotent / non-destructive).Notes for review
MonoBinderEditoris intentionally left untouched — the hook is a self-containedCONTEXT/MonoBinder/...menu item, so risk to the core binder inspector is nil.mainmerged in to pick up thecom.yucchiy.unicli-serverpackage (build(deps): add com.yucchiy.unicli-server package #126) used for the validation above.Linked issues
Closes ASP-5
🇷🇺 Описание на русском
Summary
Unity/Editor/Scripts/Binders/BinderAutoAssigner.cs).⋮) → Auto-Assign View And Id, — которая находит единственный валидный слот(View, Id)по цепочке родителей и назначает его недеструктивно.Tools/Aspid 🐍/Experimental, по умолчанию OFF).TryResolveSingleTarget), переиспользуяBinderEditorUtilities.GetIds, — авто-ассайн никогда не предложит слот, которого нет в ручных дропдаунах.Валидация
Проверено в Unity 6000.4.0f1 через UniCli:
View+Id) и после этого перестали быть переназначаемыми (идемпотентность / недеструктивность).Notes for review
MonoBinderEditorнамеренно не изменён — хук является самодостаточным пунктом менюCONTEXT/MonoBinder/..., так что риск для основного инспектора биндеров нулевой.mainради пакетаcom.yucchiy.unicli-server(build(deps): add com.yucchiy.unicli-server package #126), использованного для валидации выше.