Skip to content

Implement UI-based Strict Confirmation (Following Terminal Prompt)#89

Merged
babarot merged 1 commit intomainfrom
babarot/type-yes-on-bulk-delete
Feb 25, 2025
Merged

Implement UI-based Strict Confirmation (Following Terminal Prompt)#89
babarot merged 1 commit intomainfrom
babarot/type-yes-on-bulk-delete

Conversation

@babarot
Copy link
Copy Markdown
Owner

@babarot babarot commented Feb 25, 2025

WHAT

This PR enhances the confirmation dialog in the UI by introducing two distinct confirmation modes:

  1. Standard Yes/No Confirmation
    • For single file deletions
    • Quick confirmation with 'y/n' prompt
  2. Strict "YES" Typing Confirmation
    • For multiple file deletions
    • Requires typing "YES" exactly
    • Provides real-time visual feedback
    • Prevents accidental deletions

Key Implementation Details:

  • Added new confirmation struct to ViewState to track confirmation state
  • Introduced ConfirmState type with two modes: ConfirmStateYesNo and ConfirmStateTypeYES
  • Created methods to handle character-by-character input validation
  • Added new styling for confirmation dialog with success and error indicators
  • Implemented input tracking for "YES" with backspace support

WHY

This implementation extends the previous work in PR #85, bringing the strict confirmation mechanism from the terminal prompt to the restore UI.

The motivation remains the same: preventing accidental deletions by:

  • Requiring more deliberate user confirmation
  • Making users consciously type out their confirmation
  • Providing clear visual feedback during the confirmation process

By implementing this in the UI layer, we provide a consistent and safe deletion experience across different interaction modes.

@babarot babarot added the kind/feature A feature request; new or enhanced behavior label Feb 25, 2025
@babarot babarot changed the title Add new typing-YES UI to confirm View Implement UI-based Strict Confirmation (Following Terminal Prompt) Feb 25, 2025
@babarot babarot merged commit 519e10b into main Feb 25, 2025
5 checks passed
@babarot babarot deleted the babarot/type-yes-on-bulk-delete branch February 25, 2025 11:54
@github-actions github-actions bot mentioned this pull request Feb 25, 2025
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Mar 26, 2025
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [babarot/gomi](https://github.com/babarot/gomi) | minor | `v1.5.1` -> `v1.6.0` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>babarot/gomi (babarot/gomi)</summary>

### [`v1.6.0`](https://github.com/babarot/gomi/blob/HEAD/CHANGELOG.md#v160---2025-02-26)

[Compare Source](babarot/gomi@v1.5.1...v1.6.0)

##### New Features

-   Add `--prune` option for trash management by [@&#8203;babarot](https://github.com/babarot) in babarot/gomi#88
-   Implement UI-based Strict Confirmation (Following Terminal Prompt) by [@&#8203;babarot](https://github.com/babarot) in babarot/gomi#89
-   Add Image Preview in Detail View by [@&#8203;babarot](https://github.com/babarot) in babarot/gomi#92

##### Refactorings

-   Add tests  by [@&#8203;babarot](https://github.com/babarot) in babarot/gomi#86
-   Add immediate renderer instead of using immediately flag by [@&#8203;babarot](https://github.com/babarot) in babarot/gomi#87

##### Website Updates

-   Add Website Carousel and Reorganize Project Documentation by [@&#8203;babarot](https://github.com/babarot) in babarot/gomi#90
-   Tweak site designs, animations and layouts by [@&#8203;babarot](https://github.com/babarot) in babarot/gomi#91

##### Others

-   Add strict YES validation to confirm prompt by [@&#8203;babarot](https://github.com/babarot) in babarot/gomi#85

</details>

---

### Configuration

πŸ“… **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

β™» **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.

πŸ”• **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4yMTMuNSIsInVwZGF0ZWRJblZlciI6IjM5LjIxMy41IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiXX0=-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/feature A feature request; new or enhanced behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant