Skip to content

Conversation

@Bouh
Copy link
Collaborator

@Bouh Bouh commented Jan 8, 2026

Add to the the resource list:

  • Up & down shortcuts
  • On rename shortcut
  • On delete shortcut
  • Auto focus on the next item in the list and refresh the editor
2.mp4

@Bouh Bouh requested a review from 4ian as a code owner January 8, 2026 16:12
@NexelDevs
Copy link

NexelDevs commented Jan 9, 2026

Any chance you could link resource names and resource paths? I recently needed to rename a folder for organization and as a result needed to go through and change the file paths and the names of the resources individually to match those file paths.... And I don't see much of a purpose for them having different names than their paths which they default to.

Nonetheless these changes you have planned would already had a huge layer of convenience to that so great work!


const resourcesManager = project.getResourcesManager();
const allNames = resourcesManager.getAllResourceNames().toJSArray();
const currentIndex = allNames.indexOf(resource.getName());
Copy link
Owner

Choose a reason for hiding this comment

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

Use GetResourcePosition. No need for allNames

const currentIndex = allNames.indexOf(resource.getName());

let nextResourceName = null;
if (allNames.length > 1) {
Copy link
Owner

Choose a reason for hiding this comment

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

Ideally we would expose Count in Bindings.idl for ResourcesContainer

resourcesActionsMenuBuilder
}
/>
<div
Copy link
Owner

Choose a reason for hiding this comment

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

Do we really need this container? Could we have a "onKeyDown" on the ResourcesList?

Copy link
Owner

Choose a reason for hiding this comment

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

Actually, do we really want to have a onKeyDown here? Could that be the ResourcesList that calls a props when up/down is called?

}

const nextResource = resourcesManager.getResource(allNames[nextIndex]);
if (nextResource !== selectedResource) {
Copy link
Owner

Choose a reason for hiding this comment

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

Is this comparison useful?


let nextIndex = 0;
if (selectedResource) {
const currentIndex = allNames.indexOf(selectedResource.getName());
Copy link
Owner

Choose a reason for hiding this comment

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

Same as the other, I think it would be worth exposing Count and using GetResourcePosition rather than everytime getting getAllResourceNames + calling to JSArray which creates useless copies of the list of names in memory.


const keyboardShortcutsRef = React.useRef<KeyboardShortcuts>(
new KeyboardShortcuts({
shortcutCallbacks: {},
Copy link
Owner

Choose a reason for hiding this comment

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

Add a comment explaining why you don't set onDelete and onRename here.

);
}

_onKeyDown = (event: KeyboardEvent) => {
Copy link
Owner

Choose a reason for hiding this comment

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

As written in another comment, it could be the ResourcesList that take care of this. A good LLM model could probably find the best way to do it.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants