Skip to content

feat/TanStack-Form #18346

New issue

Have a question about this project? No Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “No 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? No Sign in to your account

Merged
merged 6 commits into from
Apr 18, 2025
Merged

feat/TanStack-Form #18346

merged 6 commits into from
Apr 18, 2025

Conversation

WTW0313
Copy link
Collaborator

@WTW0313 WTW0313 commented Apr 18, 2025

Summary

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Tip

Close issue syntax: Fixes #<issue number> or Resolves #<issue number>, see documentation for more details.

Screenshots

Before After
... ...

Checklist

Important

Please review the checklist below before submitting your pull request.

  • This change requires a documentation update, included: Dify Document
  • I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.
  • I ran dev/reformat(backend) and cd web && npx lint-staged(frontend) to appease the lint gods

WTW0313 added 5 commits April 18, 2025 11:33
…indeterminate state

refactor: remove mixed state handling and update related styles
fix: update useCallback dependencies for better performance
… TextField, and SubmitButton with validation
…ld, SelectField, TextField, and SubmitButton with updated input sizes
@WTW0313 WTW0313 marked this pull request as ready for review April 18, 2025 03:37
@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. ☕️ typescript Pull request that update TypeScript code. labels Apr 18, 2025
@crazywoola crazywoola requested a review from Copilot April 18, 2025 05:33
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request introduces support for TanStack Form by updating existing hook dependencies and integrating new form components and demo scenarios. Key changes include:

  • Refining useCallback and useEffect dependency arrays in the Completed component.
  • Replacing legacy style props (e.g., className for sizing) with new "size" props in Input, InputNumber, and ParamItem components.
  • Adding new TanStack Form components and demo setups to improve form handling consistency.

Reviewed Changes

Copilot reviewed 29 out of 30 changed files in this pull request and generated no comments.

Show a summary per file
File Description
web/app/components/datasets/documents/detail/completed/index.tsx Updated useCallback and useEffect dependencies and switched from "mixed" to "indeterminate" prop.
web/app/components/datasets/create/step-two/inputs.tsx Replaced custom className sizing with the "size" prop on InputNumber.
web/app/components/base/param-item/index.tsx Changed size property from 'sm' to 'regular' for consistent styling.
web/app/components/base/input/index.tsx Adjusted prop type omission for the size attribute to prevent conflicts.
web/app/components/base/input-number/index.tsx Updated valid size options and adjusted padding logic for buttons.
web/app/components/base/form/** Introduced TanStack Form contexts, hooks, and several demo form components.
web/app/components/base/checkbox/index.tsx Replaced "mixed" prop with "indeterminate" and updated styling for better clarity.
Files not reviewed (1)
  • web/app/components/base/checkbox/index.module.css: Language not supported
Comments suppressed due to low confidence (2)

web/app/components/datasets/documents/detail/completed/index.tsx:564

  • [nitpick] The variable 'selectDefaultValue' returns both a string ('all') and a number (1 or 0) based on 'selectedStatus', which could lead to type ambiguity. Consider normalizing its return type to ensure consistent behavior in the SimpleSelect component.
const selectDefaultValue = useMemo(() => {

web/app/components/datasets/documents/detail/completed/index.tsx:378

  • The useEffect hook uses 'resetList' without including it in the dependency array. If 'resetList' is not stable, this could lead to stale closures; consider adding 'resetList' to the dependency array or documenting why its omission is intentional.
useEffect(() => { resetList() // eslint-disable-next-line react-hooks/exhaustive-deps

@WTW0313 WTW0313 marked this pull request as draft April 18, 2025 05:42
…er components; enhance Jest configuration and setup
@WTW0313 WTW0313 marked this pull request as ready for review April 18, 2025 07:50
@dosubot dosubot bot added 💪 enhancement New feature or request 📚 documentation Improvements or additions to documentation labels Apr 18, 2025
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Apr 18, 2025
@WTW0313 WTW0313 merged commit 1e74180 into main Apr 18, 2025
9 checks passed
@WTW0313 WTW0313 deleted the feat/tanstack-form branch April 18, 2025 07:54
No Sign up for free to join this conversation on GitHub. Already have an account? No Sign in to comment
Labels
📚 documentation Improvements or additions to documentation 💪 enhancement New feature or request lgtm This PR has been approved by a maintainer size:XL This PR changes 500-999 lines, ignoring generated files. ☕️ typescript Pull request that update TypeScript code.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants