Skip to content

Conversation

@midigofrank
Copy link
Collaborator

Description

This PR update the workflow settings form to use tanstack forms with zod validation

Closes #3643

Validation steps

Open the workflow settings panel and update the name

AI Usage

Please disclose how you've used AI in this work (it's cool, we just want to know!):

  • Code generation (copilot but not intellisense)
  • Learning or fact checking
  • Strategy / design
  • Optimisation / refactoring
  • Translation / spellchecking / doc gen
  • Other
  • I have not used AI

You can read more details in our Responsible AI Policy

Pre-submission checklist

  • I have performed a self-review of my code.
  • I have implemented and tested all related authorization policies. (e.g., :owner, :admin, :editor, :viewer)
  • I have updated the changelog.
  • I have ticked a box in "AI usage" in this PR

Add NumberField and ToggleField components for TanStack Forms,
integrate them into WorkflowSettings inspector with Y.Doc sync,
and include comprehensive test coverage. Update TextField to
handle null values properly.

Components follow established patterns:
- NumberField handles nullable integers with min/max validation
- ToggleField provides accessible boolean toggle switches
- Both integrate with TanStack Forms via useFieldContext

WorkflowSettings now uses form-driven workflow updates with:
- Bidirectional Y.Doc sync (form ↔ Yjs)
- Zod validation matching backend constraints
- Virtual fields (concurrency, enable_job_logs) for future use
@midigofrank midigofrank requested a review from stuartc October 16, 2025 10:32
@midigofrank midigofrank self-assigned this Oct 16, 2025
@github-project-automation github-project-automation bot moved this to New Issues in v2 Oct 16, 2025
@codecov
Copy link

codecov bot commented Oct 16, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 88.64%. Comparing base (dd9e633) to head (b14bda4).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3771      +/-   ##
==========================================
+ Coverage   88.59%   88.64%   +0.05%     
==========================================
  Files         414      414              
  Lines       17943    17942       -1     
==========================================
+ Hits        15896    15905       +9     
+ Misses       2047     2037      -10     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

stuartc and others added 4 commits October 17, 2025 14:36
Resolved conflicts:
- CLAUDE.md: Adopted main's more specific icon usage guidelines
- useWorkflow.ts: Merged both updateWorkflow action and edge actions
The production field was removed from the Credential schema in commit
7de64c6 as part of the credential environments feature, but two
references remained causing a KeyError when the collaborative editor
requested credentials.

- Remove production field from workflow channel credential rendering
- Remove production field from TypeScript CredentialSchema
- Add test verifying correct credential structure to prevent regression
Replace text input with manual parseInt parsing with native type="number"
input. This simplifies the code by leveraging browser validation and
the valueAsNumber API, while properly handling nullable fields.

Changes:
- Use type="number" instead of type="text" with inputMode/pattern
- Use e.target.valueAsNumber instead of parseInt parsing
- Browser now handles invalid character prevention automatically
- min/max attributes now work as intended with number input
Create a reusable FormField wrapper that handles label, help text, and
error display. Extract common INPUT_CLASSES constant for consistent
styling. Remove hardcoded margins (mb-4) to allow parent forms to
control spacing.

This reduces duplication across TextField, NumberField, and SelectField
while maintaining consistent behavior.
@stuartc stuartc merged commit acb57f4 into main Oct 20, 2025
8 checks passed
@stuartc stuartc deleted the 3643-workflow-settings-form branch October 20, 2025 06:25
@github-project-automation github-project-automation bot moved this from New Issues to Done in v2 Oct 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Workflow Settings: Workflow name field

3 participants