Skip to content

refactor(editor): hide default Script row for ComponentTypeSelector#142

Merged
VPDPersonal merged 1 commit into
mainfrom
refactor/asp-58-hide-default-script-row
Jul 7, 2026
Merged

refactor(editor): hide default Script row for ComponentTypeSelector#142
VPDPersonal merged 1 commit into
mainfrom
refactor/asp-58-hide-default-script-row

Conversation

@VPDPersonal

Copy link
Copy Markdown
Owner

Summary

  • ♻️ ComponentTypeSelector now hides the Inspector's built-in Script (m_Script) row in the UIToolkit inspector while the selector is present — the type is swapped only through the dropdown, so you can no longer edit m_Script by hand and bypass the selector.
  • 📝 Docs synced: 4 READMEs (EN/RU × root + Documentation), CHANGELOG EN/RU (Unreleased → Changed) and a bilingual QA‑checklist item.

Notes for review

  • ⚙️ Mechanism: on AttachToPanelEvent the drawer walks up to the owning InspectorElement and hides the sibling PropertyField whose bindingPath == "m_Script" (display: None). Scoped to this component's own inspector (sibling components are untouched) and re-applied on every re-attach (undo / domain reload).
  • ⚠️ UIToolkit only: the legacy IMGUI OnGUI inspector draws the Script row itself, out of a field-level drawer's reach — not the default in Unity 6. Documented in the drawer XML.
  • 🧪 No automated test (pure inspector UI behaviour); needs a live-editor QA pass — the new checklist item covers it. Kept as draft until that pass is done.

Linked issues

Closes ASP-58

🇷🇺 Описание на русском

Кратко

  • ♻️ ComponentTypeSelector теперь скрывает встроенную строку Script (m_Script) в UIToolkit-инспекторе, пока присутствует селектор — тип меняется только через выпадающий список, так что больше нельзя править m_Script вручную в обход селектора.
  • 📝 Доки синхронизированы: 4 README (EN/RU × корень + Documentation), CHANGELOG EN/RU (Unreleased → Changed) и двуязычный пункт QA-чеклиста.

Заметки для ревью

  • ⚙️ Механизм: по AttachToPanelEvent drawer поднимается к своему InspectorElement и скрывает соседний PropertyField с bindingPath == "m_Script" (display: None). Ограничено инспектором самого компонента (соседние компоненты не затронуты) и переприменяется при каждом re-attach (undo / перезагрузка домена).
  • ⚠️ Только UIToolkit: устаревший IMGUI-инспектор (OnGUI) рисует строку Script сам, вне досягаемости field-drawer'а — в Unity 6 это не путь по умолчанию. Задокументировано в XML drawer'а.
  • 🧪 Автотеста нет (чистое поведение инспекторного UI); нужен прогон QA в живом редакторе — покрыт новым пунктом чеклиста. Оставлен как draft до этого прогона.

- ComponentTypeSelectorPropertyDrawer hides the sibling m_Script PropertyField in the UIToolkit inspector so type-switching goes only through the selector dropdown; scoped to the owning InspectorElement and re-applied on re-attach.
- Docs/changelog/QA (EN+RU): document the hidden Script row and the IMGUI limitation.

Co-Authored-By: Claude <noreply@anthropic.com>
@VPDPersonal VPDPersonal added type: refactor Internal restructuring without behavior change status: work-in-progress Draft / not ready for review area: editor Editor-only code area: docs Repository documentation (README, CHANGELOG, docs/) labels Jul 7, 2026
@VPDPersonal VPDPersonal marked this pull request as ready for review July 7, 2026 13:22
@VPDPersonal VPDPersonal merged commit bbf43d1 into main Jul 7, 2026
5 checks passed
@VPDPersonal VPDPersonal deleted the refactor/asp-58-hide-default-script-row branch July 7, 2026 13:22
@github-actions github-actions Bot added status: needs-review Ready for review and removed status: work-in-progress Draft / not ready for review status: needs-review Ready for review labels Jul 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: docs Repository documentation (README, CHANGELOG, docs/) area: editor Editor-only code type: refactor Internal restructuring without behavior change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant