Skip to content

Word part creation, deletion, and edit confirmations #448

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

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

denniwang
Copy link
Collaborator

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

Copy link

netlify bot commented Mar 18, 2025

Deploy Preview for dailp failed.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant