Skip to content

Use an editable combobox for the Cloud Run region field (DT-4232)#3636

Open
rossnelson wants to merge 3 commits into
mainfrom
dt-4232
Open

Use an editable combobox for the Cloud Run region field (DT-4232)#3636
rossnelson wants to merge 3 commits into
mainfrom
dt-4232

Conversation

@rossnelson

@rossnelson rossnelson commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

What

Replaces the free-text gcpRegion input on the Create Worker Deployment form (Cloud Run provider) with an editable Holocene Combobox, and makes the suggestion list configurable.

  • Suggests known GCP Cloud Run regions from a new GCP_REGIONS list.
  • Allows a custom region not in the list via allowCustomValue, so an unsupported-by-us region never blocks deployment creation.
  • Keeps the field visible and editable (no auto-hide, no forced default). The existing gcp-region-hint is preserved below the field.
  • Exposes an optional gcpRegions?: string[] prop, threaded page -> form -> compute-fields, so cloud-ui can pass its own region list. When omitted, the built-in GCP_REGIONS default applies.

Combobox fix

While wiring this up, found a latent bug in the shared Holocene Combobox: addCustomValue unconditionally cleared the input (displayValue = '') after selecting. For single-select this blanked the field even though the value was stored, so a newly added custom value looked unselected. That clear is only meant for multiselect (reset the input for the next chip), so it is now guarded with if (multiselect). The only other allowCustomValue consumer (nexus-form) is multiselect, so this path was never exercised before.

Why

The worker's region is always a GCP (Cloud Run) region, while the Namespace region may be AWS or Azure, so defaulting to the Namespace region is not reliable. Our GetRegions list only covers regions we support for hosting a namespace, not all GCP regions a Cloud Run worker pool can use. This offers helpful suggestions without limiting the user.

Notes

  • Skipped the optional Namespace-region pre-fill: the ticket flags the Namespace region as an unreliable GCP default and the plumbing was not warranted.
  • No schema change needed; gcpRegion stays a required non-empty string, which allows custom values.

Testing

  • pnpm check passes (0 errors)
  • pnpm lint passes (0 errors)

Jira: DT-4232

@vercel

vercel Bot commented Jul 7, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
holocene Ready Ready Preview, Comment Jul 7, 2026 7:50pm

Request Review

@temporal-cicd

temporal-cicd Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor
Warnings
⚠️

📊 Strict Mode: 10 errors in 1 file (1.2% of 858 total)

src/lib/holocene/combobox/combobox.svelte (10)
  • L154:4: Type 'null' is not assignable to type 'string'.
  • L157:4: Type 'null' is not assignable to type '"search" | "link" | "success" | "error" | "action" | "activity" | "add-square" | "add" | "apple" | "archives" | "arrow-down" | "arrow-left" | "arrow-up" | "arrow-right" | "ascending" | ... 146 more ... | "xmark-square"'.
  • L159:4: Type 'null' is not assignable to type 'keyof T'.
  • L244:4: 'inputElement' is possibly 'null'.
  • L245:4: 'inputElement' is possibly 'null'.
  • L251:14: Argument of type 'string | T | undefined' is not assignable to parameter of type 'string | T'.
  • L256:14: Argument of type 'string | T | undefined' is not assignable to parameter of type 'string | T'.
  • L302:60: Function lacks ending return statement and return type does not include 'undefined'.
  • L395:10: Type 'HTMLLIElement | null' is not assignable to type 'HTMLLIElement'.
  • L395:43: 'menuElement' is possibly 'null'.

Generated by 🚫 dangerJS against 2d986ce

@rossnelson rossnelson marked this pull request as ready for review July 7, 2026 20:06
@rossnelson rossnelson requested a review from a team as a code owner July 7, 2026 20:07
@rossnelson rossnelson enabled auto-merge (squash) July 7, 2026 20:07
roleExternalId = $bindable(),
gcpProject = $bindable(''),
gcpRegion = $bindable(''),
gcpRegions = [...GCP_REGIONS],

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

how come this is a copy? does it get mutated somewhere?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

It does, the user can a region that is not shown in the list. since its a static list, it made sense to also allow freeform input.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants