[PR #84] [MERGED] Refactor modeling, parsing, and client codes #97

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

📋 Pull Request Information

Original PR: https://github.com/aome510/hackernews-TUI/pull/84
Author: @aome510
Created: 2/1/2023
Status: Merged
Merged: 2/2/2023
Merged by: @aome510

Base: mainHead: 30-01-refactor


📝 Commits (10+)

  • 4871e91 move HN structs in client module to a new module model
  • 39cce6c update structs usage, clean imports
  • 97eb199 update gitignore to include .DS_Store
  • 7ae3542 clean up data representing in model.rs
  • 80b880b rename StoryData to StoryHiddenData
  • 960c962 remove redundant function documentations
  • 8852b64 mention that lazy_load_story_comments lazily loads top comments
  • 94762ba remove text parsing codes from conversion functions in parser.rs
  • ad45a52 move HTML parsing codes (to parse HN text) to a new parser module
  • 8b73986 move parsing codes from client module to parser module

📊 Changes

18 files changed (+1060 additions, -1025 deletions)

View changed files

📝 .gitignore (+3 -0)
📝 hackernews_tui/src/client/mod.rs (+30 -45)
hackernews_tui/src/client/model.rs (+153 -0)
hackernews_tui/src/client/parser.rs (+0 -858)
📝 hackernews_tui/src/main.rs (+2 -0)
hackernews_tui/src/model.rs (+235 -0)
hackernews_tui/src/parser/article.rs (+360 -0)
hackernews_tui/src/parser/html.rs (+148 -0)
hackernews_tui/src/parser/mod.rs (+5 -0)
📝 hackernews_tui/src/parser/rcdom.rs (+0 -0)
📝 hackernews_tui/src/prelude.rs (+1 -1)
📝 hackernews_tui/src/utils.rs (+5 -0)
📝 hackernews_tui/src/view/article_view.rs (+4 -4)
📝 hackernews_tui/src/view/async_view.rs (+2 -2)
📝 hackernews_tui/src/view/comment_view.rs (+98 -99)
📝 hackernews_tui/src/view/mod.rs (+1 -1)
📝 hackernews_tui/src/view/search_view.rs (+2 -2)
📝 hackernews_tui/src/view/story_view.rs (+11 -13)

📄 Description

Changes

  • separated modeling and parsing codes
    • renamed client::parser to client::model
    • added parser module
    • moved parsing codes from client to a dedicated parser module
  • split client data models (client::model) and HN data models (new model module)
  • split parsing codes into different modules
    • html for parsing HTML text
    • article for parsing web article
  • and many other cleanups, variable/function naming changes, code refactoring, and more documentation

🔄 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/84 **Author:** [@aome510](https://github.com/aome510) **Created:** 2/1/2023 **Status:** ✅ Merged **Merged:** 2/2/2023 **Merged by:** [@aome510](https://github.com/aome510) **Base:** `main` ← **Head:** `30-01-refactor` --- ### 📝 Commits (10+) - [`4871e91`](https://github.com/aome510/hackernews-TUI/commit/4871e9194c14bb33af16320767e8fc32acca5520) move HN structs in `client` module to a new module `model` - [`39cce6c`](https://github.com/aome510/hackernews-TUI/commit/39cce6c9b2b183640db327c3d28c52fba5801797) update structs usage, clean imports - [`97eb199`](https://github.com/aome510/hackernews-TUI/commit/97eb199fa093755bba6e2ec3cad7962eb89a474b) update gitignore to include .DS_Store - [`7ae3542`](https://github.com/aome510/hackernews-TUI/commit/7ae3542759fc51f0114a851357a3827d5b6638b2) clean up data representing in `model.rs` - [`80b880b`](https://github.com/aome510/hackernews-TUI/commit/80b880b800c52de0396c63a8b2c036d11d0c2432) rename `StoryData` to `StoryHiddenData` - [`960c962`](https://github.com/aome510/hackernews-TUI/commit/960c96272e07b66fa94f4bdb41d4803765f7ac29) remove redundant function documentations - [`8852b64`](https://github.com/aome510/hackernews-TUI/commit/8852b6475e59cacaa6665afdfb060de0a4fd3ca9) mention that `lazy_load_story_comments` lazily loads **top** comments - [`94762ba`](https://github.com/aome510/hackernews-TUI/commit/94762bad8acb40dacbf9c6c0d3b71aafe67d0598) remove text parsing codes from conversion functions in `parser.rs` - [`ad45a52`](https://github.com/aome510/hackernews-TUI/commit/ad45a52f4d1c82f4be640b01d7ee60ed0cde3fe3) move HTML parsing codes (to parse HN text) to a new parser module - [`8b73986`](https://github.com/aome510/hackernews-TUI/commit/8b73986770631e0e898e20e49c81b15160602c1b) move parsing codes from `client` module to `parser` module ### 📊 Changes **18 files changed** (+1060 additions, -1025 deletions) <details> <summary>View changed files</summary> 📝 `.gitignore` (+3 -0) 📝 `hackernews_tui/src/client/mod.rs` (+30 -45) ➕ `hackernews_tui/src/client/model.rs` (+153 -0) ➖ `hackernews_tui/src/client/parser.rs` (+0 -858) 📝 `hackernews_tui/src/main.rs` (+2 -0) ➕ `hackernews_tui/src/model.rs` (+235 -0) ➕ `hackernews_tui/src/parser/article.rs` (+360 -0) ➕ `hackernews_tui/src/parser/html.rs` (+148 -0) ➕ `hackernews_tui/src/parser/mod.rs` (+5 -0) 📝 `hackernews_tui/src/parser/rcdom.rs` (+0 -0) 📝 `hackernews_tui/src/prelude.rs` (+1 -1) 📝 `hackernews_tui/src/utils.rs` (+5 -0) 📝 `hackernews_tui/src/view/article_view.rs` (+4 -4) 📝 `hackernews_tui/src/view/async_view.rs` (+2 -2) 📝 `hackernews_tui/src/view/comment_view.rs` (+98 -99) 📝 `hackernews_tui/src/view/mod.rs` (+1 -1) 📝 `hackernews_tui/src/view/search_view.rs` (+2 -2) 📝 `hackernews_tui/src/view/story_view.rs` (+11 -13) </details> ### 📄 Description ## Changes - separated modeling and parsing codes + renamed `client::parser` to `client::model` + added `parser` module + moved parsing codes from `client` to a dedicated `parser` module - split client data models (`client::model`) and HN data models (new `model` module) - split parsing codes into different modules + `html` for parsing HTML text + `article` for parsing web article - and many other cleanups, variable/function naming changes, code refactoring, and more documentation --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-14 12:32:01 +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#97
No description provided.