Skip to content

Conversation

@Ayush2k02
Copy link
Contributor

This PR adds the following shortcuts , although in my opinion since graphite has layers stacked vertically , there is no point in keeping both the tab , shft tab and the arrow keys option, since both of them does the same job

Screen.Recording.2026-01-15.at.6.07.27.PM.mov
Screen.Recording.2026-01-15.at.5.51.52.PM.mov

CLOSES #3636

@Ayush2k02 Ayush2k02 marked this pull request as ready for review January 15, 2026 13:11
@Ayush2k02
Copy link
Contributor Author

Ayush2k02 commented Jan 20, 2026

Any update on this guys !

@Keavon
Copy link
Member

Keavon commented Jan 20, 2026

!build

@github-actions
Copy link

📦 Build Complete for 2462248
https://82b70ef5.graphite.pages.dev

return layers.some((layer) => layer.editingName);
}
async function navigateToLayer(currentListing: LayerListingInfo, direction: "next" | "previous" | "up" | "down") {
Copy link
Member

Choose a reason for hiding this comment

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

I don't think there's any reason to have four instead of two directions, when each pair are just synonyms of each other. Just name them "Up" and "Down", with the first letter capitalized because these are the JS equivalent of Rust's enum variants which are also PascalCase.

Comment on lines +507 to +509
function isAnyLayerBeingEdited(): boolean {
return layers.some((layer) => layer.editingName);
}
Copy link
Member

Choose a reason for hiding this comment

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

A one-liner function that's only used once is rather unnecessary compared to just calling that logic inline and describing what's going on in the comment above it.

Comment on lines +525 to +533
let targetIndex: number;
if (direction === "next" || direction === "down") {
targetIndex = currentIndex + 1;
if (targetIndex >= layers.length) return; // Don't wrap around at the end
} else {
// previous or up
targetIndex = currentIndex - 1;
if (targetIndex < 0) return; // Don't wrap around at the beginning
}
Copy link
Member

Choose a reason for hiding this comment

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

Move targetIndex declaration to a ternary statement and perform both returns, checking both conditions with a logical OR, on the following line. Full if/else blocks are too verbose here when this could all be made into two lines.

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.

Keyboard shortcut for renaming layer

2 participants