Skip to content

Conversation

@ffalathel
Copy link

@ffalathel ffalathel commented Oct 20, 2025

SUMMARY

This PR implements conditional visibility for the "Sort Descending" checkbox in the Table Chart control panel, improving user experience by eliminating confusion about non-functional controls.

Key Changes:

  • Conditional Visibility: The "Sort Descending" checkbox now only appears when a "Sort Query By" metric is selected, making it clear that these controls work together
  • Proper Positioning: Moved the checkbox to be directly below the "Sort Query By" control in its own row for better visual hierarchy
  • Fixed Sorting Logic: Resolved a default value mismatch between the control panel (default: true) and buildQuery logic (was default: false) that was preventing proper sorting functionality
  • Edge Case Handling: Added comprehensive validation for null, undefined, empty string, and empty array values

Design Rationale:

  • Follows established UI patterns for conditional control visibility
  • Maintains backward compatibility with existing functionality
  • Improves workflow efficiency by reducing unnecessary clicks
  • Creates clear visual relationship between dependent controls

Before:

  • "Sort Descending" checkbox always visible in aggregation mode
  • Checkbox positioned far from "Sort Query By" control
  • Users could interact with checkbox even when no metric was selected (non-functional)
  • Sorting functionality had default value mismatch

After:

  • "Sort Descending" checkbox only visible when "Sort Query By" metric is selected
  • Checkbox positioned directly below "Sort Query By" control in its own row
  • Clear visual relationship between dependent controls
  • Proper sorting functionality with consistent default values
Screen.Recording.2025-10-19.at.20.08.12.mov

TESTING INSTRUCTIONS

  1. Open Superset and create a new Table Chart
  2. Switch to "Aggregate" mode
  3. Verify "Sort Descending" checkbox is hidden initially (no metric selected)
  4. Select a metric in "Sort Query By" dropdown
  5. Verify "Sort Descending" checkbox appears directly below the dropdown
  6. Verify checkbox is checked by default (descending sort)
  7. Run the query and verify results are sorted in descending order
  8. Uncheck the "Sort Descending" checkbox
  9. Run the query and verify results are sorted in ascending order
  10. Clear the metric selection
  11. Verify "Sort Descending" checkbox disappears
  12. Test with different metric types and edge cases (null, empty arrays, etc.)

ADDITIONAL INFORMATION

  • Has associated issue:
  • Required feature flags:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

…imer for modal focus feature

- Created a detailed lifecycle document for business analysts outlining the rapid chart creation process, including user journey, component architecture, sequence diagrams, and pain points.
- Developed a technical primer covering the implementation of the auto-focus feature for the visualization type modal, detailing core technologies, React hooks, TypeScript fundamentals, and accessibility considerations.
- Added a comprehensive system overview document detailing the architecture of Apache Superset, including component catalog, technology stack, integration points, and deployment architecture.
- Documented various use cases for Apache Superset, highlighting user journeys, roles, capabilities, and key features across different scenarios.
- Changed PostgreSQL port mapping in docker-compose.yml from 5432 to 5433.
- Modified default value for 'order_desc' in buildQuery.ts to true for table charts.
- Added a new checkbox control for 'Sort descending' in controlPanel.tsx with visibility conditions based on aggregation mode and selected sort metric.
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.

1 participant