Skip to content
New issue

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

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

fix: revert ref usage in handleFormChange to fix IME input issues #9672

Merged
merged 2 commits into from
Oct 23, 2024

Conversation

kurokobo
Copy link
Contributor

@kurokobo kurokobo commented Oct 22, 2024

Checklist:

Important

Please review the checklist below before submitting your pull request.

  • Please open an issue before creating a PR or link to an existing issue
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I ran dev/reformat(backend) and cd web && npx lint-staged(frontend) to appease the lint gods

Description

This PR partially reverts recent following two changes to the handleFormChange function on #9526 to fix issues with IME input, where typing would result in duplicated characters or premature confirmation of incomplete input.

In #9526, the handleFormChange function was updated:

  • useCallback was removed
  • ref (newConversationInputsRef.current) was used instead of state

After this change, IME input (e.g., for Japanese) started to behave incorrectly, with input duplication and issues during conversion.

Fixes #9671
Fixes #9663

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update, included: Dify Document
  • Improvement, including but not limited to code refactoring, performance optimization, and UI/UX improvement
  • Dependency upgrade

Testing Instructions

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • The variables of the published app can be input, and available in the chatbot
  • The variables of the embedded app can be input, and available in the chatbot

@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. 🐞 bug Something isn't working labels Oct 22, 2024
@kurokobo
Copy link
Contributor Author

@zxhlyh @iamjoel @JzoNgKVO
Hi, this is just for your information but I'm tagging you (who created #9526). Please let me know if you have any concerns about this change. Thanks!

@crazywoola crazywoola requested a review from zxhlyh October 23, 2024 00:57
@zxhlyh zxhlyh requested review from JzoNgKVO and removed request for zxhlyh October 23, 2024 01:59
crazywoola
crazywoola previously approved these changes Oct 23, 2024
Copy link
Member

@crazywoola crazywoola left a comment

Choose a reason for hiding this comment

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

LGTM

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Oct 23, 2024
@crazywoola crazywoola added this to the 0.10.1 milestone Oct 23, 2024
@laipz8200 laipz8200 merged commit b9afb7b into langgenius:main Oct 23, 2024
4 checks passed
@kurokobo kurokobo deleted the ime branch October 23, 2024 07:50
Scorpion1221 added a commit to yybht155/dify that referenced this pull request Oct 24, 2024
* commit '400392230b47fff5d011b55afd8b0f8b8083ade0': (74 commits)
  fixed: variable reference error (langgenius#9722)
  add vdb py test (langgenius#9706)
  downgrade unstructured nltk version (langgenius#9726)
  remove ppt import (langgenius#9721)
  Modify characters (langgenius#9707)
  chore: update version to 0.10.1 (langgenius#9689)
  fix: refresh current page if url contains token (langgenius#9718)
  Revert "Feat: use file size limit from api" (langgenius#9714)
  feat: support user-defined configuration of log file size and retention count (langgenius#9610)
  build(deps): bump next from 14.2.4 to 14.2.10 in /web (langgenius#9713)
  Feat: use file size limit from api (langgenius#9711)
  feat(model_runtime): add new model 'claude-3-5-sonnet-20241022' (langgenius#9708)
  build(deps): bump mermaid from 10.4.0 to 10.9.3 in /web (langgenius#9709)
  nltk security issue and upgrade unstructured (langgenius#9558)
  feat: added claude 3.5 sonnet v2 model to Google Cloud Vertex AI (langgenius#9688)
  fix: revert ref usage in handleFormChange to fix IME input issues (langgenius#9672)
  Help documentation URL correction (langgenius#9704)
  fix: workflow [if node] checklist (langgenius#9699)
  feat(api): add video and audio file size limits to upload config (langgenius#9703)
  fix: remove email code login redirect (langgenius#9698)
  ...

# Conflicts:
#	web/yarn.lock
idonotknow pushed a commit to AceDataCloud/Dify that referenced this pull request Nov 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working lgtm This PR has been approved by a maintainer size:S This PR changes 10-29 lines, ignoring generated files.
Projects
None yet
5 participants