Skip to content

0.4.2 - #14

Merged
YozoraKurage merged 12 commits into
mainfrom
0.4.2
Jun 29, 2026
Merged

YozoraKurage merged 12 commits into
mainfrom
0.4.2

Conversation

@YozoraKurage

Copy link
Copy Markdown
Owner

No description provided.

yozorakurage and others added 12 commits June 26, 2026 00:29
The embedded ProjectBrowser starts an inline rename for newly created
assets via BeginPreimportedNameEditing, but its list area is covered by
AssetColumnView in TypeColumns mode, so the rename text field never
reached the user and the new asset was effectively undetected.

Capture the request with a Harmony prefix on BeginPreimportedNameEditing
and route it through AssetCreationBridge to the owning column view,
which inserts a phantom row, drives its own rename overlay, and invokes
the captured EndNameEditAction.Action / Cancelled on commit / cancel.
Tree-pane creates targeting a different folder still run the stock flow.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Arrow keys reached the embedded ProjectBrowser through the covered list
area and did nothing visible. Add Up/Down/Left/Right and Home/End in
AssetColumnView itself: Up/Down step within the current type column,
Left/Right cross to the previous/next column (clamping to its last row
when shorter), and Shift extends from the click anchor like Shift+click.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
After F2 (or an Assets/Create rename) committed, EditorGUIUtility's
editingTextField stayed true even though the rename text field had been
torn down. HandleKeyDown's "leave keys to an active text field" early-out
then swallowed every Up/Down/Left/Right until the user clicked
elsewhere — toggling the column view off and on cleared it incidentally.
Reset the flag in EndRename so arrow navigation resumes immediately.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
… source

Spring-load brought drags onto a sibling tab, but releasing them did
nothing: the column view set visualMode = None for any drop that did not
land on a specific subfolder row, so Unity fired DragExited instead of
DragPerform — the asset never moved. Fall back to the shown folder as
the drop target, the natural one once the user is hovering its content.

The tab header path had a related blind spot: DraggedProjectPaths only
read DragAndDrop.paths, so drags originating from the stock browser's
tree pane (which populates only objectReferences) returned empty and
HandleTabDrag bailed out. Union both sources in both the tab-header
and column-view drop paths.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…ierarchy → Project drops

Two bugs surfaced by the same root cause — the column view sets
Selection.objects but never tells the embedded ProjectBrowser, so
features that read selection through the browser saw stale state:

- Assets/Export Package... fed off the last-interacted browser's
  internal list-area selection (Selection.assetGUIDs path), so it
  ignored what the user had just picked in the column view.
  Mirror Selection.instanceIDs into ObjectListArea.InitSelection on
  every OnSelectionChange so the two views agree.

- Dragging a GameObject from the Hierarchy onto the column view did
  nothing: the drag carried no asset paths, so the drop fell through
  the asset-move branch with visualMode = None and Unity never fired
  DragPerform. Detect non-persistent GameObjects in objectReferences
  and route them through PrefabUtility.SaveAsPrefabAssetAndConnect
  into the hovered or shown folder, in Copy mode like the stock
  browser. The asset-move and prefab-create paths share a single
  rebuilt drop block; the dead FolderDropTarget helper is removed.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
f765364 added the column-view phantom and rename overlay for new assets
but left three gaps that all surfaced as "the asset just doesn't appear":

- Create > Folder writes the folder before opening the rename overlay,
  with a null EndAction. The phantom row sat on top of the real folder
  enumerated from disk (duplicating it) and the commit branch dereferenced
  the null EndAction. Skip the phantom when the asset is already on disk
  and fall back to AssetDatabase.RenameAsset when EndAction is null.

- The phantom never scrolled into view, so a create that landed in a
  type column off the right edge of the visible strip looked like
  nothing happened. Scroll the rename row in on the first overlay draw.

- The Harmony prefix is the cleanest path but it does not install when
  Harmony is missing or a future Unity renames BeginPreimportedNameEditing.
  Add a reflection fallback: poll ObjectListArea.GetCreateAssetUtility
  each event pass, hand the captured request to the same column-view
  bridge, then Reset() the utility and EndRename(false) the overlay so
  the (invisible) browser overlay does not race ours for focus.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
CommitRename declares `error` and `newPath` later in the same method for
the non-create rename path; the EndAction-less create branch reused
those names in an inner block, which C# rejects as shadowing an outer
local from the same method scope. Use renameError / createdPath in the
create branch.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
ef20171 left two backing stores of the in-flight create alive past
CommitRename / EndRename: the AssetCreationBridge entry (when Unity
re-fires BeginPreimportedNameEditing) and the embedded browser's
CreateAssetUtility. Either one re-armed _renamePath on the next
ConsumePendingCreation call, so the MouseDown auto-commit ran the
same captured EndAction again — and again — at "_Animation 1",
"_Animation 2"... on every subsequent click after the user navigated
away mid-name-input.

Wipe both stores from CommitRename / EndRename via a new
DiscardPendingCreation host callback (bridge Discard + the embedded
browser's ResetBrowserCreate), plus a HandleEvents-top guard that
ends the rename as soon as the shown folder no longer matches the
in-flight create's parent (tree-pane navigation). Also Repaint the
window after a creation so the column view refreshes even when
AssetDatabase.CreateAsset throws and projectChanged never fires.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
In two-column mode ProjectBrowser.GetActiveFolderPath falls back to
Selection.activeObject whenever the tree pane lacks keyboard focus —
which it always does while the column view covers it. So Create > Folder
from the column view's empty-area right-click, or from the NavBar's
"+" dropdown, was landing in whichever folder the previously-selected
asset happened to live in, not the folder the user is looking at.
BeginPreimportedNameEditing then fired with a pathName whose parent
didn't match tab.CurrentPath, the column-view prefix bailed out, and
the embedded browser was left holding an orphan inline-rename phantom
the user only saw after toggling the column view off — at which point
the folder was nowhere on disk either.

Anchor Selection.activeObject to the shown folder's asset before
opening either Create menu, so the destination Unity computes always
matches the column view.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…nch the rename forever

After CommitRename / DiscardPendingCreation, the next ConsumePendingCreation
sometimes drained the SAME request again (most likely when the browser's
CreateAssetUtility.Reset reflection silently no-ops in some Unity build —
poll keeps returning the same id+path until something else clears the
fields). That re-armed _renamePath, the MouseDown auto-commit fired
CommitRename again, the folder was created again, and the loop produced
"_Animation 1", "_Animation 2"... until the user closed Tabstep.

Track the (InstanceID, PathName) of the most recently consumed request
and short-circuit ConsumePendingCreation when the next drain matches —
discarding bridge + browser state in one shot — so the same in-flight
request cannot resurrect the phantom. A genuinely new Create produces
a different id (or at minimum a different path via GenerateUniqueAssetPath)
and drains normally.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…reateAssetUtility teardown

Two compounded reasons the column view stayed empty while the embedded
browser held the new-asset phantom:

1. The prefix bailed out when pathName's parent did not match the active
   tab's folder. Right-clicking a subfolder (or any item that pushed
   Selection.activeObject into a different folder) routed the create
   into that folder, the prefix returned true, and Unity's own phantom
   appeared in the (now hidden) browser. Always intercept while column
   view is active and call EnsureTabShowsForCreate to navigate the tab
   to the create's parent — the column view then has a real folder
   under the phantom to render.

2. The polling fallback read create-utility state through the public
   properties (`folder`, `endAction`, ...) and reset it through Reset().
   Both reflection lookups can silently miss in a given Unity build,
   leaving the utility populated; the next poll re-fed the same request
   to the column view and the debounce ran every tick instead of
   actually clearing the state. Switch read+write to the m_* backing
   fields with the properties/Reset kept only as a fallback, so the
   utility looks unambiguously empty after a drain.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…n-view Create lands here

ProjectWindowUtil.Create* resolves its destination through the
last-interacted browser's GetActiveFolderPath, which in two-column
mode falls back to Selection.activeObject's folder whenever the tree
pane lacks keyboard focus — and it always does while the column view
covers it. The previous fix anchored Selection.activeObject to the
shown folder before opening the Create menu, but Unity's own
ProjectBrowser.OnSelectionChange then pushed that folder into
m_LastFolders and triggered cascading state changes that swallowed
the create entirely: nothing landed on disk, no phantom appeared in
the column view, and the browser was left with just an inert phantom
row (no rename overlay) once toggled back into view.

Replace the Selection hack with a Harmony prefix on
ProjectBrowser.GetActiveFolderPath that simply returns the active
tab's folder for our hosted browsers. The destination is then always
the folder the user is looking at, with zero Selection side effects.
The right-click and NavBar entry points lose their Selection anchoring;
ConsumePendingCreation's path-mismatch guard and EnsureTabShowsForCreate
stay as belt-and-suspenders for the no-Harmony fallback path.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@YozoraKurage YozoraKurage added the patch up to 0.0.x label Jun 29, 2026
@YozoraKurage
YozoraKurage merged commit b7aeb04 into main Jun 29, 2026
@YozoraKurage
YozoraKurage deleted the 0.4.2 branch June 29, 2026 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

patch up to 0.0.x

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant