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

[WIP] UI improvements for structural editor #32

Merged
merged 9 commits into from
Oct 6, 2021

Conversation

ThePuzzlemaker
Copy link
Contributor

@ThePuzzlemaker ThePuzzlemaker commented Oct 1, 2021

I like making CLI apps :)

What's here so far

  • Use std::fmt for centering, makes code cleaner
  • Add labels to pattern and replacement half

What's to come... maybe

  • Maybe switch to crossterm or maybe even tui-rs
  • Help page
  • Color! (Maybe unicode too?). Obviously configurable
  • Perhaps configurable keybindings
  • Overall UI/aesthetic improvements
  • Overall cleanup of editor code
  • Refresh on resize, and other quality-of-life improvements
  • Proper handling of long text in patterns/replacement

Notes

This technically depends on #31 because git is hard. If you don't want to merge that for whatever reason (or need me to change it), let me know and I'll rebase as needed :)

This is not fully tested, but neither is the original as far as I know, so uh... here be dragons :P

Let me know if there's anything I should add here! I'd probably be willing to work on it :)

@brightly-salty
Copy link
Collaborator

Those all sound like great ideas. I suspect switching to crossterm will make a lot of them easier, so I'll go ahead and look into that and maybe go ahead and commit to rust.

@ThePuzzlemaker ThePuzzlemaker force-pushed the ui-improvements branch 2 times, most recently from 2a8edbd to 08c3aba Compare October 4, 2021 00:52
brightly-salty added a commit that referenced this pull request Oct 5, 2021
* AST/parser changes, remove anyhow

Patched out editor for now just because it'd be too borked

Co-authored-by: Caden Haustein <code@brightlysalty.33mail.com>

* Use unic-ucd-category intead of unic-ucd

Co-authored-by: Caden Haustein <code@brightlysalty.33mail.com>
ThePuzzlemaker and others added 5 commits October 4, 2021 20:04
This makes everything cleaner! With some algebra and code™, it's
possible to use `format!` for centering text.

This commit also adds labels to the pattern and replacement half, just
being centered boxes `| Pattern |` and `| Replacement |` in the usually
bland `--------`(...) line after the status.
Squash of:
- Switch from termion to crossterm (@brightly-salty)
- Abstract away a view for easier layouting (@brightly-salty)
- Add lockfile (@ThePuzzlemaker)
- Undo some AST/parser changes (@ThePuzzlemaker)

Co-authored-by: ThePuzzlemaker <tpzker@thepuzzlemaker.info>
src/interactive.rs Outdated Show resolved Hide resolved
@brightly-salty brightly-salty marked this pull request as ready for review October 6, 2021 23:41
@brightly-salty brightly-salty merged commit 8079404 into mlatu-lang:rust Oct 6, 2021
brightly-salty added a commit that referenced this pull request Oct 7, 2021
* Initial Rust work

* Fix clippy hints, better error handling

* Build time + runtime improvements

* Add structured editor

* Fix prelude and allow newlines/CR (#31)

* AST/Parser changes (From #34&#32, separated into this PR) (#36)

* AST/parser changes, remove anyhow

Patched out editor for now just because it'd be too borked

Co-authored-by: Caden Haustein <code@brightlysalty.33mail.com>

* Use unic-ucd-category intead of unic-ucd

Co-authored-by: Caden Haustein <code@brightlysalty.33mail.com>

* [WIP] Improved codegen (#34)

* UI improvements for structural editor (#32)

* Use std::fmt for centering, add labels for halves

This makes everything cleaner! With some algebra and code™, it's
possible to use `format!` for centering text.

This commit also adds labels to the pattern and replacement half, just
being centered boxes `| Pattern |` and `| Replacement |` in the usually
bland `--------`(...) line after the status.

* Fix rule index (off-by-one errors go brrr)

* Switch from termion to crossterm

Squash of:
- Switch from termion to crossterm (@brightly-salty)
- Abstract away a view for easier layouting (@brightly-salty)
- Add lockfile (@ThePuzzlemaker)
- Undo some AST/parser changes (@ThePuzzlemaker)

Co-authored-by: ThePuzzlemaker <tpzker@thepuzzlemaker.info>

* Fix code for new AST, make pretty_rule use &[Term] instead of Vec<Term>

* Rebase and fix

* Add failing interactive mode

* Improve interactive rewriter

* Fix prelude + mlatu.pl

* Add CLI + standardize keybindings

Co-authored-by: Caden Haustein <code@brightlysalty.33mail.com>

* Update documentation

Co-authored-by: James [Undefined] <tpzker@thepuzzlemaker.info>
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