Develop#8
Open
VPDPersonal wants to merge 175 commits intomainfrom
Open
Conversation
# Conflicts: # README.md
- Add regex caching in TypeExtensions with RegexOptions.Compiled - Centralize registry lookup logic in StringIdRegistryHelper - Remove duplicate FindRegistry/CreateRegistry methods - Improve performance: 10-100x faster registry lookups Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Surface stale references in the IdStruct drawer so removed registry entries no longer render as silent integers. The dropdown now shows <Missing id N> / <Missing 'Name'> in red (--dropdown--missing) when the referenced id is absent from a string-mapped registry. Hooked the drawer to a new IdRegistryResolver.RegistryChanged event so the missing-state recomputes the moment a registry asset is imported or its cache is reset (no manual reimport). Side polish: - IdRegistryEntryVisualElement reverts the name TextField on FocusOut when the user blurs without confirming, instead of leaking the edit back into the asset on the next bind. - ListView gets an aspid-fasttools-id-registry__list class so its scroller can be styled. - StringIdRegistry.RebuildCache wears a profiler marker. - Move "Aspid/FastTools/Id Registry" CreateAssetMenu paths under "Aspid/Id Registry/..." for symmetry with the new sub-menu. - Sync both CLAUDE.md docs to the new menu path.
Both Id stylesheets predated the --aspid-colors-* palette and stamped
~25 raw rgb()/hex literals straight onto borders, backgrounds and
status text — making the inspector and drawer look chrome-foreign next
to AspidHelpBox / AspidInspectorHeader / GradientButton, and impossible
to retheme. This pass swaps every literal for the closest existing
palette token (no new variables, no new theme system) so the module
sits inside the same color system as the rest of the package.
On top of the migration:
- Drawer dropdown / input gain border-radius 6px, padding, and a
status-info focus ring; smooth transitions on color and border.
- Registry rows, add row, and TextField pick up matching focus rings
and 80ms hover transitions on delete / confirm buttons (status-error
for destructive, status-success for confirm).
- Sort and Group EnumFields are now wrapped in __toolbar-cell rows
with explicit "Sort" / "Group" labels — the bare enums were cryptic.
- Empty registries now show an info AspidHelpBox ("No entries yet…")
instead of a blank gap; visibility flips with accessor.Count == 0
and rides the same RebuildEntries cycle as the warning row.
- The structural-damage warning rectangle keeps its red palette but
now via status-error tokens, with a 6px radius matching the rest.
Both registry editor partials declared the same _targetStructType and _nextId fields. They now live on a single IdRegistryBase.Editor.cs partial — Unity merges base-class serialized fields into the derived asset transparently, so existing IdRegistry / StringIdRegistry assets deserialize unchanged. The derived partials hold only their storage-specific data (IdRegistry: _names; StringIdRegistry: nothing, file removed). IRegistryAccessor.Target narrows from UnityEngine.Object to IdRegistryBase. The old default Commit() did `if (Target is IdRegistryBase reg) reg.InvalidateCache()` — a runtime cast on a contract-required type. With the typed Target the cast vanishes and the contract becomes compile-checked: a third storage kind cannot silently skip cache invalidation. IdRegistryResolver gains GetOrCreateStringMapped(Type) — the Find...() ?? Create...() pattern was repeated in three drawer call sites and is now one helper. CreateStringMapped now also raises RegistryChanged so subscribers (like the IdStruct drawer) refresh without a manual reimport when a registry is created from code. StringIdRegistry.Ids and IdNames switch from per-call LINQ (`this.Select(...)` allocates an enumerator on every read) to cached int[] / string[] snapshots populated inside RebuildCache and exposed as IReadOnlyList<>. The signatures still satisfy IEnumerable<> consumers, so existing call sites keep working with zero per-access allocation. Editor CLAUDE.md updated to describe the new seam.
… tests Extract the IdStruct drawer's caption + missing-state computation to a new internal IdStructCaption.Build helper. The drawer used to inline two parallel implementations (IMGUI plain string + UIToolkit SyncStringFromInt) of the same "what should the dropdown say given (id, stored-name, registry)?" decision; both now go through the same helper. The helper takes an IdRegistryBase directly so it can be unit-tested without spinning up a UIToolkit panel or AssetDatabase. New tests: - IdStructCaptionTests covers the matrix: no registry / int-only / string-mapped × known id / unknown id / zero, including the fallback to <Missing 'StoredName'> vs <Missing id N> when no name is carried in the field. - IdRegistryResolverTests covers RegistryChanged firing on ClearCache, asset import, and CreateStringMapped, plus the new GetOrCreateStringMapped helper's "return existing / create once" contract. Created assets are cleaned up in the finally branch. - IdRegistryAccessorTests + StringIdRegistryAccessorTests both assert Commit invalidates the runtime cache: a stale cache would reject the freshly added id, so the assertion proves Commit -> Target.InvalidateCache fires.
EditMode validation surfaced four small issues from the polish passes: - StringIdRegistry.TryGetName documented "<see cref=string.Empty/>" as the miss value, but the implementation handed back whatever Dictionary<int,string>.TryGetValue defaulted to (null). The pre-existing RuntimeRegistryCacheTests.StringIdRegistry_Misses_- ReportFailure was failing on null vs string.Empty. Implementation now matches the contract. - IdStructDrawer's IMGUI dropdown still referenced the old local name `currentName` after the caption variables were renamed to `storedName` during the IdStructCaption extraction. - IdStructCaptionTests held the accessor as the concrete StringIdRegistryAccessor; default interface methods like Commit() dispatch only through the IRegistryAccessor interface, so the test could not compile. Switched to IRegistryAccessor. - IdRegistryBase.Editor.cs's _targetStructType / _nextId fields are read via SerializedObject.FindProperty (compiler can't see this), triggering CS0414. Suppressed locally with #pragma — the existing ReSharper hints were not enough for the C# compiler. After these, EditMode runs 52/52 green, compile clean (0 warnings).
…ement components Merge StringIdRegistry into IdRegistry, reorganize editor into Drawers/Registries/Resolvers/VisualElements, move stylesheets to UI/Ids/, and rename sample assets from ScriptableObjects/ to Data/.
Replace the inline button-based UIToolkit drawer with a dedicated BaseField<Type> component, relocate the stylesheet under Resources/UI/Types, and align styling with EnumField conventions. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…pe selector - Rename SerializableTypeDrawer → TypeIMGUIPropertyDrawer, add TypeUIToolkitPropertyDrawer - Remove ComponentTypeSelectorDrawer and its dedicated USS, route through shared TypeSelectorWindow - Rename TypeSelectorField → TypeField, extract TypeSelectorHelpers - Add DynamicSerializeProperty editor helper
- Restore meaningful warning for missing MonoScript in ComponentTypeSelector - Fix Missing-caption logic so resolved types show their name in IMGUI - Add warnings on OpenScript failure and narrow TypeInfo catch to ReflectionTypeLoadException - Use InspectorTypeField from ComponentTypeSelector and document the field's role
- Add folder-icon open-script button to ComponentTypeSelector IMGUI to match UIToolkit - Hide TypeField open button when value is null (was visible but inert on <None>) - Fall back to mouseOverWindow when focusedWindow is missing in TypeField dropdown - Consolidate OpenScript duplication into TypeExtensions.OpenInScriptEditor - Use propertyPath instead of name in DynamicSerializeProperty for nested properties
- Add IMGUIAbilitySelector sample with editor that forces IMGUI inspector path - Make IMGUI open-script icon fill the button and swap to opened-folder on hover - Account for array-element row padding in IMGUI open-button size - Drop redundant Button padding in SerializableType USS
…mples Two-step cursor/focus chain in the search field, hide back button while searching, focus styles for the back button, and Up/Down focus transfer between search, list, and back button. Samples reorganized into per-feature folders with a new IMGUI enemy editor sample. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Update file paths after the Abilities/Enemies split, rename the AbilitySelector prefab reference, and document the parallel IMGUI* sample pair. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ormat dark stylesheet Drop the AspidStyles.Adapter / AdapterMargin USS hooks in favour of a direct descendant rule under .aspid-fasttools-inspector-container, and stop attaching the default dark stylesheet from TypeField (the inspector container provides it). Reformat Aspid-FastTools-Default-Dark.uss for consistent column alignment. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Bumped every marker line annotation in FrameProfiler.cs and the README "Where to look" sections by one to match the generator's 1-based line numbers, which are also what the Profiler displays at runtime.
…operty - SetVector2Int wrote to vector2Value via implicit Vector2Int->Vector2 conversion; now writes to vector2IntValue - SetValueAndApply(EntityId) skipped ApplyModifiedProperties; now routes through the apply variant - Rename SetEntityIdApply to SetEntityIdAndApply for naming consistency with all other AndApply overloads - GetClassInstance: FindInstance returned ValueTuple<Type, object> instead of the element instance, breaking property paths through arrays/lists; replace covariance-broken object[]/IReadOnlyList<object> casts with non-generic IList so value-type collections no longer throw InvalidCastException - GetMemberInfo and FindInstance now null-guard against missing fields/instances instead of NRE - Add full XML documentation to DynamicSerializeProperty (class, ctors, GetProperty, implicit operators) and remarks on SetEnumIndex/SetEnumFlag explaining why no SetValue<T>(int) alias exists
Use Unity null check in GetScriptNameWithIndex so destroyed components are caught, honour inherited AddComponentMenu via Attribute.IsDefined, drop the dead exact-type re-check inside the duplicate loop, and tighten the XML docs for both methods.
…ntime Relocate EnumValues USS into UI/Enums/, rename EnumValuesDrawer helper to EnumValuesPropertyDrawerHelper, and promote EnumField/EnumFlagsField extensions from Editor to Runtime so they ship with player builds.
- CLAUDE.md: editor resources moved to Resources/UI/, internal component subfolders gained `Aspid` prefix, AspidHoverGradientOverlays and Welcome window added, AddStyleSheetsFromResource path corrected. - Main READMEs (EN/RU × root/Documentation): IdRegistry types live in Aspid.FastTools.Ids (not the bare root), CreateAssetMenu path is `Aspid → Id Registry`, and `Ids`/`IdNames` are `IReadOnlyList<>` not `IEnumerable<>`. - Ids sample README: corrected line numbers and registry asset path. - VisualElements sample README: rewritten — the editor uses plain VisualElement/Label/HelpBox with fluent extensions, not internal Aspid components; sample assets are `fireball_1` / `fireball_free`.
- uss-bem-checker reviews USS class names (BEM) and custom properties (positional grammar) per the rules in CLAUDE.md. - rebuild-generators-on-change.sh rebuilds the main generator csproj only when *.cs under Aspid.FastTools.Generators/Aspid.FastTools.Generators/ changes, redeploying the DLL into the Unity package via Directory.Build.targets. Tests, Sample, and Unity-side edits are skipped.
Introduce ManipulatorExtensions with AddManipulatorSelf/RemoveManipulatorSelf, AddClickable, AddKeyboardNavigationManipulator and AddContextualMenuManipulator helpers under Aspid.FastTools.UIElements.Manipulators, and use the new fluent API to flatten EnumValuesPropertyDrawer's CreatePropertyGUI.
Drop the five Begin(Vector2, ...) overloads that did not write the updated scroll position back to the caller's variable, leaving only the ref-based overloads that match the typical inter-frame use case. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Move EnumFlagsFieldExtensions to Editor (Runtime cannot reference UnityEditor.UIElements), rename `SeCullingEnabled` typo to `SetCullingEnabled` (and update READMEs), simplify the convoluted null-check in `AspidHelpBox.Title` setter, drop redundant `<remarks>` in ProgressBarExtensions, fix setter remarks that read like getters in I-Text(Edition|Selection)Extensions, add missing XML on `AspidLabelExtensions.SetSelectable`, and rename the misleading `theme` parameter on `StatusStyle.GetClass`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Replace ad-hoc double-click bookkeeping in AspidInspectorHeader and AddOpenScriptCommand with a shared DoubleClickTracker struct (editor-only, uses EditorApplication.timeSinceStartup). Save IVisualElementScheduledItem references in AspidAnimatedLogo, AspidAnimatedTitle, AspidAnimatedDotsBackground, and AspidHoverGradientOverlay, and Pause/Resume them on Detach/Attach to make the lifecycle explicit instead of relying on UIToolkit's implicit panel cleanup. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Drop the duplicated icon mouse-up plumbing (Obj backing field, MonoScript caching, OnIconMouseUp, DoubleClickTracker) and chain AddOpenScriptCommand on the icon element directly. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
No description provided.