Skip to content

Implement chip deletion on backspace for filter labels#450

Merged
bborn merged 1 commit intomainfrom
task/1293-implement-chip-deletion-on-backspace-for
Feb 12, 2026
Merged

Implement chip deletion on backspace for filter labels#450
bborn merged 1 commit intomainfrom
task/1293-implement-chip-deletion-on-backspace-for

Conversation

@bborn
Copy link
Owner

@bborn bborn commented Feb 12, 2026

Summary

  • Implements chip deletion on backspace for project labels in the filter input
  • When cursor is positioned right after a ] character, pressing backspace deletes the entire [project] chip plus any trailing space

Implementation Details

  • Enhanced the case "backspace": handler in filter mode to detect cursor position relative to chip boundaries
  • Searches backward from cursor to find matching [ bracket
  • Deletes the entire chip and any trailing space in a single operation
  • Maintains existing behavior when cursor is not positioned after a chip

Test Coverage

Added comprehensive test cases covering:

  • ✅ Deleting chip at end of input
  • ✅ Deleting chip in middle of text
  • ✅ Deleting first chip when multiple chips present
  • ✅ Deleting second chip when multiple chips present
  • ✅ No deletion when cursor not after ]
  • ✅ Handling chips without trailing space
  • ✅ Handling nested/malformed brackets

Test Results

All existing tests continue to pass, and new test cases verify the chip deletion behavior works correctly.

🤖 Generated with Claude Code

When the user presses backspace with the cursor positioned right after
a project label chip (e.g., [project]), the entire chip is now deleted
at once instead of just the closing bracket.

This improves the UX by treating project labels as atomic units that
can be quickly removed with a single backspace press.

Changes:
- Enhanced backspace handling in filter mode to detect when cursor is
  after a ] character
- Find and delete the entire [project] chip plus any trailing space
- Added comprehensive test coverage for various chip deletion scenarios

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@bborn bborn merged commit fc4ea97 into main Feb 12, 2026
3 checks passed
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