Skip to content

Migrated UID Viewer from bottom‑panel dock to editor tool (Repull)#1249

Closed
TheAenema wants to merge 1 commit into
Redot-Engine:devfrom
Selciner-Games:dev
Closed

Migrated UID Viewer from bottom‑panel dock to editor tool (Repull)#1249
TheAenema wants to merge 1 commit into
Redot-Engine:devfrom
Selciner-Games:dev

Conversation

@TheAenema
Copy link
Copy Markdown
Contributor

@TheAenema TheAenema commented May 10, 2026

Repulled and Retargeted in #1252

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 10, 2026

Walkthrough

The PR converts UIDViewer from a dock-based interface inheriting VBoxContainer to a standalone window tool inheriting Window. The implementation adds filesystem traversal with UID resolution, search filtering via recursive tree visibility toggling, and context menu interactions. EditorNode integration is updated to instantiate the window directly, remove dock panel setup, and add a Tools menu entry with a handler that opens the tool.

Changes

UID Viewer Window Refactoring

Layer / File(s) Summary
UIDViewer Type Definition
editor/file_system/uid_viewer.h
Class refactored from UIDViewerDock : public VBoxContainer to UIDViewer : public Window. Adds is_open state tracking, container widget pointer, expands includes for window/control support, and introduces public _open_tool() plus lifecycle methods.
EditorNode Integration Types
editor/editor_node.h
Forward-declares UIDViewer, adds TOOLS_UID_VIEWER menu option to enum, and declares UIDViewer *uid_viewer private member.
UIDViewer Implementation
editor/file_system/uid_viewer.cpp
Constructor builds UI: top bar with search LineEdit and refresh Button, two-column tree (UID, path), context menu for copy actions. Implements _refresh_uid_list() to traverse filesystem, resolve UIDs via ResourceLoader::get_resource_uid(), and populate tree. Adds search filtering via recursive visibility toggling. Event handlers manage item activation (navigate in FileSystemDock), context menu actions (copy to clipboard), right-click selection, and auto-refresh on EditorFileSystem::filesystem_changed.
EditorNode Construction and Wiring
editor/editor_node.cpp
Updates include from dock to UIDViewer header. During construction, instantiates uid_viewer and adds to gui_base instead of dock panel. Removes old bottom-panel dock item setup. Adds Tools menu handler for TOOLS_UID_VIEWER that calls uid_viewer->_open_tool(). Registers "UID Viewer..." menu shortcut.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • Redot-Engine/redot-engine#1144: Introduces the original UIDViewerDock editor integration that this PR refactors and replaces with the new window-based UIDViewer implementation.

Suggested labels

enhancement, topic:editor

Suggested reviewers

  • Arctis-Fireblight
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: migrating UIDViewer from a bottom-panel dock UI component to a standalone editor tool window, which is the primary objective of the pull request.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
editor/file_system/uid_viewer.cpp (1)

180-195: 💤 Low value

Consider using named constants for context menu IDs.

The menu item identification uses magic numbers (0 = Copy UID, 1 = Copy Path). While this works, using named constants or an enum would improve readability and maintainability.

♻️ Example refactor using enum

Add to the class private section in the header:

enum ContextMenuOption {
    CONTEXT_MENU_COPY_UID = 0,
    CONTEXT_MENU_COPY_PATH = 1,
};

Then update the implementation:

 void UIDViewer::_on_context_menu_id_pressed(int id) {
 	if (!last_selected_item) {
 		return;
 	}
 
 	String text_to_copy;
-	if (id == 0) { // Copy UID
+	if (id == CONTEXT_MENU_COPY_UID) {
 		text_to_copy = last_selected_item->get_text(0);
-	} else if (id == 1) { // Copy Path
+	} else if (id == CONTEXT_MENU_COPY_PATH) {
 		text_to_copy = last_selected_item->get_text(1);
 	}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@editor/file_system/uid_viewer.cpp` around lines 180 - 195, Replace the magic
numeric menu IDs in UIDViewer::_on_context_menu_id_pressed with named constants:
add an enum ContextMenuOption { CONTEXT_MENU_COPY_UID = 0,
CONTEXT_MENU_COPY_PATH = 1 }; to the UIDViewer class (private section) and
update the if/else to compare id against CONTEXT_MENU_COPY_UID and
CONTEXT_MENU_COPY_PATH; keep the rest of the logic (text selection and
clipboard_set) unchanged so behavior is identical but the intent is clear.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@editor/file_system/uid_viewer.cpp`:
- Around line 180-195: Replace the magic numeric menu IDs in
UIDViewer::_on_context_menu_id_pressed with named constants: add an enum
ContextMenuOption { CONTEXT_MENU_COPY_UID = 0, CONTEXT_MENU_COPY_PATH = 1 }; to
the UIDViewer class (private section) and update the if/else to compare id
against CONTEXT_MENU_COPY_UID and CONTEXT_MENU_COPY_PATH; keep the rest of the
logic (text selection and clipboard_set) unchanged so behavior is identical but
the intent is clear.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 1830322e-80cd-407f-ac0b-3a7ebb7ace04

📥 Commits

Reviewing files that changed from the base of the PR and between a3e8531 and 47bc78e.

📒 Files selected for processing (4)
  • editor/editor_node.cpp
  • editor/editor_node.h
  • editor/file_system/uid_viewer.cpp
  • editor/file_system/uid_viewer.h

@Arctis-Fireblight Arctis-Fireblight self-assigned this May 10, 2026
@Arctis-Fireblight Arctis-Fireblight added this to the Redot LTS 26.2 milestone May 10, 2026
@TheAenema TheAenema deleted the branch Redot-Engine:dev May 11, 2026 05:11
@TheAenema TheAenema closed this May 11, 2026
@TheAenema TheAenema deleted the dev branch May 11, 2026 05:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants