[DT-3584] Migrate Nexus form to Superforms with validation#3158
Merged
andrewzamojc merged 19 commits intomainfrom Feb 23, 2026
Merged
[DT-3584] Migrate Nexus form to Superforms with validation#3158andrewzamojc merged 19 commits intomainfrom
andrewzamojc merged 19 commits intomainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
- Replace writable store pattern with Superforms - Add Zod schema for form validation - Fix error display: only show after user interaction - Remove `endpointForm` store export - Use bind:this pattern to expose form methods - Update parent components to use new API - Ensure errors don't show on initial load or empty state
- Add optional chaining for formComponent in block - Add null checks for endpoint.id in update and delete handlers
This resolves the 'used before being assigned' error by acknowledging that formComponent is undefined until the component mounts and bind:this executes.
d6cb621 to
f7d61ff
Compare
- Add toNexusEndpoint() utility to convert flat form data to nested API structure - Update create/edit pages to use transformation helper - Standardize nameHintText prop flow: base form has default, wrappers pass through - Remove inline transformations in favor of reusable utility This supports the Superforms migration by providing a shared transformation helper that both ui and cloud-ui can use to convert the new flat form structure to the nested NexusEndpoint structure required by the API.
- Change onSubmit prop type to return Promise<void> - Update onCreate and onUpdate wrapper callbacks to Promise<void> - Ensures SuperForms properly awaits async operations including navigation
- Matches pattern used in other forms (projects, etc) - Shows spinner during API call and navigation - Better visual feedback for users
- Add tainted state tracking from SuperForms - Button disabled when form hasn't been modified (edit forms only) - Prevents 'Nothing to change' API error - Matches pattern used in namespace settings forms - Button re-enables/disables as user makes/reverts changes
- Remove custom error state in favor of SuperForms message store - Add onError callback to display actual API error messages instead of generic fallbacks - Remove descriptionString from toNexusEndpoint helper (handled separately via encodePayloads) - Make allowedCallerNamespaces conditional to support OSS (omit when empty) - Await goto() calls to fix navigation timing and prevent loading state flash
Contributor
b077952 to
4dbfd63
Compare
The name field is disabled during editing, so the hint text is not needed.
rossnelson
reviewed
Feb 23, 2026
Collaborator
rossnelson
left a comment
There was a problem hiding this comment.
Looks good overall — clean migration to Superforms. One thing to clean up before merge:
The onError handler in nexus-form.svelte has debug console.log statements that should be removed:
console.log('SuperForms error object:', error);
console.log('Error keys:', error && typeof error === 'object' ? Object.keys(error) : 'N/A');Otherwise LGTM — approving.
rossnelson
approved these changes
Feb 23, 2026
| ? errorObj.statusText | ||
| : undefined; | ||
| const body = errorObj.body; | ||
|
|
Contributor
There was a problem hiding this comment.
⚠️ Type '{}' is not assignable to type 'string'.
temporal-cicd Bot
pushed a commit
that referenced
this pull request
Feb 24, 2026
Auto-generated version bump from 2.45.4 to 2.46.0 Bump type: minor Changes included: - [`1acf17c0`](1acf17c) docs: Add AUTHENTICATION.md referenced by README (#3157) - [`7d2368a2`](7d2368a) Corrected location of output directory (#3155) - [`1f2900c0`](1f2900c) [DT-3584] Migrate Nexus form to Superforms with validation (#3158) - [`f60fe1bf`](f60fe1b) feat(workflow): split Event History into Timeline and Event History tabs (#3109) - [`4801f8dc`](4801f8d) fix(workflow): remove extra vertical padding from history toolbar (#3179) - [`4ba52557`](4ba5255) Fix some minor bugs in the Standalone Activities UI (#3177)
rossedfort
added a commit
that referenced
this pull request
Feb 24, 2026
Auto-generated version bump from 2.45.4 to 2.46.0 Bump type: minor Changes included: - [`1acf17c0`](1acf17c) docs: Add AUTHENTICATION.md referenced by README (#3157) - [`7d2368a2`](7d2368a) Corrected location of output directory (#3155) - [`1f2900c0`](1f2900c) [DT-3584] Migrate Nexus form to Superforms with validation (#3158) - [`f60fe1bf`](f60fe1b) feat(workflow): split Event History into Timeline and Event History tabs (#3109) - [`4801f8dc`](4801f8d) fix(workflow): remove extra vertical padding from history toolbar (#3179) - [`4ba52557`](4ba5255) Fix some minor bugs in the Standalone Activities UI (#3177) Co-authored-by: rossedfort <11775628+rossedfort@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Migrates the Nexus endpoint form to use Superforms with Zod validation, following the established Superforms pattern used throughout the application.
To test it yourself, run it locally and go to nexus. Try saving without filling out the form, or adding invalid data.
The form is also imported into cloud-ui. You can test that on here https://cloud-ui-git-test-ui-bef7a7fd.preview.thundergun.io/nexus
Before - on load before clicking submit
Before - fixing name
After
Clicked save without filling it out
invalid name
fixed it
here's the edit form, same validation but has a delete button
Changes
nexus-form.svelte: Refactored to use Superforms with proper validation
$form,$errors, and$enhancenexus-create-endpoint.svelte & nexus-edit-endpoint.svelte: Updated to work with new Superforms pattern
Page components: Updated to pass data correctly to Superforms-enabled components
Benefits
Testing