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

add Import Splits button #134

Merged
merged 22 commits into from
Jun 3, 2024
Merged

add Import Splits button #134

merged 22 commits into from
Jun 3, 2024

Conversation

AlexKnauth
Copy link
Contributor

Resolves #133 by adding an Import Splits button.

On clicking the Import Splits button, the user can select a file to import. It can import:

  • gameName
  • categoryName
  • variables
  • ordered
  • startTriggeringAutosplit
  • splitIds, including - subsplit markers where appropriate
  • endTriggeringAutosplit
  • names, dropping the - subsplit markers as appropriate
  • endingSplit name

It does not import:

  • times
  • icons
  • endingSplit icon

Copy link

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-134.d3q1bne2f3027p.amplifyapp.com

Copy link
Owner

@slaurent22 slaurent22 left a comment

Choose a reason for hiding this comment

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

great work overall!

when trying to import my old p5bo splits, I got this error
image

for successfully importing splits, please add an alert or modal with the caveats of not being able to import ending split icon / custom icons / etc

when there's an error importing splits, please add an alert or modal saying "failed to import splits". otherwise it appears nothing happens

let's get rid of the left margin here
image

/>
</Suspense>
<label htmlFor="import-input">
<input type="file" id="import-input" onChange={onImport} />
Copy link
Owner

Choose a reason for hiding this comment

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

This seems like a weird hack. Without researching into it, my question is "why can't the button itself trigger the file selector?" If there's a good reason for that question, please leave it as a comment. Otherwise, remove this

Comment on lines +137 to +139
const onImportButton = () => {
document.getElementById("import-input")?.click();
};
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is my alternative to the previous <label htmlFor="import-input"> way. I'm not sure it's any less hacky, but it at least doesn't need to re-implement pieces of ArrowButton as a non-button anymore.

@AlexKnauth AlexKnauth requested a review from slaurent22 June 2, 2024 19:49
@slaurent22 slaurent22 merged commit 418bf94 into slaurent22:main Jun 3, 2024
2 checks passed
@AlexKnauth AlexKnauth deleted the import branch June 3, 2024 16:33
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.

Feature request: Import splits file
2 participants