|
| 1 | +--- |
| 2 | +title: custom-logos |
| 3 | +authors: |
| 4 | + - "@cajieh" |
| 5 | +reviewers: |
| 6 | + - "@jhadvig " |
| 7 | + - "@spadgett" |
| 8 | + - "@everettraven" |
| 9 | + - "@JoelSpeed" |
| 10 | +approvers: |
| 11 | + - "@spadgett" |
| 12 | +api-approvers: |
| 13 | + - "@JoelSpeed" |
| 14 | +creation-date: 2025-02-11 |
| 15 | +last-updated: 2025-04-11 |
| 16 | +tracking-link: |
| 17 | + - https://issues.redhat.com/browse/CONSOLE-4448 |
| 18 | +--- |
| 19 | + |
| 20 | +# Console Customization Logos |
| 21 | + |
| 22 | +## Summary |
| 23 | + |
| 24 | +The OpenShift Container Platform (OCP) web console was upgraded to PatternFly 6. In PatternFly 6, the masthead color changes based on light or dark theme mode. As a result, a single custom logo may not be suitable for both theme modes. |
| 25 | + |
| 26 | +This proposal is to add the ability to specify custom logos to support light and dark theme modes for the masthead and favicon in the Console UI. |
| 27 | + |
| 28 | +## Background info |
| 29 | + |
| 30 | +The OpenShift Container Platform (OCP) web console was upgraded to PatternFly 6. In PatternFly 6, the masthead color changes based on light or dark theme mode. As a result, a single custom logo may not be suitable for both theme modes. |
| 31 | + |
| 32 | +To address this, we need to allow users to add custom logos compatible with light and dark theme modes for both the masthead and favicon. This ensures that the logos are always visible and aesthetically pleasing, regardless of the theme mode. |
| 33 | + |
| 34 | +The custom logos feature will enable users to specify different logos for the masthead and favicon based on the theme mode. This will involve exposing a new API to support custom logos for both light and dark theme modes. |
| 35 | + |
| 36 | +## Motivation |
| 37 | + |
| 38 | +The existing OKD and OpenShift logos are designed for a dark masthead background and include white text, making them ineffective in a light theme mode. To ensure logos remain visible and visually appealing in both light and dark theme modes, users need the ability to add custom logos for the masthead and favicon that adapt to the theme mode. To support this, a new API endpoint will be introduced, allowing users to specify different logos for light and dark theme modes. |
| 39 | + |
| 40 | +### User Stories |
| 41 | + |
| 42 | +* As an OpenShift web console user, I want to be able to add different custom logos for light and dark theme modes in the masthead and favicon. |
| 43 | + |
| 44 | +### Goals |
| 45 | + |
| 46 | +This feature will allow users to add custom logos for the masthead and favicon that are compatible with both light and dark theme modes in the OpenShift web console. |
| 47 | + |
| 48 | +### Non-Goals |
| 49 | + |
| 50 | +This feature does not aim to address other customization aspects of the web console outside of logos. |
| 51 | + |
| 52 | +## Proposal |
| 53 | + |
| 54 | +The proposal introduces a new API schema that allows users to configure custom logos for the masthead and favicon. The configuration will support specifying separate logos for light and dark theme modes, ensuring compatibility with the PatternFly 6 theme switching. |
| 55 | + |
| 56 | +### API Design Details |
| 57 | + |
| 58 | +The configuration for custom logos will include support for both masthead and favicon types with separate files for light and dark theme modes. The following schema will be used: |
| 59 | + |
| 60 | +#### Console Customization Logo API Schema |
| 61 | + |
| 62 | +#### ThemeMode |
| 63 | +- **Description**: Specifies the theme mode for the console UI. |
| 64 | +- **Values**: `"Dark"`, `"Light"` |
| 65 | + |
| 66 | +#### LogoType |
| 67 | +- **Description**: Specifies the type of logo for the console UI. |
| 68 | +- **Values**: `"Masthead"`, `"Favicon"` |
| 69 | + |
| 70 | +#### SourceType |
| 71 | +- **Description**: Defines the source type of the file reference. |
| 72 | +- **Values**: `"ConfigMap"` |
| 73 | + |
| 74 | +#### ConfigMapFileReference |
| 75 | +- **Fields**: |
| 76 | + - `name`: The name of the ConfigMap containing the custom logo file. |
| 77 | + - `key`: The key inside the ConfigMap that references the logo file. |
| 78 | + |
| 79 | +#### FileReferenceSource |
| 80 | +- **Fields**: |
| 81 | + - `from`: Specifies the source type of the file reference (e.g., `ConfigMap`). |
| 82 | + - `configMap`: Contains the ConfigMap name and key for the logo file. |
| 83 | + |
| 84 | +#### Theme |
| 85 | +- **Fields**: |
| 86 | + - `mode`: Specifies the theme mode (`Dark` or `Light`). |
| 87 | + - `source`: Specifies the file reference source for the logo. |
| 88 | + |
| 89 | +#### Logo |
| 90 | +- **Fields**: |
| 91 | + - `type`: Specifies the type of logo (`Masthead` or `Favicon`). |
| 92 | + - `themes`: A list of themes for the logo, each specifying a mode and source. |
| 93 | + |
| 94 | +#### ConsoleCustomization |
| 95 | +- **Fields**: |
| 96 | + - `logos`: A list of custom logos for the console UI. |
| 97 | + - `customLogoFile`: Deprecated field for a single custom logo. |
| 98 | + |
| 99 | +#### Example Configuration |
| 100 | + |
| 101 | +```yaml |
| 102 | +logos: |
| 103 | + - type: Masthead |
| 104 | + themes: |
| 105 | + - mode: Light |
| 106 | + source: |
| 107 | + from: ConfigMap |
| 108 | + configMap: |
| 109 | + name: custom-logos-config |
| 110 | + key: masthead-light-logo.svg |
| 111 | + - mode: Dark |
| 112 | + source: |
| 113 | + from: ConfigMap |
| 114 | + configMap: |
| 115 | + name: custom-logos-config |
| 116 | + key: masthead-dark-logo.svg |
| 117 | + - type: Favicon |
| 118 | + themes: |
| 119 | + - mode: Light |
| 120 | + source: |
| 121 | + from: ConfigMap |
| 122 | + configMap: |
| 123 | + name: custom-logos-config |
| 124 | + key: favicon-light-logo.png |
| 125 | + - mode: Dark |
| 126 | + source: |
| 127 | + from: ConfigMap |
| 128 | + configMap: |
| 129 | + name: custom-logos-config |
| 130 | + key: favicon-dark-logo.png |
| 131 | +``` |
| 132 | +
|
| 133 | +### Workflow Description |
| 134 | +
|
| 135 | +├── spec |
| 136 | +│ ├── customization |
| 137 | +│ ├── logos |
| 138 | +│ ├── type |
| 139 | +│ ├── themes |
| 140 | +│ ├── mode |
| 141 | +│ ├── source |
| 142 | +│ ├── from |
| 143 | +│ ├── configMap |
| 144 | +│ ├── name |
| 145 | +│ ├── key |
| 146 | +└── ... |
| 147 | +
|
| 148 | +### API Extensions |
| 149 | +
|
| 150 | +### Risks and Mitigations |
| 151 | +
|
| 152 | +1. Each of the Console supported theme modes can be configured individually by setting either the Light or Dark theme mode. If a theme is not specified, the default OpenShift logo will be displayed for that theme. |
| 153 | +
|
| 154 | +2. Users might experience confusion with the introduction of new logo configuration options. The previous method, represented by `CustomLogo`, will be deprecated. Provide comprehensive documentation to guide users through the transition, including clear instructions about the changes and their benefits. |
| 155 | + |
| 156 | +### Drawbacks |
| 157 | + |
| 158 | +### Attributes Description |
| 159 | + |
| 160 | +#### ConsoleCustomization |
| 161 | +- `logos`: A list of custom logos used to replace the OpenShift Masthead and Favicon logos in the console UI. Only one of `logos` or `customLogoFile` can be set at a time. Each logos type must appear only once in the list, and there must be at least one entry and no more than two entries. |
| 162 | + |
| 163 | +#### Logo |
| 164 | +- `type`: Specifies the type of the logo for the console UI. Allowed values are `Masthead` and `Favicon`. |
| 165 | + - `Masthead`: The logo is displayed in the masthead and about modal of the console UI. |
| 166 | + - `Favicon`: The logo is used as the favicon of the console UI. |
| 167 | +- `themes`: A list of themes for the logo. Each theme must have a unique mode (`Light` or `Dark`) and a source field. If a theme is not specified, the default OpenShift logo will be displayed for that theme. |
| 168 | + |
| 169 | +#### Theme |
| 170 | +- `mode`: Specifies the theme mode for the logo. Allowed values are: |
| 171 | + - `Light`: The logo is used when the console UI is in light mode. |
| 172 | + - `Dark`: The logo is used when the console UI is in dark mode. |
| 173 | +- `source`: Specifies the file reference source for the logo. This is a required field that references a ConfigMap name and key containing the custom logo file in the `openshift-config` namespace. |
| 174 | + |
| 175 | +#### FileReferenceSource |
| 176 | +- `from`: Specifies the source type of the file reference. Allowed value is `ConfigMap`. |
| 177 | +- `configMap`: Contains the ConfigMap sourcing details, such as the name of the ConfigMap and the key for the file. The ConfigMap must exist in the `openshift-config` namespace. |
| 178 | + |
| 179 | +#### ConfigMapFileReference |
| 180 | +- `name`: The name of the ConfigMap containing the custom logo file. Must consist of lowercase alphanumeric characters, `-`, or `.`, and must start and end with an alphanumeric character. Maximum length is 253 characters. |
| 181 | +- `key`: The key inside the ConfigMap that references the logo file. Must consist of alphanumeric characters, dashes (`-`), underscores (`_`), and periods (`.`). Must end with a valid file extension (2 to 5 letters) and have a maximum length of 253 characters. |
| 182 | + |
| 183 | + |
| 184 | +## Test Plan |
| 185 | + |
| 186 | +Provide tests as part of the console logos implementation and verify that they are shown in the UI. The following tests will be added: |
| 187 | + - Unit tests for API |
| 188 | + - Unit and E2E tests for console-operator |
| 189 | + - E2E tests for console |
| 190 | + |
| 191 | +## Graduation Criteria |
| 192 | +N/A |
| 193 | + |
| 194 | +### Dev Preview -> Tech Preview |
| 195 | +N/A |
| 196 | + |
| 197 | +### Tech Preview -> GA |
| 198 | +N/A |
| 199 | + |
| 200 | +### Removing a deprecated feature |
| 201 | +N/A |
| 202 | + |
| 203 | +## Upgrade / Downgrade Strategy |
| 204 | +N/A |
| 205 | + |
| 206 | +## Version Skew Strategy |
| 207 | +N/A |
| 208 | + |
| 209 | +## Operational Aspects of API Extensions |
| 210 | +N/A |
| 211 | + |
| 212 | +### Deprecated Feature |
| 213 | + |
| 214 | +The current custom logo field in `customization.customLogo` is deprecated. Users are encouraged to transition to the new custom logos configuration that supports light and dark theme modes for the masthead and favicon. |
| 215 | + |
| 216 | +### Topology Considerations |
| 217 | +N/A |
| 218 | + |
| 219 | +#### Hypershift / Hosted Control Planes |
| 220 | +N/A |
| 221 | + |
| 222 | +#### Standalone Clusters |
| 223 | +N/A |
| 224 | + |
| 225 | +#### Single-node Deployments or MicroShift |
| 226 | +N/A |
| 227 | + |
| 228 | +## Support Procedures |
| 229 | +N/A |
| 230 | + |
| 231 | +### Implementation Details/Notes/Constraints |
| 232 | + |
| 233 | +#### Logo Sourcing |
| 234 | + |
| 235 | + |
| 236 | +The custom logos will be retrieved from ConfigMaps located within the `openshift-config` namespace. Each logo will have an associated ConfigMap name and key, which will point to the specific logo file within that ConfigMap. This structured configuration will ensure that the appropriate logos are displayed depending on the current theme mode of the console. |
| 237 | + |
| 238 | + |
| 239 | +#### Console-Operator Management |
| 240 | + |
| 241 | + |
| 242 | +The application of these custom logos will be overseen by the console-operator, which is responsible for reading the configuration settings. It will ensure that the specified logos are correctly applied to the console's user interface. Should there be any theme mode that does not have a custom logo defined, the console will revert to using the default OpenShift logos. |
| 243 | + |
| 244 | + |
| 245 | +#### Steps to Implement This Feature |
| 246 | + |
| 247 | + |
| 248 | +1. **Introduce the New Logos Field**: Add the `logos` field into the ConsoleCustomization API schema to facilitate the new logo configurations. |
| 249 | + |
| 250 | +2. **Deprecate Existing Field**: Phase out the older `customLogoFile` field as users transition to the new `logos` configuration. |
| 251 | + |
| 252 | +3. **Update the Console-Operator**: Modify the console-operator to support the interpretation and application of the new configuration settings. |
| 253 | + |
| 254 | + |
| 255 | +4. **Documentation**: Develop comprehensive documentation that outlines how users can transition to the new configuration, including examples and best practices for setting up custom logos. |
| 256 | + |
| 257 | +5. **Testing**: Implement a robust suite of unit and end-to-end tests to validate the functionality of the new logo configurations across various scenarios. |
| 258 | + |
| 259 | + |
| 260 | +By implementing these changes, custom logos will be effectively displayed within the masthead and favicon areas of the OpenShift Console. Users will have the flexibility to configure logos through the new `logos` field, fully supporting both light and dark theme modes, thereby enhancing the overall brand identity within the console environment. |
| 261 | + |
| 262 | + |
| 263 | +## Alternatives (Not Implemented) |
| 264 | +N/A |
| 265 | + |
0 commit comments