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

Feat: play on paste . #49

Open
wants to merge 6 commits into
base: seamlisten
Choose a base branch
from

Conversation

greatsage-raphael
Copy link

Why ?

Usually when we paste something in the query textbox, the next action is to click on "fetch" or press enter. This feature detects a paste and automatically execute the query. Fixes #36

How ?

It uses the onPaste event listener of the input field to detect a paste operation and automatically executes the query by calling a function

Test plan

Paste filename into the input field and observe that the pasted filename automatically executes without manual intervention.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jul 12, 2023
Copy link
Member

@Celebio Celebio left a comment

Choose a reason for hiding this comment

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

it looks good. Can you install/run pre-commit and make sure the linter works on tsx files?

Also, is it possible to add a test for this new feature?

@@ -121,14 +121,14 @@ function useFileNavigate() {
}

const Files = (): JSX.Element => {
const [displayHelper, setDisplayHelper] = useState(false);
const [displayHelper, setDisplayHelper] = useState(false);
Copy link
Member

Choose a reason for hiding this comment

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

Doesn't the linter remove this trailing spaces? Did you install and run pre-commit ?

Copy link
Author

Choose a reason for hiding this comment

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

I'll get right on it

@@ -183,6 +194,7 @@ const Files = (): JSX.Element => {
onChange={setFilenameEventHandler}
value={newFilename}
onKeyDown={fileInputHandleChange}
onPaste={fileInputHandlePaste}
Copy link
Member

Choose a reason for hiding this comment

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

nice

@greatsage-raphael
Copy link
Author

it looks good. Can you install/run pre-commit and make sure the linter works on tsx files?

Also, is it possible to add a test for this new feature?

I'll install and rum pre-commit and write up the test as well

@Celebio
Copy link
Member

Celebio commented Jul 27, 2023

Thank you @greatsage-raphael. There are too many files affected by the linter, and I am wondering if this is due to some version mismatch. In any case, can you run the linter only on the files that you modified? We can decide later if it makes sense to run it on all files, but it should be a separate commit anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants