Skip to content

Conversation

@andrewzamojc
Copy link
Contributor

Summary

Migrates the Nexus endpoint form to use Superforms with Zod validation, following the established Superforms pattern used throughout the application.

Changes

  • nexus-form.svelte: Refactored to use Superforms with proper validation

    • Replaced manual state management with Superforms $form, $errors, and $enhance
    • Added Zod schema validation for form fields
    • Improved error handling and user feedback
  • nexus-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

  • Type-safe validation: Zod schema ensures runtime type safety
  • Consistent UX: Matches validation patterns used in other forms (capacity, groups, auth settings)
  • Better error handling: Clearer error messages and validation feedback
  • Maintainability: Follows established Superforms factory pattern

Testing

  • Tested Nexus endpoint creation flow
  • Tested Nexus endpoint edit flow
  • Verified validation errors display correctly
  • Confirmed form submission handling works as expected

- 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
@andrewzamojc andrewzamojc requested a review from a team as a code owner February 12, 2026 19:53
@andrewzamojc andrewzamojc requested review from GiantRobots and removed request for a team February 12, 2026 19:53
@vercel
Copy link

vercel bot commented Feb 12, 2026

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

Project Deployment Actions Updated (UTC)
holocene Ready Ready Preview, Comment Feb 12, 2026 7:54pm

Request Review


let formComponent: NexusForm;

const createDisabled = $derived(
Copy link
Contributor

Choose a reason for hiding this comment

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

  • ⚠️ Variable 'formComponent' is used before being assigned.

@temporal-cicd
Copy link
Contributor

temporal-cicd bot commented Feb 12, 2026

Warnings
⚠️

📊 Strict Mode: 4 errors in 2 files (0.4% of 1126 total)

src/lib/pages/nexus-create-endpoint.svelte (1)
  • L39:5: Variable 'formComponent' is used before being assigned.
src/routes/(app)/nexus/[id]/edit/+page.svelte (3)
  • L52:32: Argument of type 'string | null | undefined' is not assignable to parameter of type 'string'.
  • L53:33: Argument of type 'string | null | undefined' is not assignable to parameter of type 'string'.
  • L68:32: Argument of type 'string | null | undefined' is not assignable to parameter of type 'string'.

Generated by 🚫 dangerJS against 28e3f3d

@andrewzamojc andrewzamojc marked this pull request as draft February 12, 2026 19:56
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.

1 participant