fix(editor): Content Browser context menus, File menu, and drag-and-drop - #756
Merged
Merged
Conversation
…ag-and-drop Content Browser: - Create Folder/Rename/Delete context menus and modals were built but never wired correctly — a popup-timing race meant the modal always closed itself before it could render, and the name field never received keyboard focus. - Polished the modal UI (centered, right-aligned buttons, Enter/Escape, disable-when-empty, red Delete styling, pre-selected Rename text). - The grid's context menu used one shared popup key for every card, so opening one card's menu opened every card's; fixed with a per-card key. - Right-click on empty grid space now opens New File / New Folder. File menu: - New Scene only cleared the selection — now actually clears the scene (ActorManager::DestroyAll + scene->Reset()). - Open Scene just logged a hint; now opens a native file dialog defaulting to the project's scene folder. - Save Scene / Save Scene As constructed the serializer as a local stack variable handed to a background thread pool that outlived it — a dangling-pointer bug. Scene serialization is being rebuilt from scratch (#713-#719), so these are stubbed behind Editor::SaveScene/SaveSceneAs rather than patched against a format about to be replaced. - Quit called glfwSetWindowShouldClose, which nothing in the main loop reads — added Engine::RequestClose(), which does what the real OS window-close path does. - Removed a leftover dev shortcut that fired a window-close event on every Escape press, regardless of context — harmless when this was a bare test window, but closes the whole editor today when Escape cancels a modal. - Deleted Tetragrama/Messengers/ and MessageToken.h: every token they carried had zero consumers repo-wide, leftover from the pre-ZUI editor. Native file dialog: - NSOpenPanel's runModal blocked the main thread for as long as the dialog was open, freezing the whole engine loop. Switched to beginWithCompletionHandler, bridged into the existing coroutine scheduler. Adds a default-directory and message parameter (Windows/Linux best-effort, untested on this machine). Drag-and-drop: - Two bugs in ZUIInteractionPass made every drag-and-drop in the app non-functional: the drop target was read from ctx->HotKey, which is frozen while the mouse is held, so it always resolved to wherever the drag started rather than where it was released; and the payload length was zeroed in the same statement that reported the drop as successful, so every drop reported success with an empty payload. - Dropping a .zemesh/.zescene onto the viewport now resolves the VFS-style drop path to native and ingests the mesh explicitly (the registry's auto-ingest path is dead code, tracked separately in #755). Material/ texture resolution is intentionally left out — the mesh's embedded material UUID and the registry's UUID for that file come from independent, uncoordinated code paths today (#755). - Added a small drag-ghost indicator so a drag in progress is visible. Also fixes the Inspector's generic field renderer reinterpreting a uuids::uuid as a C string instead of formatting it, and runs clang-format over the touched trees.
FileOpenPicker has no SuggestedStartFolder API — WinRT pickers only support a fixed PickerLocationId enum, not an arbitrary start folder, which broke the Windows CI build (C2039). default_dir/message have no effect on Windows as a result; ComputerFolder is used unconditionally.
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
runModalcall (froze the whole engine loop) to an asyncbeginWithCompletionHandler, bridged into the existing coroutine scheduler..zemesh/.zescenedrops on the viewport.Material/texture resolution for dropped meshes is intentionally left out — the mesh's embedded material UUID and the asset registry's UUID for that file come from independent, uncoordinated code paths today. Tracked separately in #755.
Test plan
.zemeshfrom the Content Browser onto the viewport — actor spawns and renders