Skip to content

Commit 3a05b44

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

File tree

3 files changed

+269
-0
lines changed

3 files changed

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

0 commit comments

Comments
 (0)