[PR #12833] feat: allow updating chunk settings for the existing documents #27757

Closed
opened 2026-02-21 20:42:08 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/langgenius/dify/pull/12833

State: closed
Merged: Yes


Summary

This PR allows the chunk settings of existing documents to be changed via the Web GUI.

It includes the following changes:

  • API
    • Made the data_source of KnowledgeConfig optional.
    • This change is necessary because when modifying the chunk settings of existing documents, the POST to /documents will fail validation since data_source is not included.
  • Web
    • The hidden Save & Process button is now displayed.
    • Additionally, after pressing the Save button and finishing the embedding, the list of segments will be automatically updated by triggering resetList with usePathname.

Fixes #12794

Screenshots

Before After
image image

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

Tests

  • Before updating settings
    image
  • Change chunk length to 500 and save
    image
  • Start embedding
    image
  • Updated chunks are displayed without refreshing browser
    image
**Original Pull Request:** https://github.com/langgenius/dify/pull/12833 **State:** closed **Merged:** Yes --- # Summary This PR allows the chunk settings of existing documents to be changed via the Web GUI. It includes the following changes: - **API** - Made the `data_source` of `KnowledgeConfig` optional. - This change is necessary because when modifying the chunk settings of existing documents, the POST to `/documents` will fail validation since `data_source` is not included. - **Web** - The hidden `Save & Process` button is now displayed. - Additionally, after pressing the Save button and finishing the embedding, the list of segments will be automatically updated by triggering `resetList` with `usePathname`. Fixes #12794 # Screenshots | Before | After | |--------|-------| | ![image](https://github.com/user-attachments/assets/56983d84-af7f-4d32-a32b-ac9fe35439ce) | ![image](https://github.com/user-attachments/assets/a60bc5ec-0ae6-4c86-8dfd-568d733e9441) | # Checklist > [!IMPORTANT] > Please review the checklist below before submitting your pull request. - [ ] This change requires a documentation update, included: [Dify Document](https://github.com/langgenius/dify-docs) - [x] 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 # Tests - Before updating settings ![image](https://github.com/user-attachments/assets/09e9fdd0-62bd-4d0c-9b3c-9ce7f739c978) - Change chunk length to 500 and save ![image](https://github.com/user-attachments/assets/c25b7cb3-27af-4b86-a51d-12a8233b4e80) - Start embedding ![image](https://github.com/user-attachments/assets/72dc019f-312c-4c7b-a3db-c66c52ba415b) - Updated chunks are displayed without refreshing browser ![image](https://github.com/user-attachments/assets/5c5da15b-8bff-4f5e-a400-cc676e3ba6bf)
yindo added the pull-request label 2026-02-21 20:42:08 -05:00
yindo closed this issue 2026-02-21 20:42:08 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#27757