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

Implemented UI for dropped files #611

Merged
merged 7 commits into from
Nov 25, 2024
Merged

Conversation

ekgame
Copy link
Contributor

@ekgame ekgame commented Nov 24, 2024

This PR introduces a pad UI for displaying custom files dropped to the editor and available for access by Uiua code and some additional related changes for running the pad.

Light mode
image
Dark Mode
image

Features and changes:

  • New UI for displaying dropped files.
  • Click on the file name to insert the code to load it (preserves inferring &fras, &frab ans ~).
    • The "loading code" is no longer inserted upon dropping the file. The rationale is that it was coded to work when the code was empty, and the code wouldn't be inserted if there was already code there - which is very confusing. Now the code is inserted at the cursor on click which should be much more pleasant UX.
  • Click on the "x" button to remove the file.
  • Now handles all dropped files, not just the first one.
  • Added a button next to settings to upload a file via a prompt (useful for mobile users).

The way the file list updates is a little hacky - it listens for changes to the output state and re-renders every time it changes. I could not find a better way to do it, but it seems to work and handles the cases where files are created/deleted by running code.

@kaikalii kaikalii merged commit c488a39 into uiua-lang:main Nov 25, 2024
1 check passed
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.

2 participants