[PR #16] [MERGED] [no-issue] Code Refactor I #44

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

📋 Pull Request Information

Original PR: https://github.com/aome510/hackernews-TUI/pull/16
Author: @aome510
Created: 3/15/2021
Status: Merged
Merged: 3/16/2021
Merged by: @aome510

Base: mainHead: no-issue-refactor-p1


📝 Commits (10+)

  • f2dba36 use String for title,url,author,comment_text instead of Option
  • 019221c refactor hn_client
  • 526885a refactor story_view
  • 8f8c6f0 refactor comment_view
  • accb171 refactor error_view
  • 86e212c refactor others
  • dccf6fc use Vec instead of Box
  • 750b69b don't include hightlight_result when getting comments only
  • 32ba976 implement text highlighting for matched string
  • 48028a1 remove em from story_title in comment_view

📊 Changes

12 files changed (+330 additions, -159 deletions)

View changed files

📝 src/hn_client.rs (+163 -60)
📝 src/main.rs (+4 -2)
📝 src/view/async_view.rs (+19 -12)
📝 src/view/comment_view.rs (+30 -30)
📝 src/view/error_view.rs (+25 -5)
📝 src/view/event_view.rs (+2 -5)
📝 src/view/fn_view_wrapper.rs (+1 -1)
📝 src/view/help_view.rs (+1 -1)
📝 src/view/search_view.rs (+13 -8)
📝 src/view/story_view.rs (+60 -26)
📝 src/view/text_view.rs (+2 -1)
📝 src/view/utils.rs (+10 -8)

📄 Description

Brief description of changes

  • clean up client codes by separating response structs and parsed data structs.
  • add more documentation
  • simplify logic in some places.
  • add match highlighting for SearchView.

🔄 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/16 **Author:** [@aome510](https://github.com/aome510) **Created:** 3/15/2021 **Status:** ✅ Merged **Merged:** 3/16/2021 **Merged by:** [@aome510](https://github.com/aome510) **Base:** `main` ← **Head:** `no-issue-refactor-p1` --- ### 📝 Commits (10+) - [`f2dba36`](https://github.com/aome510/hackernews-TUI/commit/f2dba366f1b3b1fc5d47b1a2140894cfcb948fd2) use String for title,url,author,comment_text instead of Option<String> - [`019221c`](https://github.com/aome510/hackernews-TUI/commit/019221c83b5e1afd6026de3d88cb189038436a3f) refactor hn_client - [`526885a`](https://github.com/aome510/hackernews-TUI/commit/526885a096db789940c220a79b89cf4e295ab71b) refactor story_view - [`8f8c6f0`](https://github.com/aome510/hackernews-TUI/commit/8f8c6f00717fa9d2c846a607134ecb31407a8927) refactor comment_view - [`accb171`](https://github.com/aome510/hackernews-TUI/commit/accb171c3dbc5ff64f444807d2ac8c4018c0c18f) refactor error_view - [`86e212c`](https://github.com/aome510/hackernews-TUI/commit/86e212c94db94554a92bd7c89c6ecabe27fea20d) refactor others - [`dccf6fc`](https://github.com/aome510/hackernews-TUI/commit/dccf6fc41539d0470fb7ed8127e4bf36cbec8fb9) use Vec<comment> instead of Box<comment> - [`750b69b`](https://github.com/aome510/hackernews-TUI/commit/750b69bd4cea9340d23d25b60acf5716601bff15) don't include hightlight_result when getting comments only - [`32ba976`](https://github.com/aome510/hackernews-TUI/commit/32ba97621840e8de4f369e5cc71f56b4d9f35f53) implement text highlighting for matched string - [`48028a1`](https://github.com/aome510/hackernews-TUI/commit/48028a190eab1099eb95f6371dc3e61fdf21f8d2) remove em from story_title in comment_view ### 📊 Changes **12 files changed** (+330 additions, -159 deletions) <details> <summary>View changed files</summary> 📝 `src/hn_client.rs` (+163 -60) 📝 `src/main.rs` (+4 -2) 📝 `src/view/async_view.rs` (+19 -12) 📝 `src/view/comment_view.rs` (+30 -30) 📝 `src/view/error_view.rs` (+25 -5) 📝 `src/view/event_view.rs` (+2 -5) 📝 `src/view/fn_view_wrapper.rs` (+1 -1) 📝 `src/view/help_view.rs` (+1 -1) 📝 `src/view/search_view.rs` (+13 -8) 📝 `src/view/story_view.rs` (+60 -26) 📝 `src/view/text_view.rs` (+2 -1) 📝 `src/view/utils.rs` (+10 -8) </details> ### 📄 Description **Brief description of changes** - clean up client codes by separating response structs and parsed data structs. - add more documentation - simplify logic in some places. - add match highlighting for `SearchView`. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-14 12:29:04 +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#44
No description provided.