Skip to content

Using bool parameter values not intuitive #94

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
Emyrk opened this issue Apr 22, 2025 · 1 comment
Open

Using bool parameter values not intuitive #94

Emyrk opened this issue Apr 22, 2025 · 1 comment
Labels
documentation Improvements or additions to documentation

Comments

@Emyrk
Copy link
Member

Emyrk commented Apr 22, 2025

This does not behave as expected because the value is the string literal"true", not the boolean value true. This should be made more intuitive, or throw a warning?

data "coder_parameter" "ai" {
  name        = "ai"
  display_name = "Use AI?"
  description = "Do you want to use AI for this workspace?"
  type        = "bool"
  form_type   = "checkbox"
  default = false
  order       = 0
}

data "coder_parameter" "ai_prompt" {
  count = data.coder_parameter.ai.value == true ? 1 : 0 
  name        = "prompt"
  display_name = "Prompt"
  description = ""
  type        = "string"
  form_type   = "textarea"
  default = ""
  styling = jsonencode({
    placeholder = "hello world"
  })
}
@Emyrk Emyrk changed the title Using bool parameters not intuitive Using bool parameter values not intuitive Apr 22, 2025
@Emyrk Emyrk added the documentation Improvements or additions to documentation label Apr 22, 2025
@bpmct
Copy link
Member

bpmct commented Apr 22, 2025

I imagine many folks will run into this confusion. Huge fan of some form of warning or "magic" handling

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

No branches or pull requests

2 participants