-
Notifications
You must be signed in to change notification settings - Fork 1.1k
feat: add delete functionality for text and list steps #299
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
Conversation
WalkthroughThe pull request introduces deletion functionality for text steps and list text fields within the Changes
Possibly related PRs
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (3)
src/components/organisms/RightSidePanel.tsx (3)
172-186: Consider consolidating delete and discard logic for text steps.The new
handleTextStepDeletemethod closely mirrors the logic inhandleTextStepDiscard, both removing the text step from state. Although the operations differ slightly in intent (discarding unconfirmed vs. deleting confirmed), you could unify parts of their internal logic to reduce duplication, or explore whether they can share utility functions.
561-575: Provide a user confirmation dialog before irreversible deletion.The user experience could benefit from a brief confirmation step (e.g., a modal) before deleting a confirmed text step. Although the code cleanly handles “delete,” a confirmation would reduce the risk of accidental data loss.
Line range hint
623-649: Similarly, prompt users before deleting confirmed list fields.As with text steps, consider adding a confirmation dialog when deleting confirmed list fields in
handleListTextFieldDelete, to ensure that users do not accidentally remove valuable data.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/components/organisms/RightSidePanel.tsx(5 hunks)
🔇 Additional comments (1)
src/components/organisms/RightSidePanel.tsx (1)
214-229: Maintain consistency and guard against potential key mismatches.
The handleListTextFieldDelete method properly removes the relevant field from confirmedListTextFields and errors. One possible enhancement is to log or handle situations where the fieldKey might not exist in the list, ensuring consistency if the database or upstream code has changed.
amhsirak
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@RohitR311 A passing thought : should we allow to delete steps after "confirm capture" - for both capture text and capture list.
After Capture Text and Capture List data fields confirmation provide the option to delete the field.
Summary by CodeRabbit
New Features
User Experience