Repository navigation
accounts: keep the list order stable — always - #162
Merged
Merged
Conversation
Two ways the accounts page reshuffled, both gone: - Same-millisecond logins (issue #161): the sort key was created_at alone, ms-resolution; a tie fell back to read_dir enumeration order, which is filesystem-arbitrary for UUID-named slot files — the flaky cursor_slot_swap_round_trip flip. New slots now get stamped strictly after every sibling (max+1 bump in write_slot), and the sort carries the slot id as a deterministic tie-break for pre-existing collided files. - Switching accounts moved the switched-to card to the top: the engine deliberately lists in creation order ("never active-first"), but the UI's provider_accounts re-sorted active-first, defeating it. The re-sort is removed; the Active badge already marks the live account, and a list that reshuffles under the click reads as broken. Fixes #161. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
guilhermexp
pushed a commit
to guilhermexp/comet
that referenced
this pull request
Aug 30, 2026
…lity accounts: keep the list order stable — always
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #161, plus the related UX complaint: switching accounts moved the switched-to card to the top of the accounts page.
Two reshuffle sources, both removed
Same-millisecond logins (#161). The page sorts slots by
created_at, which has millisecond resolution. Two logins saved back-to-back tie, and the stable sort then preserves input order — which isread_direnumeration, filesystem-arbitrary for UUID-named slot files. That's thecursor_slot_swap_round_tripflip ([frank, erin]vs[erin, frank]), and it equally means a user's page could reorder between restarts. Fix:write_slotstamps a brand-new slot strictly after every sibling (max+1 bump), so creation stamps are collision-free going forward; the sort also carries the slot id as a deterministic tie-break for any pre-existing collided files.Active-first re-sort. The engine deliberately lists in creation order — its comment says "never active-first — switching must not reshuffle the cards" — but the UI's
provider_accountsre-sorted active-first, defeating it. Removed; the Active badge already marks the live account. The UI test that enshrined the old behavior now asserts the opposite (provider_grouping_keeps_engine_order_even_when_active_is_later).Also: workspace build repair
cargo test --workspacewas failing to compile on main: #159 addedRunRequest.worktreeand updated every initializer except the opencode probe example that landed in parallel via #157 (no CI job builds examples). One-line fix included here.Validation
m5c_accounts_uploads_titlesgreen 5/5 consecutive runs (previously order-dependent).🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.