8000 [VAULT-35871] UI: Address design UI feedback on namespace picker by beagins · Pull Request #30571 · hashicorp/vault · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[VAULT-35871] UI: Address design UI feedback on namespace picker #30571

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

Merged
merged 9 commits into from
May 12, 2025

Conversation

beagins
Copy link
Contributor
@beagins beagins commented May 9, 2025

Description

Address design UI feedback on namespace picker:

  • Namespace picker width should be determined by the longest namespace name, not help/error messages.
  • Enterprise tests passing ✅

    249 tests completed in 138252 milliseconds, with 0 failed, 10 skipped, and 0 todo.
    1464 assertions of 1464 passed, 0 failed.

Screenshots:

Narrow Expanded
Screenshot 2025-05-12 at 3 41 45 PM Screenshot 2025-05-12 at 3 42 39 PM
Screenshot 2025-05-12 at 3 44 20 PM

@github-actions github-actions bot added the hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed label May 9, 2025
Copy link
github-actions bot commented May 9, 2025

CI Results:
All Go tests succeeded! ✅

@beagins beagins added the ui label May 10, 2025
@beagins beagins added this to the 1.20.0-rc milestone May 10, 2025
@beagins beagins marked this pull request as ready for review May 12, 2025 17:28
@beagins beagins requested a review from a team as a code owner May 12, 2025 17:28
@beagins beagins force-pushed the ui/VAULT-35871/address-ui-feedback branch from 73be9a6 to 4c1276f Compare May 12, 2025 17:29
Copy link
github-actions bot commented May 12, 2025

Build Results:
All builds succeeded! ✅

@extend .truncate-second-line, .is-word-break;
white-space: normal;
}
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Reintroduced namespace-picker.scss in order to truncate long namespace names to 2 lines with ellipsis:
Screenshot 2025-05-12 at 10 31 44 AM

hellobontempo
hellobontempo previously approved these changes May 12, 2025
Copy link
Contributor
@hellobontempo hellobontempo left a comment

Choose a reason for hiding this comment

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

Nice work and creative solution! My main concern is not having a max width set and forever expanding to the widest namespace. But perhaps there's a css class I missed that covers this.

Also, just a nit about naming css classes 🙃

@@ -23,6 +23,11 @@
padding: size_variables.$spacing-36;
}

.has-side-padding-4 {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: the updated pattern for new css classes is to drop has- or is- [docs]

Copy link
Contributor

Choose a reason for hiding this comment

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

I also wonder if it might make sense to move some of these helpers to the namespace-picker.scss file. I'll defer to your judgement, just a thought 💭

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for catching this!! I was following the existing patterns in the spacing file, but that makes sense to not add new css classes following the old pattern. 🎉

I could be convinced either way. If we moved them into namespace-picker.scss they would still have the generic spacing css class names (like top-padding-10 instead of something like namespace-picker__{element}) since they are reused throughout the file. So, if no one has a strong opinion, I think it makes sense to keep them in spacing.scss file.

const namespaceLinks = document.querySelectorAll('[data-test-namespace-link]');
namespaceLinks.forEach((checkmark: Element) => {
const width = (checkmark as HTMLElement).offsetWidth;
if (width > maxWidth) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this wrap at any point or will it always expand to the longest namespace? Wondering if we should have/need some sort of max limit 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The HDS component has a maxWidth of 400px, so if it's > 400px it will wrap.

For example, in this case the help text ("Enter a full path...") at the top is the element w/ the adjusted width, and you can see that it is wrapped to 2 lines:
Screenshot 2025-05-12 at 10 31 55 AM

Copy link
Contributor

Choose a reason for hiding this comment

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

Awesome! Thanks for confirming


@use '../helper-classes/general';

.namespace-picker {
Copy link
Contributor

Choose a reason for hiding this comment

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

Good call on making this a component specific css file and class! 🎉

@beagins beagins merged commit 52aa1e0 into main May 12, 2025
33 of 34 checks passed
@beagins beagins deleted the ui/VAULT-35871/address-ui-feedback branch May 12, 2025 22:52
Monkeychip pushed a commit that referenced this pull request May 13, 2025
)

* [VAULT-35871] UI: Address design UI feedback on namespace picker

* remove unused css class

* dynamic width based on namespace length; not help messages

* handle long namespace name - truncate the second line

* hide/show message element so that it doesn't affect the layout while getting the width.

* add cop
6BF8
yright header to scss file

* address PR comments & additional design feedback

* fix syntax error

* address more design feedback: use small buttons
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hashicorp-contributed-pr If the PR is HashiCorp (i.e. not-community) contributed pr/no-changelog ui
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0