[PR #54] [MERGED] Rewrite theme structs #71

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

📋 Pull Request Information

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

Base: mainHead: rewrite-theme-struct


📝 Commits (9)

  • 343c0e3 delete all theme-related structs and construct new ones
  • 5be9ef8 implement ConfigParser for theme structs
  • 1c637e8 use theme::ComponentStyle to construct style for specific components
  • d97dbb7 implement default values for theme::Palette and theme::ComponentStyle
  • b992575 remove the use curisve::theme::PaletteColor for constructing styles
  • ee0f62b use app's color palette when parsing the colors
  • 34eebae add TODO to update theme section in the example config file
  • aee1bbe add documentation for main theme structs
  • bf1837a minor default color tweaks

📊 Changes

12 files changed (+244 additions, -182 deletions)

View changed files

📝 examples/hn-tui.toml (+1 -25)
📝 hackernews_tui/src/client/parser.rs (+5 -7)
📝 hackernews_tui/src/config/mod.rs (+2 -0)
📝 hackernews_tui/src/config/theme.rs (+196 -77)
📝 hackernews_tui/src/main.rs (+9 -4)
📝 hackernews_tui/src/utils.rs (+10 -18)
📝 hackernews_tui/src/view/article_view.rs (+10 -26)
📝 hackernews_tui/src/view/comment_view.rs (+1 -1)
📝 hackernews_tui/src/view/error_view.rs (+1 -1)
📝 hackernews_tui/src/view/help_view.rs (+3 -11)
📝 hackernews_tui/src/view/search_view.rs (+2 -5)
📝 hackernews_tui/src/view/story_view.rs (+4 -7)

📄 Description

Brief description of changes

  • rewrote the application's theme structs using Palette and ComponentStyle structures
    • Palette defines the terminal color scheme for the application, so that it can be compatible with other theme formats
    • ComponentStyle defines additional colors, styles for specific components of the application
  • wire up the new structs with the current application model to preserve the initial UI when using default configurations

🔄 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/54 **Author:** [@aome510](https://github.com/aome510) **Created:** 12/15/2021 **Status:** ✅ Merged **Merged:** 12/15/2021 **Merged by:** [@aome510](https://github.com/aome510) **Base:** `main` ← **Head:** `rewrite-theme-struct` --- ### 📝 Commits (9) - [`343c0e3`](https://github.com/aome510/hackernews-TUI/commit/343c0e37fe2a5814cbc4347ae16706c9c43f04c8) delete all theme-related structs and construct new ones - [`5be9ef8`](https://github.com/aome510/hackernews-TUI/commit/5be9ef80e980badc18bde4a53d0483e51b9b9df8) implement `ConfigParser` for theme structs - [`1c637e8`](https://github.com/aome510/hackernews-TUI/commit/1c637e8232d4d0da9131d416395e95e56d300ea6) use `theme::ComponentStyle` to construct style for specific components - [`d97dbb7`](https://github.com/aome510/hackernews-TUI/commit/d97dbb75c1c0dc1d180280af5b9f9276c31fdd51) implement default values for `theme::Palette` and `theme::ComponentStyle` - [`b992575`](https://github.com/aome510/hackernews-TUI/commit/b99257520890f0b2b56b7400e5ec0a4a872ab874) remove the use `curisve::theme::PaletteColor` for constructing styles - [`ee0f62b`](https://github.com/aome510/hackernews-TUI/commit/ee0f62b5437a031bc0a60ab4d4e0915dbb682565) use app's color palette when parsing the colors - [`34eebae`](https://github.com/aome510/hackernews-TUI/commit/34eebaec62c8344403d604997611c04fb6e7ca8e) add `TODO` to update `theme` section in the example config file - [`aee1bbe`](https://github.com/aome510/hackernews-TUI/commit/aee1bbef2ebb1467145c986891e49634880e583a) add documentation for main theme structs - [`bf1837a`](https://github.com/aome510/hackernews-TUI/commit/bf1837a0c01aaeb3eda5cf1ea042924c45613bea) minor default color tweaks ### 📊 Changes **12 files changed** (+244 additions, -182 deletions) <details> <summary>View changed files</summary> 📝 `examples/hn-tui.toml` (+1 -25) 📝 `hackernews_tui/src/client/parser.rs` (+5 -7) 📝 `hackernews_tui/src/config/mod.rs` (+2 -0) 📝 `hackernews_tui/src/config/theme.rs` (+196 -77) 📝 `hackernews_tui/src/main.rs` (+9 -4) 📝 `hackernews_tui/src/utils.rs` (+10 -18) 📝 `hackernews_tui/src/view/article_view.rs` (+10 -26) 📝 `hackernews_tui/src/view/comment_view.rs` (+1 -1) 📝 `hackernews_tui/src/view/error_view.rs` (+1 -1) 📝 `hackernews_tui/src/view/help_view.rs` (+3 -11) 📝 `hackernews_tui/src/view/search_view.rs` (+2 -5) 📝 `hackernews_tui/src/view/story_view.rs` (+4 -7) </details> ### 📄 Description ## Brief description of changes - rewrote the application's theme structs using `Palette` and `ComponentStyle` structures - `Palette` defines the terminal color scheme for the application, so that it can be compatible with [other theme formats](https://github.com/mbadolato/iTerm2-Color-Schemes) - `ComponentStyle` defines additional colors, styles for specific components of the application - wire up the new structs with the current application model to preserve the initial UI when using default configurations --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-14 12:30:40 +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#71
No description provided.