mirror of
https://github.com/nyakang/nyaterm.git
synced 2026-10-04 16:00:52 +00:00
Cycling the sort button only reordered connections: `sort_groups` ignored `ConnectionSortMode` entirely, so folders stayed put and the tree looked unsorted. It now branches on the mode exactly as `sort_connections` does. Both comparisons also used ASCII-lowercase ordering, which puts `192.168.142.100` before `192.168.142.13` — and host lists are most of what this panel sorts. `nyaterm_core::natural_compare` compares digit runs by value without parsing them, so an arbitrarily long run cannot overflow, and falls back to the raw comparison when case folding ties so the order stays total. `visible_connection_ids` follows the same rule, or Shift-range selection would walk a different list than the one on screen; it also stops descending into collapsed folders, whose rows are not reachable. The button now shows which mode is active instead of hiding it in a tooltip: the glyph switches to sort-by-alpha, flips vertically for Z-A, and takes the primary tint while a name sort is on.