You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Assigns view shows list and tuple elements in sorted order instead of their real order #1011
The Assigns section sorts the elements of every list and tuple before it displays them. The displayed term no longer matches the real assign value. Tuples are affected the most, because element position is their meaning.
The sorting comes from to_children/1 in lib/live_debugger/app/utils/term_parser.ex, added in #896 together with map key sorting for #886.
Actual Behavior
assign(socket, result: {:ok, 5}) displays as {5, :ok}.
assign(socket, date: {2026, 10, 21}) displays as {10, 21, 2026}.
assign(socket, items: [3, 1, 2]) displays as [1, 2, 3].
Updates make it inconsistent as well. TermDiffer computes list insertions and deletions by position in the real list, and TermParser.update_by_diff/2 applies them by index to the sorted children. Changing [3, 1, 2] to [3, 1, 2, 0] shows [1, 2, 3, 0], while a fresh render of the same value shows [0, 1, 2, 3].
Expected Behavior
Lists and tuples keep their element order, the same as inspect/2 and the "copy" button output. Map and struct keys can stay sorted.
Steps to Reproduce
I reproduced this at the TermParser level, not in the live UI:
Activity