Skip to content

refactor: improve scene name and icon handling #161

Description

@coderabbitai

Objective

Refactor the way scene tree handles UI handles to properly separate icons from scene names instead of using string splitting.

Acceptance Criteria

  • 1. Create a dedicated structure to store scene names and their associated icons separately
  • 2. Update the scene tree to use this structure when displaying scene names
  • 3. Remove the current string splitting approach in EditorScene.update()
  • 4. Ensure backward compatibility with existing scenes
  • 5. Add tests to verify correct handling of scene names with spaces

Dependencies

Technical Details

Environment: Editor
Components: Scene Tree, EditorScene
Resources: None

Background

This issue was identified in PR #148 (#148 (comment)) where we currently use string splitting to separate icons from scene names. This approach has limitations when scene names contain spaces.

Current problematic code:

m_windowName = utils::removeIconPrefix(selector.getUiHandle(m_sceneUuid, m_windowName));

The issue is that if a scene is named "my windows", the current approach would remove "my" from the name.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions