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

zsv playground #299

Merged
merged 24 commits into from
Nov 28, 2024
Merged

zsv playground #299

merged 24 commits into from
Nov 28, 2024

Conversation

iamazeem
Copy link
Collaborator

@iamazeem iamazeem commented Nov 22, 2024

  • Separate job for wasm build
  • Separate job for deploying wasm build to GitHub Pages
  • Fix compiler warnings
  • Fix test coloring issue (replace echo -e with printf)
  • Ignore generated files
  • Add support for stdin
    • not feasible to handle generically both for csv input and command line prompting
  • Add support for adding files
  • Test
    • With multiple browsers e.g. chrome, firefox, etc.
    • Make sure the cache is disabled during testing to avoid any surprises and/or side effects later
  • Update README

Other misc updates:

  • Use NO_THREADING to skip -pthread flag
  • Use NO_STDIN to disable stdin input for consistency
  • Introduce NO_PLAYGROUND CLI flag for conditional switching of flags and main function name for playground and the rest

Resolves #161

TODOs:

  • Verify deployment after merge to main
  • Fix issues if any

Signed-off-by: Azeem Sajid [email protected]

@iamazeem iamazeem added documentation Improvements or additions to documentation enhancement New feature or request labels Nov 22, 2024
@iamazeem iamazeem self-assigned this Nov 22, 2024
@iamazeem
Copy link
Collaborator Author

@liquidaty:
Going for a terminal style playground.
It seems more natural for a CLI app and there'll be no learning curve.

Here's an initial preview of the playground in the browser:

zsv-playground-demo-2

Targeting the basic functionality for an initial release.
Please do share your feedback on this.
Any specific features that should be in the initial release?

@iamazeem
Copy link
Collaborator Author

New demo:

zsv-playground-demo-3

@liquidaty
Copy link
Owner

Sounds good. Is it possible to run sheet in the playground? I am guessing it is not possible, but if it was, that would be very cool. I have seen a wasm build for ncurses, but have no idea whether there is any way to make it work on a web page.

@iamazeem
Copy link
Collaborator Author

@liquidaty:

Is it possible to run sheet in the playground? I am guessing it is not possible, but if it was, that would be very cool.

Initially, I started looking for something that could enable sheet as well but found nothing promising.
Most of the examples were using a client/server model using SSH to display n/curses TUIs.

I have seen a wasm build for ncurses, but have no idea whether there is any way to make it work on a web page.

Is this the one?
https://github.com/jamesbiv/ncurses-emscripten

@iamazeem
Copy link
Collaborator Author

@liquidaty: Please review. Thanks!

You may test the latest build locally from https://github.com/liquidaty/zsv/actions/runs/11995887192.

Here's the latest demo on firefox:

zsv-playground-demo-4

@liquidaty
Copy link
Owner

@iamazeem this is great! Just two suggestions for now:

  • add "rm" command-- this can simply be an alias for "zsv rm"
  • add some sort of filename autocomplete when "tab" is entered. This does not have to be sophisticated; the main thing here is to make it easy to enter a file name into the command line, without having to exactly remember what the file name was

@liquidaty
Copy link
Owner

Two more!

  • add a "save" command to download a file
  • add a "wipe" command (maybe there is a better name for it?) to wipe out all saved data. Maybe also offer to do this when the web page is unloaded?

@iamazeem
Copy link
Collaborator Author

@liquidaty

add a "wipe" command (maybe there is a better name for it?) to wipe out all saved data. Maybe also offer to do this when the web page is unloaded?

Could you please elaborate this a bit?
IIUC, the FS data is automatically deleted when the tab is closed.

@iamazeem
Copy link
Collaborator Author

@liquidaty: Here's the demo with the latest changes (save, rm, and TAB autocompletion):

Workflow run: https://github.com/liquidaty/zsv/actions/runs/12004676940
GitHub Pages artifact: https://github.com/liquidaty/zsv/actions/runs/12004676940/artifacts/2231345890

Demo:

zsv-playground-demo-5

Regarding wipe command, rm supports multiple arguments.
That should serve the purpose of removing multiple files if that's what you meant earlier.

Fixed the flushing issue in bf144bd.
The zsv_writer_delete seemed the right place to do it.

Please review the PR again. Thanks!

PS:
Observed an issue with zsv flatten command. See #303.

@iamazeem iamazeem requested a review from liquidaty November 26, 2024 07:01
@iamazeem
Copy link
Collaborator Author

@liquidaty: Please review and test on your side.
The TAB autocompletion has also been implemented for zsv commands and flags.

Workflow run: https://github.com/liquidaty/zsv/actions/runs/12056785696
GitHub Pages artifact: https://github.com/liquidaty/zsv/actions/runs/12056785696/artifacts/2246338901

Demo:

zsv-playground-demo-6

@liquidaty liquidaty merged commit 54ea5dc into main Nov 28, 2024
13 checks passed
@iamazeem
Copy link
Collaborator Author

@liquidaty: Online playground is live now: https://liquidaty.github.io/zsv/ 🎉 🎉 🎉

@iamazeem iamazeem deleted the zsv-playground branch November 28, 2024 05:17
@iamazeem
Copy link
Collaborator Author

iamazeem commented Nov 28, 2024

test-sheet-3 is failing on find (f) command for any search string with sigsegv 11 (invalid memory access).
https://github.com/liquidaty/zsv/actions/runs/12062759876/job/33636928077#step:5:1239

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

zsv-playground (https://github.com/iamazeem/zsv-playground)
2 participants