Skip to content

Comments

Fix table sorting with defaults#1438

Open
mzueva wants to merge 1 commit intomainfrom
mzueva/MILAB-5579-default-table-sorting
Open

Fix table sorting with defaults#1438
mzueva wants to merge 1 commit intomainfrom
mzueva/MILAB-5579-default-table-sorting

Conversation

@mzueva
Copy link

@mzueva mzueva commented Feb 16, 2026

MILAB-5579 Reverse the merge order so user sorting comes after ops.sorting, making user selections win

@notion-workspace
Copy link

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @mzueva, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request resolves an issue where user-defined table sorting was being incorrectly overridden by default operational sorting. By adjusting the order in which sorting parameters are merged, the system now correctly prioritizes user selections, ensuring a more intuitive and expected user experience for data table interactions.

Highlights

  • Sorting Logic Prioritization: The merge order for table sorting has been reversed within the PlDataTable component to ensure that user-defined sorting preferences now take precedence over operational (ops) sorting defaults.
Changelog
  • .changeset/brave-results-shave.md
    • Added a changeset entry documenting the fix for table sorting prioritization.
  • sdk/model/src/components/PlDataTable.ts
    • Reversed the order of merging sorting arrays to prioritize user-defined sorting over operational defaults.
Activity
  • No human activity has been recorded on this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@changeset-bot
Copy link

changeset-bot bot commented Feb 16, 2026

🦋 Changeset detected

Latest commit: bf1409b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 17 packages
Name Type
@platforma-sdk/model Patch
@milaboratories/pl-model-middle-layer Patch
@milaboratories/pf-driver Patch
@milaboratories/pl-middle-layer Patch
@milaboratories/uikit Patch
@platforma-sdk/ui-vue Patch
@milaboratories/milaboratories.monetization-test.model Patch
@milaboratories/milaboratories.monetization-test.ui Patch
@milaboratories/milaboratories.ui-examples.model Patch
@milaboratories/milaboratories.ui-examples.ui Patch
@milaboratories/milaboratories.ui-examples Patch
@milaboratories/milaboratories.pool-explorer.model Patch
@milaboratories/milaboratories.pool-explorer Patch
@platforma-sdk/block-tools Patch
@platforma-sdk/test Patch
@milaboratories/milaboratories.pool-explorer.ui Patch
@milaboratories/milaboratories.monetization-test Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request correctly fixes an issue where default table sorting options would override user selections. By reversing the merge order of the sorting arrays, user-defined sorting now correctly takes precedence. The change is logical and effectively resolves the bug. For consistency, you may want to consider if a similar change is needed for the filter merging logic, which appears to still prioritize default options over user-set filters, though this is outside the scope of the current changes.

@codecov
Copy link

codecov bot commented Feb 16, 2026

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 52.76%. Comparing base (1a21c44) to head (bf1409b).
⚠️ Report is 4 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
sdk/model/src/components/PlDataTable.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1438      +/-   ##
==========================================
- Coverage   52.78%   52.76%   -0.02%     
==========================================
  Files         239      239              
  Lines       13472    13472              
  Branches     2787     2787              
==========================================
- Hits         7111     7109       -2     
- Misses       5457     5459       +2     
  Partials      904      904              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

});
const sorting: PTableSorting[] = uniqueBy(
[...tableStateNormalized.pTableParams.sorting, ...(ops?.sorting ?? [])],
[...(ops?.sorting ?? []), ...tableStateNormalized.pTableParams.sorting],
Copy link
Contributor

Choose a reason for hiding this comment

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

We should fine correct solution for all cases

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.

3 participants