Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FE Delete & Rename shortcut keys #4976

Merged
merged 13 commits into from
Jul 15, 2024
Merged

FE Delete & Rename shortcut keys #4976

merged 13 commits into from
Jul 15, 2024

Conversation

joeizang
Copy link
Collaborator

@joeizang joeizang commented Jul 9, 2024

fixes #258

@joeizang joeizang self-assigned this Jul 9, 2024
Copy link

netlify bot commented Jul 9, 2024

Deploy Preview for remixproject ready!

Name Link
🔨 Latest commit 198a93d
🔍 Latest deploy log https://app.netlify.com/sites/remixproject/deploys/6694c99b982563000880cfb8
😎 Deploy Preview https://deploy-preview-4976--remixproject.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@joeizang joeizang added the ready-to-review PR ready to review label Jul 10, 2024
Copy link
Collaborator

@Aniket-Engg Aniket-Engg left a comment

Choose a reason for hiding this comment

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

Funtionality wise it looks fine

@@ -97,6 +101,98 @@ export const FileExplorer = (props: FileExplorerProps) => {
}
}, [treeRef.current])

useEffect(() => {
const performDeleteion = async () => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

typo in Deleteion

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ok

}
}
}
const deleteKeyPressUpHandler = async (eve: KeyboardEvent) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do you need to add listeners for both keyup & keydown?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, the keyUp updates the state variable for deleteKey and F2Key

setState((prevState) => {
return { ...prevState, deleteKey: false }
})
return
Copy link
Collaborator

Choose a reason for hiding this comment

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

should performDeleteion() be called here too?

@@ -357,6 +453,7 @@ export const FileExplorer = (props: FileExplorerProps) => {
}

const handleTreeClick = (event: SyntheticEvent) => {
console.log({ props, state })
Copy link
Collaborator

Choose a reason for hiding this comment

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

remove log

@joeizang joeizang requested a review from Aniket-Engg July 12, 2024 15:36
if (treeRef.current) {
const deleteKeyPressHandler = async (eve: KeyboardEvent) => {
if (eve.key === 'Delete' ) {
(window as any)._paq.push(['trackEvent', 'fileExplorer', 'deleteKey'])
Copy link
Collaborator

Choose a reason for hiding this comment

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

it will be better to create a variable for (window as any)

Copy link
Collaborator

Choose a reason for hiding this comment

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

also _paq.push takes 4 args

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That's right.

@joeizang joeizang requested a review from Aniket-Engg July 15, 2024 07:08
Copy link
Collaborator

@Aniket-Engg Aniket-Engg left a comment

Choose a reason for hiding this comment

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

LGTM

@joeizang joeizang merged commit 5d5f356 into master Jul 15, 2024
32 checks passed
@joeizang joeizang deleted the fe-shortcut-keys branch July 15, 2024 07:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-review PR ready to review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fileexplorer: add delete and rename files with "delete" and F2 keys
2 participants