This repository was archived by the owner on Nov 3, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 42
Feat: play on paste . #49
Open
greatsage-raphael
wants to merge
6
commits into
facebookresearch:seamlisten
Choose a base branch
from
greatsage-raphael:seamlisten
base: seamlisten
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
1e2eb0a
Feat: play on paste . Fixes #36
greatsage-raphael de63794
Fix: Trailing whitespace fixed with pre-commit run --all-files
greatsage-raphael 3051430
Feat: Test for the paste action
greatsage-raphael dd11271
Feat: play on paste . Fixes #36
greatsage-raphael b4f4201
Revert "Fix: Trailing whitespace fixed with pre-commit run --all-files"
greatsage-raphael 5b04b79
Feat: Explore folders on Front-end
greatsage-raphael File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -121,14 +121,14 @@ function useFileNavigate() { | |
| } | ||
|
|
||
| const Files = (): JSX.Element => { | ||
| const [displayHelper, setDisplayHelper] = useState(false); | ||
| const [displayHelper, setDisplayHelper] = useState(false); | ||
| const navigate = useFileNavigate(); | ||
| let { filename, pageNumber, numberLines, files, audioBlob, error } = | ||
| useLoaderData() as LoaderReturn; | ||
| const [newFilename, setNewFilename] = useState( | ||
| filename || config.default_path | ||
| ); | ||
|
|
||
| // if we have a location, we are in a transition between two urls | ||
| const navigation = useNavigation(); | ||
| const locationParams = parseLocation(navigation.location); | ||
|
|
@@ -168,6 +168,17 @@ const Files = (): JSX.Element => { | |
| [setFilename] | ||
| ); | ||
|
|
||
| // Add new function to handle paste events | ||
| const fileInputHandlePaste = useCallback( | ||
| (evt) => { | ||
| const pastedData = evt.clipboardData.getData('text'); | ||
| setNewFilename(pastedData); | ||
| navigate(pastedData, pageNumber, numberLines); | ||
| }, | ||
| [navigate, pageNumber, numberLines] | ||
| ); | ||
|
|
||
|
|
||
| return ( | ||
| <div style={{ marginTop: "10px" }}> | ||
| <Form as={BRow}> | ||
|
|
@@ -183,6 +194,7 @@ const Files = (): JSX.Element => { | |
| onChange={setFilenameEventHandler} | ||
| value={newFilename} | ||
| onKeyDown={fileInputHandleChange} | ||
| onPaste={fileInputHandlePaste} | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nice |
||
| size="sm" | ||
| /> | ||
| <Form.Text className="text-muted" /> | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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