Skip to content

feat: temporarily updated tooltip content for workspace naming guidel… #1880

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 1 commit into
base: master
Choose a base branch
from

Conversation

radekkaluzik
Copy link
Contributor

@radekkaluzik radekkaluzik commented Jul 21, 2025

Description

This is just a temporary update of the Tooltip Content since the Learn more section is not yet finished. It is expected to get back to the previous code later on which is why some parts of the code are commented out.

RHCLOUD-40659


Screenshots

Snímek obrazovky 2025-07-21 v 15 59 53

Checklist ☑️

  • PR only fixes one issue or story
  • Change reviewed for extraneous code
  • UI best practices adhered to
  • Commits squashed and meaningfully named
  • All PR checks pass locally (build, lint, test, E2E)

  • (Optional) QE: Needs QE attention (OUIA changed, perceived impact to tests, no test coverage)
  • (Optional) QE: Has been mentioned
  • (Optional) UX: Needs UX attention (end user UX modified, missing designs)
  • (Optional) UX: Has been mentioned

Summary by Sourcery

Temporarily update the workspace naming guidelines tooltip content and hide the Learn More link until the detailed section is complete.

Enhancements:

  • Replace the workspace naming guidelines default message with a descriptive placeholder text
  • Comment out and remove the inline Learn More link button component for now
  • Retain the original link code in comments for future restoration
  • Update locale files to match the revised default tooltip message

@radekkaluzik radekkaluzik requested a review from a team as a code owner July 21, 2025 14:17
Copy link
Contributor

sourcery-ai bot commented Jul 21, 2025

Reviewer's Guide

Temporarily hide the inline “Learn more” link in the workspace naming guidelines tooltip by replacing it with an empty string and commenting out the original Button, expand the default guideline message with example names and a placeholder link, and sync locale resource files to reflect these message updates.

Class diagram for updated workspace naming guidelines message

classDiagram
    class Messages {
      +workspaceNamingGuidelines: string
      +workspaceDescriptionMaxLength: string
      ...
    }
    Messages : +workspaceNamingGuidelines now includes example names and no link
    Messages : -defaultMessage changed
    Messages : -link replaced with empty string in tooltip
Loading

File-Level Changes

Change Details Files
Hidden the inline “Learn more” link in the tooltip
  • Replaced the link value with an empty string in the schema builder
  • Commented out the original Button markup for the ‘Learn more’ link
  • Added an RHCLOUD-40659 comment explaining the temporary removal
src/smart-components/workspaces/create-workspace/schema.tsx
Expanded the default workspace naming guidelines message
  • Rewrote defaultMessage to include concrete naming examples and a placeholder {link}
  • Removed the old generic “about the guidelines” text
src/Messages.js
Synced locale resource files to updated message content
  • Updated translation-template.json to reflect the new message format
  • Updated data.json and translations.json stubs for the expanded defaultMessage
src/locales/translation-template.json
src/locales/data.json
src/locales/translations.json

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @radekkaluzik - I've reviewed your changes and they look great!

Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments

### Comment 1
<location> `src/smart-components/workspaces/create-workspace/schema.tsx:93` </location>
<code_context>
-                                  {intl.formatMessage(messages.learnMore)}
-                                </Button>
-                              ),
+                              link: '', // RHCLOUD-40659: Temporarily hidden link until Learn More section is ready
+                              // link: (
+                              //   <Button variant="link" href="#" isInline>
</code_context>

<issue_to_address>
Passing an empty string for the 'link' value may result in awkward message rendering.

Consider updating the message template to handle cases where 'link' is empty, such as omitting the placeholder or adjusting formatting to avoid awkward output.

Suggested implementation:

```typescript
                            values={{
                              // Pass undefined for link to omit it from the message if not present
                              link: undefined, // RHCLOUD-40659: Temporarily hidden link until Learn More section is ready
                              // link: (
                              //   <Button variant="link" href="#" isInline>
                              //     {intl.formatMessage(messages.learnMore)}
                              //   </Button>
                              // ),
                            }}

```

You must also update the message template for `workspaceNamingGuidelines` in your `messages` definition (likely in a file such as `src/smart-components/workspaces/messages.ts` or similar).  
Change the template to conditionally include the link, for example:

```
defaultMessage: 'Your workspace name must follow the guidelines.{link, select, undefined {} other { {link}}}'
```

Or, if using ICU message syntax, you can use:

```
defaultMessage: 'Your workspace name must follow the guidelines.{link}'
```

And ensure that if `link` is undefined, nothing is rendered in its place.

This ensures that when `link` is not provided, the message renders cleanly without awkward formatting.
</issue_to_address>

### Comment 2
<location> `src/Messages.js:1276` </location>
<code_context>
     id: 'workspaceNamingGuidelines',
     description: 'Workspace naming guidelines hint',
-    defaultMessage: '{link} about the guidelines for naming your workspaces.',
+    defaultMessage:
+      'Use clear, descriptive workspace names like "Production North America" or "Project-X" to organize assets, control access, and simplify management.{link}',
   },
   workspaceDescriptionMaxLength: {
</code_context>

<issue_to_address>
The new defaultMessage always includes the {link} placeholder, which may not be appropriate if the link is hidden.

If {link} is not provided, the message may display awkwardly. Consider making the {link} section conditional or creating separate messages for cases with and without the link.

Suggested implementation:

```javascript
  workspaceNamingGuidelines: {
    id: 'workspaceNamingGuidelines',
    description: 'Workspace naming guidelines hint (with link)',
    defaultMessage:
      'Use clear, descriptive workspace names like "Production North America" or "Project-X" to organize assets, control access, and simplify management. {link}',
  },
  workspaceNamingGuidelinesNoLink: {
    id: 'workspaceNamingGuidelinesNoLink',
    description: 'Workspace naming guidelines hint (no link)',
    defaultMessage:
      'Use clear, descriptive workspace names like "Production North America" or "Project-X" to organize assets, control access, and simplify management.',
  },

```

You will also need to update the code that consumes `workspaceNamingGuidelines` to use `workspaceNamingGuidelinesNoLink` when the link is not present, and `workspaceNamingGuidelines` when the link is present.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

{intl.formatMessage(messages.learnMore)}
</Button>
),
link: '', // RHCLOUD-40659: Temporarily hidden link until Learn More section is ready
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion: Passing an empty string for the 'link' value may result in awkward message rendering.

Consider updating the message template to handle cases where 'link' is empty, such as omitting the placeholder or adjusting formatting to avoid awkward output.

Suggested implementation:

                            values={{
                              // Pass undefined for link to omit it from the message if not present
                              link: undefined, // RHCLOUD-40659: Temporarily hidden link until Learn More section is ready
                              // link: (
                              //   <Button variant="link" href="#" isInline>
                              //     {intl.formatMessage(messages.learnMore)}
                              //   </Button>
                              // ),
                            }}

You must also update the message template for workspaceNamingGuidelines in your messages definition (likely in a file such as src/smart-components/workspaces/messages.ts or similar).
Change the template to conditionally include the link, for example:

defaultMessage: 'Your workspace name must follow the guidelines.{link, select, undefined {} other { {link}}}'

Or, if using ICU message syntax, you can use:

defaultMessage: 'Your workspace name must follow the guidelines.{link}'

And ensure that if link is undefined, nothing is rendered in its place.

This ensures that when link is not provided, the message renders cleanly without awkward formatting.

Comment on lines +1276 to +1277
defaultMessage:
'Use clear, descriptive workspace names like "Production North America" or "Project-X" to organize assets, control access, and simplify management.{link}',
Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion: The new defaultMessage always includes the {link} placeholder, which may not be appropriate if the link is hidden.

If {link} is not provided, the message may display awkwardly. Consider making the {link} section conditional or creating separate messages for cases with and without the link.

Suggested implementation:

  workspaceNamingGuidelines: {
    id: 'workspaceNamingGuidelines',
    description: 'Workspace naming guidelines hint (with link)',
    defaultMessage:
      'Use clear, descriptive workspace names like "Production North America" or "Project-X" to organize assets, control access, and simplify management. {link}',
  },
  workspaceNamingGuidelinesNoLink: {
    id: 'workspaceNamingGuidelinesNoLink',
    description: 'Workspace naming guidelines hint (no link)',
    defaultMessage:
      'Use clear, descriptive workspace names like "Production North America" or "Project-X" to organize assets, control access, and simplify management.',
  },

You will also need to update the code that consumes workspaceNamingGuidelines to use workspaceNamingGuidelinesNoLink when the link is not present, and workspaceNamingGuidelines when the link is present.

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.

1 participant