Skip to content

Commit 0b691da

Browse files
committed
Add the ability to specify a second custom logo for PatternFly 6
1 parent d715ae2 commit 0b691da

File tree

3 files changed

+267
-0
lines changed

3 files changed

+267
-0
lines changed
Lines changed: 267 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,267 @@
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+
![Light theme mode](images/light-theme-mode-logo.png)
29+
30+
![Dark theme mode](images/dark-theme-mode-logo.png)
31+
32+
## Background info
33+
34+
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.
35+
36+
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.
37+
38+
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.
39+
40+
## Motivation
41+
42+
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.
43+
44+
### User Stories
45+
46+
* 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.
47+
48+
### Goals
49+
50+
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.
51+
52+
### Non-Goals
53+
54+
This feature does not aim to address other customization aspects of the web console outside of logos.
55+
56+
## Proposal
57+
58+
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.
59+
60+
### API Design Details
61+
62+
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:
63+
64+
#### Console Customization Logo API Schema
65+
66+
#### ThemeMode
67+
- **Description**: Specifies the theme mode for the console UI.
68+
- **Values**: `"Dark"`, `"Light"`
69+
70+
#### LogoType
71+
- **Description**: Specifies the type of logo for the console UI.
72+
- **Values**: `"Masthead"`, `"Favicon"`
73+
74+
#### SourceType
75+
- **Description**: Defines the source type of the file reference.
76+
- **Values**: `"ConfigMap"`
77+
78+
#### ConfigMapFileReference
79+
- **Fields**:
80+
- `name`: The name of the ConfigMap containing the custom logo file.
81+
- `key`: The key inside the ConfigMap that references the logo file.
82+
83+
#### FileReferenceSource
84+
- **Fields**:
85+
- `from`: Specifies the source type of the file reference (e.g., `ConfigMap`).
86+
- `configMap`: Contains the ConfigMap name and key for the logo file.
87+
88+
#### Theme
89+
- **Fields**:
90+
- `mode`: Specifies the theme mode (`Dark` or `Light`).
91+
- `source`: Specifies the file reference source for the logo.
92+
93+
#### Logo
94+
- **Fields**:
95+
- `type`: Specifies the type of logo (`Masthead` or `Favicon`).
96+
- `themes`: A list of themes for the logo, each specifying a mode and source.
97+
98+
#### ConsoleCustomization
99+
- **Fields**:
100+
- `logos`: A list of custom logos for the console UI.
101+
- `customLogoFile`: Deprecated field for a single custom logo.
102+
103+
#### Example Configuration
104+
105+
```yaml
106+
logos:
107+
- type: Masthead
108+
themes:
109+
- mode: Light
110+
source:
111+
from: ConfigMap
112+
configMap:
113+
name: custom-logos-config
114+
key: masthead-light-logo.svg
115+
- mode: Dark
116+
source:
117+
from: ConfigMap
118+
configMap:
119+
name: custom-logos-config
120+
key: masthead-dark-logo.svg
121+
- type: Favicon
122+
themes:
123+
- mode: Light
124+
source:
125+
from: ConfigMap
126+
configMap:
127+
name: custom-logos-config
128+
key: favicon-light-logo.png
129+
- mode: Dark
130+
source:
131+
from: ConfigMap
132+
configMap:
133+
name: custom-logos-config
134+
key: favicon-dark-logo.png
135+
```
136+
137+
### Workflow Description
138+
139+
├── spec
140+
│ ├── customization
141+
│ ├── logos
142+
│ ├── type
143+
│ ├── themes
144+
│ ├── mode
145+
│ ├── source
146+
│ ├── from
147+
│ ├── configMap
148+
│ ├── name
149+
│ ├── key
150+
└── ...
151+
152+
### API Extensions
153+
NA
154+
155+
### Risks and Mitigations
156+
157+
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.
158+
159+
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.
160+
161+
### Drawbacks
162+
N/A
163+
164+
### Attributes Description
165+
166+
#### ConsoleCustomization
167+
- `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.
168+
169+
#### Logo
170+
- `type`: Specifies the type of the logo for the console UI. Allowed values are `Masthead` and `Favicon`.
171+
- `Masthead`: The logo is displayed in the masthead and about modal of the console UI.
172+
- `Favicon`: The logo is used as the favicon of the console UI.
173+
- `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.
174+
175+
#### Theme
176+
- `mode`: Specifies the theme mode for the logo. Allowed values are:
177+
- `Light`: The logo is used when the console UI is in light mode.
178+
- `Dark`: The logo is used when the console UI is in dark mode.
179+
- `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.
180+
181+
#### FileReferenceSource
182+
- `from`: Specifies the source type of the file reference. Allowed value is `ConfigMap`.
183+
- `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.
184+
185+
#### ConfigMapFileReference
186+
- `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.
187+
- `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.
188+
189+
190+
## Test Plan
191+
192+
Provide tests as part of the console logos implementation and verify that they are shown in the UI. The following tests will be added:
193+
- Unit tests for API
194+
- Unit and E2E tests for console-operator
195+
- E2E tests for console
196+
197+
## Graduation Criteria
198+
N/A
199+
200+
### Dev Preview -> Tech Preview
201+
N/A
202+
203+
### Tech Preview -> GA
204+
N/A
205+
206+
### Removing a deprecated feature
207+
N/A
208+
209+
## Upgrade / Downgrade Strategy
210+
N/A
211+
212+
## Version Skew Strategy
213+
N/A
214+
215+
## Operational Aspects of API Extensions
216+
N/A
217+
218+
### Deprecated Feature
219+
220+
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.
221+
222+
### Topology Considerations
223+
N/A
224+
225+
#### Hypershift / Hosted Control Planes
226+
N/A
227+
228+
#### Standalone Clusters
229+
N/A
230+
231+
#### Single-node Deployments or MicroShift
232+
N/A
233+
234+
## Support Procedures
235+
N/A
236+
237+
### Implementation Details/Notes/Constraints
238+
239+
#### New API Field
240+
241+
A new field named `logos` will be incorporated into the ConsoleCustomization API. This field is designed to support the definition of multiple custom logos. Each logo can be linked to a specific theme mode (either Light or Dark) and a logo type (Masthead or Favicon). As part of this update, the existing `customLogoFile` field will be deprecated, transitioning completely to the new logo configuration approach.
242+
243+
#### Logo Sourcing
244+
245+
The custom logos will be retrieved from ConfigMaps located within the `openshift-config` namespace. The logos could be placed in a single ConfigMap with associated keys, or each logo could 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.
246+
247+
#### Console-Operator Management
248+
249+
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.
250+
251+
#### Steps to Implement This Feature
252+
253+
1. **Introduce the New Logos Field**: Add the `logos` field into the ConsoleCustomization API schema to facilitate the new logo configurations.
254+
255+
2. **Deprecate Existing Field**: Phase out the older `customLogoFile` field as users transition to the new `logos` configuration.
256+
257+
3. **Update the Console-Operator**: Modify the console-operator to support the interpretation and application of the new configuration settings.
258+
259+
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.
260+
261+
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.
262+
263+
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.
264+
265+
266+
## Alternatives (Not Implemented)
267+
N/A
208 KB
Loading
210 KB
Loading

0 commit comments

Comments
 (0)