dailp-encoding icon indicating copy to clipboard operation
dailp-encoding copied to clipboard

Word part creation, deletion, and edit confirmations

Open denniwang opened this issue 8 months ago • 1 comments

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:

  • Added a new SQL query to delete word segments by word_id in types/queries/delete_word_segments.sql.
  • Updated the database_sql.rs file to use the new delete query when segments are empty or before upserting new segments.

Form Context Updates:

  • Modified the FormProvider in website/src/edit-word-form-context.tsx to include originalSegmentCount and added validation checks for segment deletion. [1] [2] [3]

UI Enhancements:

  • Updated the EditButton in website/src/edit-word-feature.tsx to store the original segment count when entering edit mode. [1] [2]
  • Added a new button to the PanelLayout component to allow adding new word parts. [1] [2]
  • Enhanced the 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. image New edit word part form with add and delete functionality image Confirmation message when attempting to save changes that result in a deleted word part image

denniwang avatar Mar 18 '25 19:03 denniwang

Deploy Preview for dailp failed.

Name Link
Latest commit cf5191af3eece1488a66cf8708c0c7fb6d0078e8
Latest deploy log https://app.netlify.com/sites/dailp/deploys/67d9c9767aa05f0008f9fc77

netlify[bot] avatar Mar 18 '25 19:03 netlify[bot]

Deploy Preview for dailp ready!

Name Link
Latest commit 6c31c8795d93c1457e23317cd0006d9cfa465e67
Latest deploy log https://app.netlify.com/projects/dailp/deploys/686d516a37ca320008233d4b
Deploy Preview https://deploy-preview-448--dailp.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

netlify[bot] avatar Jun 11 '25 20:06 netlify[bot]