mirror of
https://github.com/aome510/hackernews-TUI.git
synced 2026-04-26 09:25:56 +03:00
[PR #71] [MERGED] Implement different view traits/helpers Part I #86
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hackernews-TUI#86
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/aome510/hackernews-TUI/pull/71
Author: @aome510
Created: 5/1/2022
Status: ✅ Merged
Merged: 5/2/2022
Merged by: @aome510
Base:
main← Head:impl-view-traits📝 Commits (10+)
a61fe34reimplementScrollableList6bbb785implement on_scroll_event_view traits and add scroll keymap62ba7e5wip rewrite help view interfaced3b3c5dimplement a basic help view for story viewa60c054cleanupf41e11cimplement default other/view-navigation commands7a1e1b0implement help view for comment view50ba876implement help view for article view, search view, default help viewc852e01add additional vim-like keybindings to scroll keymap5980f31implementconstruct_on_event_help_view📊 Changes
12 files changed (+637 additions, -476 deletions)
View changed files
📝
examples/hn-tui.toml(+8 -11)📝
hackernews_tui/src/config/keybindings.rs(+28 -25)📝
hackernews_tui/src/main.rs(+1 -1)📝
hackernews_tui/src/utils.rs(+1 -1)📝
hackernews_tui/src/view/article_view.rs(+15 -30)📝
hackernews_tui/src/view/comment_view.rs(+47 -28)📝
hackernews_tui/src/view/help_view.rs(+326 -256)➖
hackernews_tui/src/view/list_view.rs(+0 -116)📝
hackernews_tui/src/view/mod.rs(+1 -1)📝
hackernews_tui/src/view/search_view.rs(+1 -1)📝
hackernews_tui/src/view/story_view.rs(+39 -6)➕
hackernews_tui/src/view/traits.rs(+170 -0)📄 Description
Brief description of changes
hackernews_tui/src/view/traits.rs)ListViewContainerconsists of methods to interact with the inner list view (LinearLayout)ScrollViewContainerconsists of methods to get the inner scroll viewOnScrollEventViewdefines theon_scroll_eventsmethod that adds callbacks for scrolling events (triggered by newScrollKeymapkeymaps)AutoScrollingdefines thescrollmethod that automatically scrolls to the inner view's important areaScrollKeymapstruct defined keybindings for scrolling commandshackernews_tui/src/view/help_view.rsCommandandCommandGroupstructsto_*_viewmethod for the new structs to convert into the corresponding viewHelpViewusing the new structs instead ofVec<String, (String, String)>like previouslyBreaking changes
ArticleViewKeymapandCommandViewKeymapin favour of commands defined by the newScrollKeymap🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.