Skip to content

Allow editing tag:value in TagSelector#235

Merged
jmattheis merged 3 commits intotraggo:masterfrom
sf1tzp:click-to-edit
Feb 1, 2026
Merged

Allow editing tag:value in TagSelector#235
jmattheis merged 3 commits intotraggo:masterfrom
sf1tzp:click-to-edit

Conversation

@sf1tzp
Copy link
Contributor

@sf1tzp sf1tzp commented Jan 25, 2026

Relates to #92

This change allows for editing of a tag.

It's implemented similarly to the existing Backspace functionality - when we click on a TagChip, it's removed from the Entries list and the tag:value text is placed in the TextInput.

Care is taken to preserve an existing value part when creating a new tag.

Clicking tags doesn't do anything when there's stuff in the input, to avoid overwriting the input's content without saving.

edit-tags.mp4

@sf1tzp sf1tzp marked this pull request as ready for review January 25, 2026 20:31
@Minnowo
Copy link
Contributor

Minnowo commented Jan 26, 2026

Would this potentially cause problems for scrolling on mobile?
When scrolling through history you might accidentally click a tag clip removing the tag.

@sf1tzp
Copy link
Contributor Author

sf1tzp commented Jan 26, 2026

Good question. I did a small test using Firefox for iOS and didn't accidentally trigger an edit. Please give it a try and let me know otherwise.

@Minnowo
Copy link
Contributor

Minnowo commented Jan 26, 2026

Please give it a try and let me know otherwise.

Seems to be working well on mobile, you'd have to accidentally tap the screen somewhere to trigger it, I don't think it'll happen by accident when scrolling.

Copy link
Member

@jmattheis jmattheis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

const onTagClicked = (entry: TagSelectorEntry) => {
if (!removeWhenClicked) {
// Prevent overwriting text that's already being edited
if (currentValue) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The normal tag selector supports backspace to edit and ctrl+backspace to delete. I've changed this, so clicking the tag works similar.

@jmattheis jmattheis merged commit 773845c into traggo:master Feb 1, 2026
1 check 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.

3 participants