Skip to content

Conversation

@dganesh05
Copy link

@dganesh05 dganesh05 commented Nov 17, 2025

fix(plugin-chart-table): align order controls with UX expectations

  • Repositioned the order_desc checkbox directly under timeseries_limit_metric.
  • Hid order_desc unless a sort metric is selected in aggregate mode.
  • Updated buildQuery fallback ordering to respect the Sort Descending toggle.
  • Added Jest coverage for both the visibility logic and fallback ordering.

SUMMARY

The table chart’s sort controls now reflect their dependency: the Sort Descending checkbox sits under Sort Query By and is only rendered when a metric is selected (and we’re in aggregation mode). When no explicit sort metric is chosen, buildQuery now honors the user’s Sort Descending preference instead of always sorting descending. Added targeted Jest tests to cover both UI visibility and fallback ordering.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

issue_before
Before: Sort Descending always visible below pagination controls, independent of any selected metric, and fallback ordering ignored the toggle.

issue_after(1)
After: Checkbox appears directly under Sort Query By only when applicable, and default ordering flips based on the toggle even without an explicit sort metric.

TESTING INSTRUCTIONS

  1. npm run test -- plugin-chart-table/test/controlPanel.test.ts
  2. npm run test -- plugin-chart-table/test/buildQuery.test.ts
  3. In Explore → Table chart, verify Sort Descending hides when no Sort Query By metric is selected, reappears when one is chosen, and toggling it changes both the UI results and emitted SQL ordering.

ADDITIONAL INFORMATION

  • Has associated issue: Fixes Issue #3 - [BUG] BigQuery ProjectId missing in generated querie #6
  • 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

…r_desc behavior

- Updated the default ordering logic to respect the "Sort descending" toggle.
- Added tests to ensure correct behavior of order_desc when defaulting to the first metric.
- Cleaned up code formatting and comments for clarity.
- Updated .gitignore to exclude .cursor/ directory.
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.

Issue #3 - [BUG] BigQuery ProjectId missing in generated querie

1 participant