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

Changing the UI structure #216

Closed
Builditluc opened this issue Aug 12, 2023 · 5 comments
Closed

Changing the UI structure #216

Builditluc opened this issue Aug 12, 2023 · 5 comments
Labels
breaking-change This introduces a breaking change to the codebase. Increment the major version type: refactor Changes to the style and structure of the codebase or project
Milestone

Comments

@Builditluc
Copy link
Owner

Builditluc commented Aug 12, 2023

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
@Builditluc Builditluc moved this from Todo to In Development in wiki-tui: Roadmap Aug 14, 2023
@Builditluc Builditluc added type: refactor Changes to the style and structure of the codebase or project breaking-change This introduces a breaking change to the codebase. Increment the major version labels Aug 14, 2023
@Builditluc
Copy link
Owner Author

Builditluc commented Aug 14, 2023

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:

  • Rewriting wiki::parser #219
    The parser currently relies on the cursive::theme::Effect and cursive::theme::Style objects 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

  • Simplify wiki::Article #218
    The Element struct given to the article by the parser currently relies on the cursive::theme::Style object 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 Article that we could remove to reduce complexity. I'll create another issue addressing the simplification of the Article struct

  • Rewrite the wiki::search module #217
    Here we currently use two different methods to fetch data from the Search struct. For some properties we fetch them directly and for other properties we use getter methods. 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 Search struct 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 separate SearchContinue (the name should be chosen better of course) struct only including the values needed would be better.

@Builditluc
Copy link
Owner Author

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

@ethamck
Copy link
Contributor

ethamck commented Aug 14, 2023

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.

Example where wiki-tui is scaled to 0.25 on a 1600x900 display so only 80 columns are visible
_

@Builditluc
Copy link
Owner Author

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!

@Builditluc
Copy link
Owner Author

Closing this since #220 already addresses the new UI

@github-project-automation github-project-automation bot moved this from In Development to Done in wiki-tui: Roadmap Aug 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change This introduces a breaking change to the codebase. Increment the major version type: refactor Changes to the style and structure of the codebase or project
Projects
Status: Done
Development

No branches or pull requests

2 participants