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

Rewrite to use Charm ecosystem #289

Open
makew0rld opened this issue Dec 22, 2021 · 0 comments
Open

Rewrite to use Charm ecosystem #289

makew0rld opened this issue Dec 22, 2021 · 0 comments
Labels
documentation Improvements or additions to documentation enhancement New feature or request performance question Further information is requested UI Deals with the visual user interface

Comments

@makew0rld
Copy link
Owner

makew0rld commented Dec 22, 2021

This is just an idea, and not something coming anytime soon, if at all.

The current UI framework, cview, would be replaced by Bubble Tea and other projects from @charmbracelet.

Doing this would qualify for increasing Amfora's major version number (Amfora 2), as it would be a complete visual redesign and would break themes and probably some other UI config options.

For

  • Bubble Tea uses The Elm Architecture pattern, as opposed to cview's callback structure
  • All current rendering issues would be gone, as they were caused by cview bugs
    • Maybe Mouse scrolling doesn't work in Windows Terminal #183 wouldn't be solved, needs testing but ultimately it doesn't matter
    • It's possible I could fix these issues in cview myself, but when I've looked into the code in the past I had a hard time understanding it, let alone debugging it
  • Probably conforms to semver better than cview, allowing for easier upgrades
  • UI components would mostly be made by hand, allowing for more control and less fighting with cview
    • Would require less hacking to do something like Remove left margin when scrolling #197, which was a lot of hacking and work to do, and is still an annoying section to come back to and maintain if needed
    • Other code for tabs like "saving" and "applying" the bottombar works fine now but is hacky and would be avoided by this

Against

  • The rendering issues might get solved by the cview dev in the future
  • It would be a lot of work, basically a complete rewrite of all the UI code (code in display/) which is the bulk of Amfora
  • And arguably for small gain. While the problems it would solve (listed above) are annoying, they don't really matter for most usage, and things work well overall
  • Possibly less stable API than cview since still in v0
  • UI components would be more work to write initially, as there aren't premade ones like modals etc
  • UI keyboard focus flow would likely require significant extra code, because that isn't handled by Bubble Tea
    • So keeping track of what's in focus, and then moving focus when modals are exited, tab key is pressed, etc, would all need to be written

Honestly, a major part of why I've written this up is because the @charmbracelet stuff seems super cool and I feel like I need to use it. I will write something smaller using it from scratch, as a way to try it out, and maybe to get it out of my system 😉. For now this will just remain another far off idea I wanted to record just in case.

@makew0rld makew0rld added documentation Improvements or additions to documentation enhancement New feature or request question Further information is requested UI Deals with the visual user interface performance labels Dec 22, 2021
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 performance question Further information is requested UI Deals with the visual user interface
Projects
None yet
Development

No branches or pull requests

1 participant