Skip to content

feat: allow masking workspace parameter inputs #18595

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 18 commits into from
Jul 1, 2025
Merged

feat: allow masking workspace parameter inputs #18595

merged 18 commits into from
Jul 1, 2025

Conversation

aslilac
Copy link
Member

@aslilac aslilac commented Jun 25, 2025

Closes coder/preview#140

Screenshot 2025-06-27 at 2 32 12 PM Screenshot 2025-06-27 at 2 32 33 PM

Allows you to set mask_input on a coder_parameter to turn it into a "secret" input. Works for form_types of "textarea" and "input".

data "coder_parameter" "a" {
  // ...
  styling = {
    mask_input = true
  }
}

@aslilac aslilac requested a review from jaaydenh June 26, 2025 23:58
@aslilac aslilac marked this pull request as ready for review June 26, 2025 23:58
@jaaydenh
Copy link
Contributor

Im seeing a misalignment of the Eye button for the Input
Screenshot 2025-06-27 at 16 29 08

@jaaydenh
Copy link
Contributor

For the textarea the eye icon is tricky to place because of the placeholder and when resizing the textarea the eye icon doesn't move with the textarea because its absolute positioning. It may be easier to place the eye icon outside to the right of the textarea/input.

Screenshot 2025-06-27 at 16 33 17 Screenshot 2025-06-27 at 16 33 40

@aslilac
Copy link
Member Author

aslilac commented Jun 27, 2025

@jaaydenh thanks for checking the styles. I think the autofill widget that 1password inserts must've been messing with me. putting the toggle on the outside is a lot more consistent (and doesn't risk covering text content)

@jaaydenh
Copy link
Contributor

For the eye button, is the intention that it should only show the input when the user clicks and holds the button? Its currently possible to keep the button in a clicked state by clicking and holding on the button dragging the mouse off the button then letting go of the click. This causes the input to remain visible.

@jaaydenh
Copy link
Contributor

For maintaining the consistency of width of the all the form fields, what if the eye button exists outside of the width of the control. This will allow for all the inputs/textarea control to maintain the alignment on the right side.

Screenshot 2025-06-30 at 22 33 03

@aslilac
Copy link
Member Author

aslilac commented Jun 30, 2025

yeah but then if you ever tried to use them in a row or any context where something is positioned to the right of it, it'd throw everything off. if we really wanna discuss the design of it I'd rather just remove the button all together for now and do an actual design round later.

@jaaydenh
Copy link
Contributor

I think that overall the design regarding the width is low priority as this feature should have limited use. So I would say keep the button for now.

@aslilac
Copy link
Member Author

aslilac commented Jun 30, 2025

sounds good. the design could definitely be improved later, I just don't wanna trade one visual oddity for another. 🤷‍♀️

Copy link
Contributor

@jaaydenh jaaydenh left a comment

Choose a reason for hiding this comment

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

Approving but it could still be worth looking into why the eye button remains clicking when clicking on the button then dragging off it before unclicking.

@aslilac aslilac merged commit 0b82f41 into main Jul 1, 2025
39 checks passed
@aslilac aslilac deleted the lilac/mask-input branch July 1, 2025 22:27
@github-actions github-actions bot locked and limited conversation to collaborators Jul 1, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dynamic Paramters: Add maskInput styling option for input and textarea form types
2 participants