[PR #80] [MERGED] Expand story view capabilities #93

Closed
opened 2026-03-14 12:31:45 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/aome510/hackernews-TUI/pull/80
Author: @aome510
Created: 9/5/2022
Status: Merged
Merged: 9/5/2022
Merged by: @aome510

Base: mainHead: expand-story-view-caps


📝 Commits (5)

  • 912e969 add StorySortMode and use it to retrieve HN stories
  • af90954 change by_date parameter to sort_mode
  • 919c116 handle job stories similar to story stories
  • 4f4202c update story title bar based on the sort mode
  • f688c25 rename toggle_sort_by_date to cycle_sort_mode

📊 Changes

10 files changed (+139 additions, -55 deletions)

View changed files

📝 README.md (+1 -1)
📝 examples/hn-tui.toml (+1 -1)
📝 hackernews_tui/src/client/mod.rs (+40 -24)
📝 hackernews_tui/src/client/query.rs (+37 -0)
📝 hackernews_tui/src/config/keybindings.rs (+2 -2)
📝 hackernews_tui/src/view/async_view.rs (+5 -5)
📝 hackernews_tui/src/view/help_view.rs (+4 -4)
📝 hackernews_tui/src/view/mod.rs (+11 -3)
📝 hackernews_tui/src/view/search_view.rs (+1 -1)
📝 hackernews_tui/src/view/story_view.rs (+37 -14)

📄 Description

Changes

  • introduce story sort mode to replace initial sort "by_date". Story sort mode includes: None, Date, and Point.
    • update story retrieving/constructing codes to use sort_mode as a parameter instead of by_date
  • if None sort mode is specified, use a combination of HN Algolia APIs and HN official APIs to retrieve ask_hn and show_hn stories in the same order as displayed in the http://news.ycombinator.com/ website.

Breaking changes

  • rename toggle_sort_by_date command to cycle_sort_mode

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/aome510/hackernews-TUI/pull/80 **Author:** [@aome510](https://github.com/aome510) **Created:** 9/5/2022 **Status:** ✅ Merged **Merged:** 9/5/2022 **Merged by:** [@aome510](https://github.com/aome510) **Base:** `main` ← **Head:** `expand-story-view-caps` --- ### 📝 Commits (5) - [`912e969`](https://github.com/aome510/hackernews-TUI/commit/912e969ad4503573d3ac9ea864d7a88764e32c1e) add `StorySortMode` and use it to retrieve HN stories - [`af90954`](https://github.com/aome510/hackernews-TUI/commit/af90954924cc11960f5128b028c5c6f8d561dff4) change `by_date` parameter to `sort_mode` - [`919c116`](https://github.com/aome510/hackernews-TUI/commit/919c1162c58f95a4405a9d8613614483fe27e55c) handle `job` stories similar to `story` stories - [`4f4202c`](https://github.com/aome510/hackernews-TUI/commit/4f4202c6b52a22943125100e7e6bd11ad3bde047) update story title bar based on the sort mode - [`f688c25`](https://github.com/aome510/hackernews-TUI/commit/f688c2595cc1a3fb0b89149b4411066e2cdf7675) rename `toggle_sort_by_date` to `cycle_sort_mode` ### 📊 Changes **10 files changed** (+139 additions, -55 deletions) <details> <summary>View changed files</summary> 📝 `README.md` (+1 -1) 📝 `examples/hn-tui.toml` (+1 -1) 📝 `hackernews_tui/src/client/mod.rs` (+40 -24) 📝 `hackernews_tui/src/client/query.rs` (+37 -0) 📝 `hackernews_tui/src/config/keybindings.rs` (+2 -2) 📝 `hackernews_tui/src/view/async_view.rs` (+5 -5) 📝 `hackernews_tui/src/view/help_view.rs` (+4 -4) 📝 `hackernews_tui/src/view/mod.rs` (+11 -3) 📝 `hackernews_tui/src/view/search_view.rs` (+1 -1) 📝 `hackernews_tui/src/view/story_view.rs` (+37 -14) </details> ### 📄 Description ## Changes - introduce story sort mode to replace initial sort "by_date". Story sort mode includes: `None`, `Date`, and `Point`. + update story retrieving/constructing codes to use `sort_mode` as a parameter instead of `by_date` - if `None` sort mode is specified, use a combination of HN Algolia APIs and HN official APIs to retrieve `ask_hn` and `show_hn` stories in the same order as displayed in the http://news.ycombinator.com/ website. + **Related**: #79 ## Breaking changes - rename `toggle_sort_by_date` command to `cycle_sort_mode` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-14 12:31:45 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hackernews-TUI#93
No description provided.