wiki-tui
wiki-tui copied to clipboard
Changing the UI structure
Part of the Conversion from Cursive to Ratatui
This issue tracks the change of the UI structure. Any idea / issue or discussion is highly appreciated!
Requirements for the UI
- Open Articles (by either ID or Page Title)
- Search for a query (with pagination)
- Everything has to work even when changing the language
Decouple the backend from cursive (and make it cleaner)
The first thing would be to decouple the wiki module fully from the cursive library. I've been seeing the following things that would need adjustment:
-
[ ] #219 The parser currently relies on the
cursive::theme::Effectandcursive::theme::Styleobjects to set the effect and styles of the parsed Elements. We would need to rethink about how the Elements of the parser are structured. I'll create a new issue for rewriting the parser -
[ ] #218 The
Elementstruct given to the article by the parser currently relies on thecursive::theme::Styleobject to describe its style. It would be removed and replaced by the rewrite of the parser, so that wouldn't be an issue.When looking through the file, there are several unused things in the
Articlethat we could remove to reduce complexity. I'll create another issue addressing the simplification of theArticlestruct -
[x] #217 Here we currently use two different methods to fetch data from the
Searchstruct. For some properties we fetch them directly and for other properties we usegettermethods. In a separate issue, I would rewrite the struct to only use one method.This will be addressed in a separate issue, however, I want to reduce the amount of cloning the
Searchstruct over and over again. One example would be for continuing the search. Currently, we clone the struct but we only need some values for continuing the search, so a separateSearchContinue(the name should be chosen better of course) struct only including the values needed would be better.
Check ratatui for requirements
We need to check if ratatui satisfies all of our needs. I'm collecting all of them below (additions are greatly appreciated!):
- [ ] Work asynchronously (UI in the main and Wiki in a secondary thread)
- [ ] Create and manage multiple layers
- [ ] Popups
- [ ] Custom Events
- [ ] Custom borders (Round, Line, or no borders)
- [ ] Custom theme (general colors, but also more specific changes)
- [ ] Custom Views
or no borders
If the UI is changed, I'd love a way to disable everything other than the main page view, including the border. I've already disabled the table of contents in my config. On a tiling window manager, there is often not enough space for multiple panes at once, and on smaller terminals, even three extra columns would be a nice addition, plus the window would better blend in with their setup.
Yes of course and I definitely see your point. I'm planning on having different "layouts" that can be switched in the config. If you want I can notify you when I'm implementing it so you can try it out check if it fits your needs!
Closing this since #220 already addresses the new UI