Skip to content

Stabilize sorting when the sort key changes - #207

Open
m-aciek with Copilot wants to merge 1 commit into
mainfrom
copilot/ustabilizuj-sortowanie-przy-zmianie-klucza
Open

m-aciek with Copilot wants to merge 1 commit into
mainfrom
copilot/ustabilizuj-sortowanie-przy-zmianie-klucza

Conversation

Copilot AI commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Keep cards with equal sort values in their existing order when switching sort criteria.

Motivation: some sort criteria apply to narrow range of projects (for example recent changes). Keeping sorting stable instead of alphabetic order for the equal weights seems more natural and obvious.


📊 Dashboard preview 📊: https://python-docs-translations.github.io/dashboard/207/merge/

Co-authored-by: m-aciek <9288014+m-aciek@users.noreply.github.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-28T08:09:23.081293Z 752c518 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 752c518350

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

}
const sortField = sortFields[sortBy] || sortFields['completion-score'];
return Number(b.dataset[sortField]) - Number(a.dataset[sortField]) || nameComparison;
return Number(b.dataset[sortField]) - Number(a.dataset[sortField]);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Restore unpinned cards within tied groups

When a browser-language card has the same numeric value as surrounding cards—especially the common zero value for recent changes—reorder() removes its pinPriority while the card is still at the pinned front and then invokes this comparator. Returning zero preserves that pinned position within the tied group, so unpinning may not move the card at all and does not restore its normal position. Preserve an order from before pinning or use a deterministic tie-breaker when the pin state changes.

Useful? React with 👍 / 👎.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants