Skip to content

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 sarub0b0 force-pushed the feature/conf-file branch 2 times, most recently from 7733e4a to 1dc047c Compare November 2, 2024 05:35
@sarub0b0 sarub0b0 added this to the 1.6.0 milestone Dec 16, 2024
@sarub0b0 sarub0b0 force-pushed the feature/conf-file branch 2 times, most recently from ff26dc8 to 202eabc Compare December 24, 2024 18:16
@sarub0b0 sarub0b0 marked this pull request as ready for review January 4, 2025 17:26
sarub0b0 and others added 13 commits January 5, 2025 02:32
- 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.
sarub0b0 and others added 18 commits January 5, 2025 02:34
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.
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.
- Introduced `StyledTable` struct to format and display Kubernetes
  resources in a styled table format.
- Added `styled_table` module to `api_resources/kube.rs`.
- Implemented `Display` trait for `StyledTable` to handle table
  formatting and styling.
- Added unit tests to ensure correct display of headers and rows.
- Added API theme configuration to `config.yaml` example file.
- Updated `app.rs` to include `ApiConfig` for kube worker.
- Introduced `ApiThemeConfig` and `ApiTableThemeConfig` in
  `theme/api.rs`.
- Modified `theme.rs` to include `ApiThemeConfig`.
- Updated `api_resources.rs` to use `ApiConfig` for styling API
  resources table.
- Added `ApiConfig` to `KubeWorkerConfig` and `KubeController`.
- Implemented unit tests for `ApiConfig` and related functionality.
- Added YAML and API dialog theme configurations to `config.yaml`.
- Updated `app.rs` to include `ApisConfig` and `YamlConfig` for kube
  worker.
- Introduced `YamlThemeConfig` and `ApiDialogThemeConfig` in
  `theme.rs`.
- Modified `theme/api.rs` to include dialog theme configurations.
- Added `styled_api_resource.rs` to handle styled API resources.
- Updated `message.rs` and `controller.rs` to use styled API resources.
- Implemented unit tests for `ApisConfig`, `YamlConfig`, and related
  functionality.
Updated `example/config.yaml` to improve theme settings and add
translations. This includes better descriptions for various components
and additional comments for clarity. The changes aim to enhance
readability and maintainability of the configuration file.
Renamed `selection` to `selected_item` in theme configuration files
and related Rust source files. This change improves clarity and
consistency in naming conventions across the codebase. Updated
`example/config.yaml`, `src/config/theme/list.rs`, and
`src/config/theme/widget.rs` accordingly.
Added a new feature to customize the UI appearance using a configuration
file. The configuration file can be located at `~/.config/kubetui/config.yaml`
or `$XDG_CONFIG_FILE/kubetui/config.yaml`, or specified with the `--config-file`
flag. A sample configuration file is available at `examples/config.yaml`.
Updated the README.md to include details about this new feature.
@sarub0b0 sarub0b0 merged commit e98bb9f into main Jan 5, 2025
1 check passed
@sarub0b0 sarub0b0 deleted the feature/conf-file branch January 5, 2025 07:14
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