Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for customization via configuration file #573

Draft
wants to merge 25 commits into
base: main
Choose a base branch
from

Conversation

sarub0b0
Copy link
Owner

@sarub0b0 sarub0b0 commented Aug 8, 2024

  • load configuration file
  • custom UI theme
  • key binding
  • system

@sarub0b0 sarub0b0 linked an issue Aug 8, 2024 that may be closed by this pull request
@sarub0b0 sarub0b0 force-pushed the feature/conf-file branch from 47eee38 to 06945b3 Compare August 9, 2024 16:09
@sarub0b0 sarub0b0 force-pushed the feature/conf-file branch 2 times, most recently from bc40dc2 to 530ba5f Compare September 25, 2024 16:45
@sarub0b0 sarub0b0 force-pushed the feature/conf-file branch 2 times, most recently from f98d068 to 651c8de Compare October 6, 2024 14:37
@sarub0b0 sarub0b0 force-pushed the feature/conf-file branch 2 times, most recently from dd552f5 to 321f35a Compare October 9, 2024 18:11
sarub0b0 and others added 14 commits October 26, 2024 14:10
- Added figment and xdg dependencies for configuration management.
- Implemented Config struct to load settings from a YAML file.
- Introduced TabTheme struct for customizable tab styles.
- Updated Window and Render to use the new tab theme settings.
- Modified WindowBuilder to accept a TabTheme parameter.
This change allows configuration to be loaded from environment
variables prefixed with `KUBETUI_`, enhancing flexibility and
customizability.
- Introduced `HeaderTheme` struct to manage header styles.
- Updated `Theme` struct to include `HeaderTheme`.
- Modified `Window` and `WindowBuilder` to handle `HeaderTheme`.
- Updated `WindowInit` to use `HeaderTheme` for rendering headers.
- Adjusted header rendering logic to apply styles from `HeaderTheme`.
- Introduced `WidgetThemeConfig` for customizable widget themes.
- Updated various widgets to accept and apply the new theme config.
- Enhanced `WidgetConfig` to support theme-based styling.
- Added default theme settings for consistent UI appearance.
- Modified existing widgets to utilize the new theme settings.
- Introduced `InputFormTheme` struct to manage styles for prefix, content,
  and suffix.
- Updated `InputFormBuilder` to accept and apply the theme.
- Modified `InputForm` to use the theme styles during rendering.
- Introduced `TextTheme` struct to manage styles for search highlights and
  selection.
- Updated `TextBuilder` to accept and apply the theme.
- Modified `TextItem` to use the theme styles during rendering.
- Added `SearchHighlightStyle`, `SearchHighlightMatchesStyle`,
  `SearchHighlightFocusStyle`, and `SelectionStyle` for better customization.
This commit introduces a new text theme configuration for search and
selection functionalities. It includes the addition of `SearchThemeConfig`,
`SearchFormThemeConfig`, `SearchHighlightThemeConfig`, and
`SelectionThemeConfig` structs. These configurations allow customization
of search form styles, search highlight styles, and selection styles.
The changes also update the `WidgetThemeConfig` to include the new text
theme configurations, enhancing the flexibility and customization of
text-related UI elements.
This commit introduces a new table filter form theme configuration. It
includes the addition of `TableThemeConfig` and `FilterFormThemeConfig`
structs, allowing customization of filter form styles within tables.
The changes also update the `WidgetThemeConfig` to include the new table
theme configurations, enhancing the flexibility and customization of
table-related UI elements. Additionally, the `FilterForm` and
`FilterFormBuilder` structs are updated to support the new theme
configuration.
- Introduced DialogBuilder for constructing Dialogs with themes.
- Added DialogTheme struct to encapsulate dialog styles and sizes.
- Created StyledClear widget to allow styled clearing of areas.
- Updated Dialog to use StyledClear for rendering with styles.
- Introduced dialog theme configuration in `config.yaml`.
- Added `DialogThemeConfig` struct in `theme.rs`.
- Implemented `From<ThemeConfig>` for `DialogTheme`.
- Created `dialog.rs` for dialog-specific theme settings.
- Updated `widget.rs` to include dialog theme.
- Modified `window.rs` to apply dialog theme to dialogs.
- Added unit tests for dialog theme serialization and deserialization.
This commit introduces the `style_to_ansi` function, which converts a
`Style` struct to its corresponding ANSI escape code string. The function
handles foreground and background colors, as well as text modifiers like
bold, italic, and underlined. This enhancement improves the flexibility
of styling text in the terminal.
This commit introduces support for configuring the help dialog theme.
It includes the addition of a new `HelpThemeConfig` struct, which allows
customization of title, key, and description styles. The changes also modify
the `HelpDialog` to accept a theme configuration and apply the
specified styles to the help dialog elements. This enhancement improves
the flexibility and customization of the help dialog appearance.
- Introduced `ListThemeConfig` in the theme configuration.
- Updated `WidgetThemeConfig` to include `list` themes.
- Modified `SingleNamespaceDialog` to accept and apply the new themes.
- Added default implementations and builders for `FilterFormTheme` and
  `ListTheme`.
- Updated tests to cover the new theme configurations.
- Added `multiple_select` module to `widget.rs` for theme support.
- Implemented `FilterFormTheme` and `SelectFormTheme` for `multiple_select`.
- Updated `MultipleNamespacesDialog` to accept `ThemeConfig`.
- Enhanced `MultipleSelect` to use `MultipleSelectTheme`.
- Refactored `FilterForm` and `SelectForm` to use builders with themes.
- Added input form theme configuration to the config.yaml file.
- Created a new module `input` in `theme.rs` to handle input form themes.
- Implemented `InputFormThemeConfig` struct and its traits.
- Updated `WidgetThemeConfig` to include `input` field.
- Modified `log_query_widget` to use the new input form theme.
- Added relevant tests to ensure the new theme configuration works as expected.
- Added `header` field to `TableThemeConfig` in `config.yaml`.
- Created `TableTheme` struct in `table.rs` to handle table header themes.
- Implemented default header style for `TableTheme`.
- Modified `config_widget`, `network_widget`, and `pod_widget` to use the new
  table header theme.
- Added relevant tests to ensure the new table header theme configuration
  works as expected.
@sarub0b0 sarub0b0 added this to the 1.6.0 milestone Dec 16, 2024
Refactored the PollerBase struct out of the codebase and replaced it with
individual fields in the respective poller structs. This change simplifies
the code and makes the poller structs more self-contained. Updated all
poller implementations to use the new structure.
Added configuration options for customizing pod table highlights based
on pod statuses. Users can now define highlight rules in the theme
configuration, which will be applied in the PodPoller. Updated relevant
modules to support the new configuration.
Replace `unwrap` with `expect` in regex creation to provide more
informative error messages. This change improves error handling by
making it clear when a regex is invalid.
Introduce default highlight rules for pod statuses in `PodConfig`. This
includes rules for `Completed`, `Evicted`, `BackOff`, `Err`, and
`Unknown` statuses with corresponding styles. This change enhances the
visual representation of pod statuses.
Add support for event highlight configuration in `config.yaml` and
implement corresponding changes in the codebase. This includes adding
new structs and methods to handle event highlight rules, updating the
`App` struct to include `EventConfig`, and modifying the `EventPoller`
to use the new configuration. This change enhances the visual
representation of events based on their type.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

customize parameters from config file
1 participant