YousufFFFF opened a new pull request, #37712:
URL: https://github.com/apache/superset/pull/37712

   …it tests. The sorting options now consistently include axis and metric 
choices regardless of dimension presence, and multi-series sort options are 
conditionally added. New tests ensure expected behavior for various control 
states.
   
   <!---
   Please write the PR title following the conventions at 
https://www.conventionalcommits.org/en/v1.0.0/
   Example:
   fix(dashboard): load charts correctly
   -->
   
   ## Summary
   
   This PR fixes inconsistent behavior in the Bar chart **X-Axis Sort By** 
control when **Dimensions (groupby)** are set.
   
   Currently, when a dimension is added, the available sort options become 
restricted and prevent users from sorting the categorical axis by another 
numeric column (e.g. sorting `DayName` by `Day_Number`). This differs from the 
behavior when no dimension is set and leads to confusing, inconsistent UX.
   
   This change aligns the sort behavior so users can explicitly control axis 
ordering in a predictable way, without altering existing defaults.
   
   ---
   
   ## Problem
   
   When **Dimensions** are configured on a Bar chart:
   - The **X-Axis Sort By** dropdown is limited to a small fixed set of options.
   - Users cannot sort a categorical axis using a different numeric column.
   - This is surprising in common BI use cases (e.g. days of week, ranked 
categories).
   
   The behavior differs depending on whether a dimension is set, even though 
the underlying use case remains valid.
   
   Tracked in: #34352
   
   ---
   
   ## Solution
   
   - Updated the Bar chart control logic to make **X-Axis Sort By** behave 
consistently when Dimensions are present.
   - Ensured valid numeric sort options remain available without breaking 
existing defaults.
   - No changes were made to query semantics unless the user explicitly selects 
a different sort option.
   
   ---
   
   ## Scope
   
   - Applies to **ECharts Bar Chart**
   - Frontend-only change
   - No breaking changes
   - No behavior change unless the user opts into a different sort option
   
   ---
   
   ## Tests
   
   - Added unit tests covering **X-Axis Sort By behavior when Dimensions are 
set**
   - Tests verify that valid numeric sort options remain available and 
selectable
   - Existing behavior without Dimensions is unchanged
   
   ---
   
   ## After Video:
   
https://github.com/user-attachments/assets/a9c8c28d-293e-46fc-a760-97e1a8e767b7
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to