Skip to content

Add support for Text in the AppHeader #2951

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 32 commits into
base: main
Choose a base branch
from

Conversation

jorytindall
Copy link
Contributor

@jorytindall jorytindall commented Jun 13, 2025

📌 Summary

Adds support for a text argument within the HomeLink of the AppHeader. Refactors the HomeLink to match the logic of the <Hds::Button>:

  • Removes the ariaLabel argument
  • Adds an isIconOnly argument and text argument
  • Adds logic to pass the text argument to the aria-label of the Home Link when isIconOnly={{true}}

Showcase: https://hds-showcase-git-jt-application-titlehds-4866-hashicorp.vercel.app/components/app-header

📸 Screenshots

This first example is representative of the TFE Admin Console app that is being spun up, the other two are speculative examples for how the component could be used elsewhere.

Screenshot 2025-06-13 at 3 33 19 PM

Example states with Application Title
Screenshot 2025-06-13 at 3 37 57 PM

🔗 External links

Jira ticket: HDS-4866
Figma file


👀 Component checklist

💬 Please consider using conventional comments when reviewing this PR.

📋 PCI review checklist
  • If applicable, I've documented a plan to revert these changes if they require more than reverting the pull request.
  • If applicable, I've worked with GRC to document the impact of any changes to security controls.
    Examples of changes to controls include access controls, encryption, logging, etc.
  • If applicable, I've worked with GRC to ensure compliance due to a significant change to the in-scope PCI environment.
    Examples include changes to operating systems, ports, protocols, services, cryptography-related components, PII processing code, etc.

Copy link

vercel bot commented Jun 13, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
hds-showcase ✅ Ready (Inspect) Visit Preview Jun 23, 2025 10:02pm
hds-website ✅ Ready (Inspect) Visit Preview Jun 23, 2025 10:02pm

Copy link
Contributor

@KristinLBradley KristinLBradley left a comment

Choose a reason for hiding this comment

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

Looking pretty good! I added a few comments on simplifying some logic and a few other minor recommended changes.

didoo
didoo previously approved these changes Jun 20, 2025
Copy link
Contributor

@didoo didoo left a comment

Choose a reason for hiding this comment

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

Left a few comments, but nothing major/blockign

@KristinLBradley

This comment was marked as resolved.

Copy link
Contributor

@KristinLBradley KristinLBradley left a comment

Choose a reason for hiding this comment

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

Looks great!

Copy link
Contributor

@didoo didoo left a comment

Choose a reason for hiding this comment

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

Left a few comments/todos

get icon(): HdsIconSignature['Args']['name'] {
const { icon } = this.args;

assert('@icon name must be provided', icon !== undefined);
Copy link
Contributor

Choose a reason for hiding this comment

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

[issue] as a consumer, I see this error in the devtool console, and I don't know which component threw the error or where is coming from

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've added a more explicit assertion for this

Copy link
Contributor

@didoo didoo left a comment

Choose a reason for hiding this comment

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

Left a few more comments/todos

@color="var(--token-color-boundary-brand)"
@href="#"
/>
</div>
</SF.Item>
</Shw::Flex>

<Shw::Text::H4>Text</Shw::Text::H4>
Copy link
Contributor

Choose a reason for hiding this comment

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

[todo] For consistency with the same title above?

Suggested change
<Shw::Text::H4>Text</Shw::Text::H4>
<Shw::Text::H4>With text</Shw::Text::H4>

<Shw::Flex as |SF|>
<SF.Item>
<div class="hds-app-header">
<Hds::AppHeader::HomeLink @icon="hashicorp" @text="HashiCorp" @href="#" @title="Admin UI" />
Copy link
Contributor

Choose a reason for hiding this comment

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

[todo] I think this one is missing the @isIconOnly={{false}}?

Suggested change
<Hds::AppHeader::HomeLink @icon="hashicorp" @text="HashiCorp" @href="#" @title="Admin UI" />
<Hds::AppHeader::HomeLink @icon="hashicorp" @isIconOnly={{false}} @text="HashiCorp" @href="#" @title="Admin UI" />


<SF.Item>
<div class="hds-app-header">
<Hds::AppHeader::HomeLink @icon="terraform" @text="Terraform" @href="#" @title="Terraform Admin Console" />
Copy link
Contributor

Choose a reason for hiding this comment

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

[todo] I think this one is missing the @isIconOnly={{false}}?

Suggested change
<Hds::AppHeader::HomeLink @icon="terraform" @text="Terraform" @href="#" @title="Terraform Admin Console" />
<Hds::AppHeader::HomeLink @icon="terraform" @isIconOnly={{false}} @text="Terraform" @href="#" @title="Terraform Admin Console" />


<Shw::Text::H3>With text</Shw::Text::H3>

<Shw::Grid @columns={{1}} {{style gap="2rem"}} as |SG|>
Copy link
Contributor

Choose a reason for hiding this comment

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

[general consideration] no need to change it here, but in general it would be better to avoid using a grid to achieve a simple vertical stacked layout, and and use <Shw::Grid @direction="column">instead (CSS grid comes with (rare) potential side effects, that we want to avoid)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants