feat: enhance input component and task modal UX

- Text selection & clipboard: Add full text selection support with Ctrl+A/C/X/V operations, visual highlight, and proper cursor positioning
- Multiple annotations: Fix annotation creation to properly append multiple entries instead of overwriting
- Navigation improvements: Improve annotation list navigation to cycle between items and input field
- UI layout fixes: Add flex wrapping to tag displays to handle long lists gracefully
- Focus management: Fix focus retention when switching between edit/view modes in task modal
- Tag suggestions: Prevent auto-acceptance of suggestions on Enter, allowing custom tag input
This commit is contained in:
Ignacio Perez
2026-01-04 19:45:27 -03:00
parent 540627db75
commit 0adcb9e512
8 changed files with 342 additions and 112 deletions
+6 -11
View File
@@ -877,6 +877,8 @@ impl TaskDetailModal {
self.entities.annotation_input.update(cx, |input, cx| {
input.clear(cx);
});
self.state.annotation_selected = None;
cx.notify();
}
@@ -1334,6 +1336,10 @@ impl TaskDetailModal {
match self.state.modal_focus {
ModalFocus::TagsInput => {
self.entities.tags_input.update(cx, |input, cx| {
input.close_suggestions(cx);
});
self.sync_form_from_inputs(cx);
if let Some(InlineEditTarget::Tag(i)) = self.state.inline_edit {
@@ -1581,7 +1587,6 @@ impl TaskDetailModal {
ConfirmAction::DeleteTag { index, .. } => {
if index < self.state.form.tags.len() {
self.state.form.tags.remove(index);
// Adjust selection
if self.state.form.tags.is_empty() {
self.state.tag_selected = None;
} else if let Some(sel) = self.state.tag_selected {
@@ -1710,16 +1715,6 @@ impl TaskDetailModal {
match ann.origin {
AnnotationOrigin::Added => {
self.state.inline_edit =
Some(InlineEditTarget::Annotation(actual_index));
let ann_value = ann.text.to_string();
self.entities.annotation_input.update(cx, |input, cx| {
input.set_value(ann_value, cx);
});
self.enter_edit_field(window, cx);
return CommandResult::Handled;
}
AnnotationOrigin::Original => {