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] Implement all existing features #232

Merged
merged 19 commits into from
Jul 31, 2024
Merged

[Rewrite] Implement all existing features #232

merged 19 commits into from
Jul 31, 2024

Conversation

Builditluc
Copy link
Owner

@Builditluc Builditluc commented May 26, 2024

Linked Issues:

This PR is also linked to the first PR (#226).

In this PR, I aim to reimplement all existing features for wiki-tui.

TODO

  • ToC (Table of Contents)
  • Links
    • link selection
    • link opening
  • Scrolling
    • prevent Scrollover
    • existing vim-motions for scrolling (G, gg, ctrl-d, ctrl-u)
  • Search
    • continue the search
    • handle errors (no results, suggestions for another query)
  • Language
    • switch search language (F2)
    • switch page language (F3)
  • Status Bar
    • show current language / other languages
    • show article name
  • Configuration
  • Popups
    • Confirmation popups (changing language, etc.)
    • Error popups (error when opening a page, etc.)

Note: Configuration will be last, because I want to finish implementing the features first

Builditluc added 19 commits May 18, 2024 19:25
- add: NoResults and Suggestion search events
- add: implement SearchContinue action
- fix: fix trace_dbg macro (logging)
- add toggle for the toc
- implement header jumping for the toc
- implement autofocus of the toc
- key 't' will toggle focus of the toc
- always show the toc
- remove old static bar
- add search status bar
- add page status bar
- press 'Enter' to open a selected link
- currently, no popup opens, the link is automatically opened (ESC to
  pop the page and return)
- implement loading of .html pages for debugging
- add test-page with link examples
- chore(*): update rust-toolchain to 1.77.2
- chore(tui): update ratatui to 0.26.3
- chore(tui): update tui-input to 0.9
- chore(tui): update tui-logger to 0.11.2
- refactor(tui): remove old link data structures
- fix(wiki-tui): update selection after scrolling
- fix(wiki-tui): udpate viewport after changing selection
- refactor(wiki-tui): remove code duplication
Fixes the issue of the parser falling back to English when encountering
an unknown language by using `Language::Unknown` as a fallback
Implements a popup to change the language of the currently loaded page
Implements a popup to change the language of future searches
The implemented structure passes Actions down to the next component when
ignored. First, a received Event or Action is handed to the currently
rendered popup (if one exists), and when an ActionResult::Ignored is
returned, the Event or Action is handed to either the Search or Page
component, depending on the context.

This fixes the issue where some Actions would be ignored due to them not
being routed to the correct component.
Removes the Help component because it was not needed
Implements and adds the MessagePopupComponent, which displays a message
as a dismissable popup
Implements a different kind of popup displaying an error message, for
example the search couldn't be executed
Implements a basic yes/no dialog when trying to open a page. Also adds
messages for when the link cannot be opened (an external link for
example)
@Builditluc Builditluc marked this pull request as ready for review July 31, 2024 20:10
@Builditluc Builditluc added state: approved This issue or pull request was approved and can be worked on 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 Jul 31, 2024
@Builditluc Builditluc self-assigned this Jul 31, 2024
@Builditluc Builditluc merged commit fad87a2 into main Jul 31, 2024
16 checks passed
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 state: approved This issue or pull request was approved and can be worked on type: refactor Changes to the style and structure of the codebase or project
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant