Skip to content

feat: Add support for project titles #2470

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

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

marc1404
Copy link
Member

@marc1404 marc1404 commented Jun 3, 2025

What this PR does / why we need it:

This PR adds support for Project "display names" via a new annotation:
dashboard.gardener.cloud/project-title: "..."

See the issue for more context:

Screenshots:

Navigation on the left-hand side:
Screenshot 2025-06-03 at 16 29 47

Shoot cluster list in the "All Projects"-scope:
Screenshot 2025-06-04 at 13 39 08

Project creation dialog:
Screenshot 2025-06-03 at 16 39 00

Project administration view:
Screenshot 2025-06-03 at 16 40 55

Which issue(s) this PR fixes:

Fixes #2469

Special notes for your reviewer:

/cc @klocke-io @benedikt-haug
/cc @petersutter @grolu

Release note:

Added support for `Project` titles through a new annotation `dashboard.gardener.cloud/project-title`.

@gardener-robot gardener-robot added needs/review Needs review size/m Size of pull request is medium (see gardener-robot robot/bots/size.py) reviewed/do-not-merge Has no approval for merging as it may break things, be of poor quality or have (ext.) dependencies labels Jun 3, 2025
@gardener-robot-ci-2 gardener-robot-ci-2 added reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Jun 3, 2025
@marc1404 marc1404 force-pushed the feat/2469-project-titles branch from 741e134 to e2ff38f Compare June 3, 2025 10:10
@gardener-robot-ci-3 gardener-robot-ci-3 added reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Jun 3, 2025
@klocke-io
Copy link
Contributor

/ok-to-test

@marc1404 marc1404 force-pushed the feat/2469-project-titles branch from a4ab6d6 to 9f26762 Compare June 3, 2025 14:16
@gardener-robot-ci-2 gardener-robot-ci-2 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Jun 3, 2025
Comment on lines 69 to 74
<v-tooltip
activator="parent"
location="top"
>
{{ selectedProjectTitle }}
</v-tooltip>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since project titles longer than 10 characters can be used, the text can be truncated with an ellipsis if too long. Therefore, a tooltip is added to be able to inspect the entire title if necessary.

@gardener-robot-ci-2 gardener-robot-ci-2 removed the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Jun 3, 2025
Comment on lines +665 to +676
width: 153px !important;
text-align: left !important;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A fixed width or max width is required so that the element cuts off overflowing text with the ellipsis.
Even on a widescreen, the element does not grow larger than the previously configured min-width: 153px.

@grolu
Copy link
Contributor

grolu commented Jun 3, 2025

Could you add some screenshots

Comment on lines +723 to +732
:deep(.v-list-item__prepend > .v-list-item__spacer) {
width: 16px;
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The width has been halved from previously 32px to have vertical alignment between the filter input above and the projects below. Additionally, it increases the horizontal space for the project names/titles.

Screenshot 2025-06-03 at 16 25 32

@marc1404 marc1404 force-pushed the feat/2469-project-titles branch from 9f26762 to b76d410 Compare June 3, 2025 14:38
@gardener-robot-ci-3 gardener-robot-ci-3 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Jun 3, 2025
@marc1404
Copy link
Member Author

marc1404 commented Jun 3, 2025

Could you add some screenshots

@grolu Added to the PR description :)

@gardener-robot-ci-3 gardener-robot-ci-3 removed the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Jun 3, 2025
@marc1404 marc1404 marked this pull request as ready for review June 3, 2025 14:42
@marc1404 marc1404 force-pushed the feat/2469-project-titles branch from b76d410 to 4d3be08 Compare June 3, 2025 20:26
@gardener-robot-ci-2 gardener-robot-ci-2 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Jun 3, 2025
@gardener-robot-ci-1 gardener-robot-ci-1 removed the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Jun 4, 2025
@marc1404 marc1404 force-pushed the feat/2469-project-titles branch from f4af4f8 to 20967fa Compare June 4, 2025 08:45
@gardener-robot-ci-2 gardener-robot-ci-2 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Jun 4, 2025
@gardener-robot-ci-1 gardener-robot-ci-1 added reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Jun 4, 2025
@marc1404 marc1404 force-pushed the feat/2469-project-titles branch from 97cef3a to 310816f Compare June 4, 2025 11:23
@gardener-robot-ci-3 gardener-robot-ci-3 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Jun 4, 2025
@marc1404 marc1404 force-pushed the feat/2469-project-titles branch from 310816f to 451e222 Compare June 4, 2025 11:24
@gardener-robot-ci-3 gardener-robot-ci-3 removed the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Jun 4, 2025
@marc1404 marc1404 force-pushed the feat/2469-project-titles branch from 451e222 to d4f0b98 Compare June 4, 2025 11:31
@gardener-robot-ci-2 gardener-robot-ci-2 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Jun 4, 2025
@gardener-robot-ci-3 gardener-robot-ci-3 removed the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Jun 4, 2025
@marc1404 marc1404 force-pushed the feat/2469-project-titles branch from d4f0b98 to 9e2839f Compare June 4, 2025 11:41
@gardener-robot-ci-3 gardener-robot-ci-3 added the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Jun 4, 2025
@gardener-robot-ci-2 gardener-robot-ci-2 removed the reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) label Jun 4, 2025
@gardener-robot-ci-1 gardener-robot-ci-1 added reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) and removed reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) labels Jun 4, 2025
@grolu
Copy link
Contributor

grolu commented Jun 4, 2025

Looking at the screenshots, I have some concerns. The way the technical name is replaced with the title makes it unclear whether the currently displayed label is the title or the technical name. This can easily confuse users or even mislead them into selecting a project that looks legitimate but is actually incorrect or misleading — essentially a "honeypot" project.

I suggest keeping the technical name as it is and displaying the project title (if available) on a second line. If no title is set, that line can remain empty. The owner could move to a third line, or we might consider removing it from the main menu entirely — this should be discussed further.

Another option would be a complete overhaul of the project selection or introducing a new project selection page (e.g., in table format).

@benedikt-haug
Copy link
Contributor

benedikt-haug commented Jun 5, 2025

Looking at the screenshots, I have some concerns. The way the technical name is replaced with the title makes it unclear whether the currently displayed label is the title or the technical name. This can easily confuse users or even mislead them into selecting a project that looks legitimate but is actually incorrect or misleading — essentially a "honeypot" project.

Isn't there some chance to strike a middle ground here?
Like displaying <> or [] or 🎭 around it, cursive or any other distinctive discrepancy, like _ or another character likely illegal for project names? Maybe one could even go as far as making the project title unique (if that works, didn't chec yet)

Right now it already changes color which amusingly in my eyes upgrades it visually.

I find the current prominent presentation of the project name in its limitations weird. It's the identifier, so it must be presented. But it feels wrong to tell anyone that their
Dev, QA, Staging, Prod-Team1 etc. Projects only bear that name in some Grey, small font subdescription, when the prominent high font name is actually "D3FYH6UAGU" or "GTY7FEQKXU".

@grolu
Copy link
Contributor

grolu commented Jun 5, 2025

Isn't there some chance to strike a middle ground here?

Sure, as I already pointed out in the kickoff call, this is the main challenge :)
Implementing a project title from a technical perspective is simple. But integrating it in a way that truly adds value—while still ensuring the user always knows which project they are looking at—is the key point.
I'm open to suggestions!

@benedikt-haug
Copy link
Contributor

benedikt-haug commented Jun 10, 2025

But integrating it in a way that truly adds value—while still ensuring the user always knows which project they are looking at—is the key point. I'm open to suggestions!

Ideas how to solve this:

  • Change color (currently proposed solution)
  • Change font
  • Use italic
  • Prefix the project title with something that would be illegal for project-names like an emoji like 🎭 or a special character like _
  • Add an optional setting in store/config.js that allows operators to optionally take this security->functionality tradeoff
  • Check for uniqueness between project names and titles (my least favorite option, cause in my eyes it should be possible for users to use "QA" as an identifier for their QA project if that is unique for their use-case and tinkering with similar looking characters would still be an valid impersonation vector)

Obviously all of those are tradeoffs, given the intend of this change is to allow removing the project name from the center of presentation. This will inherently reduce visual uniqueness and increase risks of impersonation.

Comment on lines +70 to +71
:counter="counter"
:maxlength="maxLength"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get the following warnings in the browser console:

 Invalid prop: type check failed for prop "counter". Expected Boolean, got String with value "true". 
  at <GEditableText read-only=false color="action-button" model-value="core"  ... > 
Invalid prop: type check failed for prop "maxLength". Expected Number with value 64, got String with value "64".

Comment on lines +31 to +36
<v-tooltip
activator="parent"
location="top"
text="Technical, unique project name."
/>
</v-text-field>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of a tooltip, use hint prop on text-field

Comment on lines +49 to +54
<v-tooltip
activator="parent"
location="top"
text="Human-readable project title."
/>
</v-text-field>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of a tooltip, use hint prop on text-field

@@ -26,7 +26,12 @@ SPDX-License-Identifier: Apache-2.0
</v-icon>
</template>
<div class="text-body-2 text-medium-emphasis">
Name
<span>Name</span>
<v-tooltip
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the tooltip is misaligned. It should be displayed for the span, not for the parent div

</template>
<div class="text-body-2 text-medium-emphasis">
<span>Title</span>
<v-tooltip
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the tooltip is misaligned. It should be displayed for the span, not for the parent div

@@ -522,6 +553,8 @@ import {
getDateFormatted,
} from '@/utils'
import { errorDetailsFromError } from '@/utils/error'
import { annotations } from '@/utils/annotations.js'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this comment is not related to this particuluar line:

The confirm project deletion popup only shows the name, same for the GRemoveProjectMember and maybe others?

import { maxLength } from '@vuelidate/validators'

export function truncateProjectTitle (title, maxLength = 64) {
if (title.length > maxLength) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should the title also be trimmed (e.g. leading and trailing whitespace)? rather move this function to the project helper composable (see other comment)

Comment on lines +386 to +389
const selectedProjectTitle = computed(() => {
return getProjectTitle(selectedProject.value) ?? selectedProjectName
})

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use (selected)projectName and (selected)projectTitle from useProjectMetadata composable

Comment on lines +443 to +445
function getProjectTitle (project) {
return get(project, ['metadata', 'annotations', annotations.projectTitle])
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move such helpers to project helper composable, similar to #2455
cc @grolu

{{ getProjectOwner(project) }}
<abbr :title="hasProjectTitle(project) ? '' : null">
<span v-if="hasProjectTitle(project)">
{{ project.metadata.name }} &bull;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with Lukas regarding how the title and project name is shown here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs/ok-to-test Needs approval for testing (check PR in detail before setting this label because PR is run on CI/CD) needs/review Needs review reviewed/do-not-merge Has no approval for merging as it may break things, be of poor quality or have (ext.) dependencies size/m Size of pull request is medium (see gardener-robot robot/bots/size.py)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for Project display names via project-title annotations
9 participants