Repository navigation
feat(ui): remove the highlighted clip with the Delete key - #12
Merged
Merged
Conversation
Contributor
Author
|
I'll resolve the conflicts tomorrow |
Owner
|
Okay |
Delete (and KP_Delete) removes the highlighted clip, handing the cursor to the next match first so it can be held down the list. During an active search Delete still edits the query text (forward-delete), so filtering is unaffected. The pure KeyAction policy gains RemoveSelected and is unit-tested.
hadoukim
force-pushed
the
feat/delete-clip
branch
from
August 12, 2026 06:55
2062d11 to
81949d1
Compare
Walkercito
self-requested a review
August 12, 2026 16:58
Owner
|
All right, I'll add some tests fist, looks good to me |
key_action() re-read search_active on every press, so a run of Delete presses that began as text editing turned destructive the moment the query emptied: type a filter, select all, Delete, and one overshoot press removed a clip. Held down, autorepeat cascaded through several. Removal has no undo and no confirmation. Latch the run's role on its opening press and clear it on release, so the first press decides for the whole run. present() resets the latch, since a Delete held across a hide never delivers its release. Also cover the modifier, keypad, and rebinding edges of the key, plus HistoryService::remove on pinned, subscribed, and absent entries.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What does this PR do?
Delete(andKP_Delete) removes the highlighted clip, then moves the cursorto the next match so it can be held to clear items down the list. During an
active search Delete still edits the query text (forward-delete), so filtering
is unaffected — Escape leaves search mode first.
Type of change
Checklist
-Werror).ctest --preset debugpasses. (153/153)cmake --build --preset asan && ctest --preset asan(zero leaks, zero UB).clang-formatis clean (v18.1.8, the pinned version);clang-tidyis left to CI, per the project's.pre-commit-config.yaml.core/ships with tests. — N/A, nocore/change; the addedKeyActionpolicy (ui/) ships 3 new unit tests.Deleterow.Notes for reviewers
RemoveSelectedis gated off while a search is active so Delete keeps editingthe query; the decision lives in the pure, unit-tested
KeyActionpolicy.remove_selection()hands the cursor to the surviving neighbour before callingthe existing
HistoryService::remove()(which drops the clip whatever its pinstate, unlike the Clear button's
clear_unpinned).