Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

alex-ju
Copy link
Member

@alex-ju alex-ju commented Oct 13, 2025

πŸ“Œ Summary

Converting the Modal examples page to gts. Still in two minds about the best way to align it to other examples using code-fragments abstraction – feedback welcome.

πŸ› οΈ Detailed description

πŸ“Έ Screenshots

πŸ”— External links

Jira ticket: HDS-5346


πŸ‘€ 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.

@alex-ju alex-ju requested a review from a team as a code owner October 13, 2025 17:41
Copy link

vercel bot commented Oct 13, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
hds-showcase Ready Ready Preview Oct 14, 2025 0:24am
hds-website Ready Ready Preview Oct 14, 2025 0:24am

@didoo
Copy link
Contributor

didoo commented Oct 13, 2025

Still in two minds about the best way to align it to other examples using code-fragments abstraction – feedback welcome.

@alex-ju I did a review, and for me everything seems fine, apart from the demo.gts file, where I see why you're hesitant (and I agree there's no clear cut solution). Probably @shleewhite can help here, I remember another component where she was able to break down a deepTracked object used to store the state of a code block in its own much simpler code fragment. For everything else I don't see ways to abstract the code, unless we end up with a very generic (too generic) wrapper around the Modal itself, which would defy the purpose of specialized code fragments

Copy link
Contributor

@shleewhite shleewhite left a comment

Choose a reason for hiding this comment

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

For the abstraction.... Personally I would prefer a wrapper that handles the button and isOpen state. It could yield the header/body/footer.

We do something similar with Form inputs where we want to customize the character count: https://github.com/hashicorp/design-system/blob/main/showcase/app/components/page-components/form/text-input/code-fragments/with-character-count.gts

import { COLORS } from '@hashicorp/design-system-components/components/hds/modal/index';
import { NAMES as ICON_NAMES } from '@hashicorp/design-system-components/components/hds/icon/index';

// Static color to icon mapping, same as in controller
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// Static color to icon mapping, same as in controller
// Static color to icon mapping

Copy link
Member Author

Choose a reason for hiding this comment

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

Addressed in 01aaac3

superSelectOptions3 = ['Option 1', 'Option 2', 'Option 3'];
superSelectSelectedOption3 = this.superSelectOptions3[0];

@action
Copy link
Contributor

Choose a reason for hiding this comment

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

Issue: you don't need to use @action anymore, they can just be arrow functions.

Copy link
Member Author

Choose a reason for hiding this comment

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

Addressed in 09a63d0

}

@action
noop() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Issue: you can use import NOOP from 'showcase/utils/noop' instead

Copy link
Member Author

Choose a reason for hiding this comment

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

Addressed in e374bf0

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.

4 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.