-
Notifications
You must be signed in to change notification settings - Fork 39
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
base: seamlisten
Are you sure you want to change the base?
Feat: play on paste . #49
Conversation
There was a problem hiding this 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); |
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
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} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice
I'll install and rum pre-commit and write up the test as well |
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. |
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.