Word part creation, deletion, and edit confirmations #448
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request includes several changes to improve the word segmentation feature and enhance the edit functionality in the word panel. The most important changes include adding new SQL queries, updating the form context, and enhancing the UI components to support adding and deleting word segments.
Database Changes:
word_id
intypes/queries/delete_word_segments.sql
.database_sql.rs
file to use the new delete query when segments are empty or before upserting new segments.Form Context Updates:
FormProvider
inwebsite/src/edit-word-form-context.tsx
to includeoriginalSegmentCount
and added validation checks for segment deletion. [1] [2] [3]UI Enhancements:
EditButton
inwebsite/src/edit-word-feature.tsx
to store the original segment count when entering edit mode. [1] [2]PanelLayout
component to allow adding new word parts. [1] [2]WordPanel
component to support editing and deleting segments, and to always show the word parts panel in edit mode. [1] [2] [3] [4]Screenshots of frondend changes:



New button to create word parts when there are none in the beginning.
New edit word part form with add and delete functionality
Confirmation message when attempting to save changes that result in a deleted word part