fix(tui): keep highlight on moved ticket in destination column
After < or > move, find the ticket's index in the destination column's filtered list via indexWhere instead of jumping to nt.length - 1. indexWhere returns -1 if not found (e.g. filtered out), max(0,...) clamps that safely to the first position. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
parent
7f7dd25d76
commit
7bc7ee9898
1 changed files with 2 additions and 2 deletions
|
|
@ -417,7 +417,7 @@ class TuiCommand extends DewCommand {
|
|||
byColumn = _groupByColumn(tickets, config);
|
||||
colIdx--;
|
||||
final nt = _filtered(byColumn[newColId] ?? [], searchQuery);
|
||||
ticketIdx = max(0, nt.length - 1);
|
||||
ticketIdx = max(0, nt.indexWhere((x) => x.id == t.id));
|
||||
statusMsg = 'Moved ${t.id} → ${config.columns[colIdx].name}';
|
||||
} on ArgumentError catch (e) {
|
||||
statusMsg = 'Error: ${e.message ?? e}';
|
||||
|
|
@ -433,7 +433,7 @@ class TuiCommand extends DewCommand {
|
|||
byColumn = _groupByColumn(tickets, config);
|
||||
colIdx++;
|
||||
final nt = _filtered(byColumn[newColId] ?? [], searchQuery);
|
||||
ticketIdx = max(0, nt.length - 1);
|
||||
ticketIdx = max(0, nt.indexWhere((x) => x.id == t.id));
|
||||
statusMsg = 'Moved ${t.id} → ${config.columns[colIdx].name}';
|
||||
} on ArgumentError catch (e) {
|
||||
statusMsg = 'Error: ${e.message ?? e}';
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue