Skip to content

Commit 2534306

Browse files
acstllclaude
authored andcommitted
[Unified Search] Flip newDateRangePickerEnabled feature flag fallback to true (elastic#264743)
## Summary This makes the new time picker the default in Discover and Dashboards. It flips the fallback of the `unifiedSearch.newDateRangePickerEnabled` feature flag to `true`, so the new `DateRangePicker` becomes the default when the flag isn't explicitly configured. See elastic#260163 To opt back into the legacy `EuiSuperDatePicker` locally, you can override the flag in `config/kibana.dev.yml`: ```yaml feature_flags.overrides: unifiedSearch.newDateRangePickerEnabled: false ``` ## Changes Follow-up commits on this branch also fix FTR/snapshot fallout from the flip: - `_esql_view.ts` (stateful + serverless): replaced hard-coded `superDatePickerToggleQuickMenuButton` checks with `timePicker.timePickerExists()` (both picker paths). Specs already had `// TODO`s for exactly this change. - `dashboard_controls` light/dark snapshots: regenerated baselines to reflect the new picker's duration badge on dashboards. - `ccs_compatibility/_cancel_results.ts` (ES|QL subtest): made the query submit explicit so it no longer depends on the legacy picker's internal `querySubmitButton` click. > [!NOTE] > Two Flaky Test Runner passes on the affected CCS config are linked in the comments below. ### Checklist - [ ] Any text added follows [EUI's writing guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses sentence case text and includes [i18n support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md) - [ ] [Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html) was added for features that require explanation or tutorials - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] If a plugin configuration key changed, check if it needs to be allowlisted in the cloud and added to the [docker list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker) - [ ] This was checked for breaking HTTP API changes, and any breaking changes have been approved by the breaking-change committee. The `release_note:breaking` label should be applied in these situations. - [x] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [x] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) - [x] Review the [backport guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing) and apply applicable `backport:*` labels. ### Identify risks Users who have not explicitly set the flag will now see the new DateRangePicker in place of the legacy `EuiSuperDatePicker`. This is the entire point of the flag — a staged rollout — so the risk is limited to UX differences between the two pickers (e.g. the new picker's duration badge, which required snapshot baseline updates here). - [ ] ~~[See some risk examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)~~ --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 5193748 commit 2534306

6 files changed

Lines changed: 8 additions & 11 deletions

File tree

src/platform/plugins/shared/unified_search/public/query_string_input/query_bar_top_row.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ import { shallowEqual } from '../utils/shallow_equal';
7272
import { FilterBarToggleButton } from '../filter_bar/filter_bar_toggle_button';
7373
import { FilterBarContextProvider } from '../filter_bar/filter_bar_context';
7474

75-
/** Feature flag key for the new DateRangePicker. Falls back to `false` (legacy picker). */
75+
/** Feature flag key for the new DateRangePicker. Falls back to `true` (new picker). */
7676
const DATE_RANGE_PICKER_FEATURE_FLAG = 'unifiedSearch.newDateRangePickerEnabled';
7777

7878
const BUTTON_MIN_WIDTH = 108;
@@ -392,7 +392,7 @@ export const QueryBarTopRow = React.memo(
392392

393393
const shouldUseLegacyTimePicker =
394394
!props.enableDateRangePicker ||
395-
!kibana.services.featureFlags?.getBooleanValue(DATE_RANGE_PICKER_FEATURE_FLAG, false);
395+
!kibana.services.featureFlags?.getBooleanValue(DATE_RANGE_PICKER_FEATURE_FLAG, true);
396396

397397
const isQueryLangSelected = props.query && !isOfQueryType(props.query);
398398
const shouldRenderESQLUi = Boolean(showQueryInput && isQueryLangSelected);

src/platform/test/functional/apps/discover/ccs_compatibility/_cancel_results.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,11 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
120120
it('should show warning and results', async () => {
121121
await common.navigateToApp('discover');
122122
await discover.selectTextBaseLang();
123+
await timePicker.setDefaultAbsoluteRange();
123124
await monacoEditor.setCodeEditorValue(`FROM logstash-*, ftr-remote:logstash-* METADATA _index
124125
| EVAL buckets = DATE_TRUNC(5 minute, @timestamp), delay = TO_STRING(CASE(STARTS_WITH(_index, "ftr-remote"), DELAY(10ms), false))
125126
| STATS count = COUNT(*) BY buckets, delay`);
126-
await timePicker.setDefaultAbsoluteRange();
127+
await testSubjects.click('querySubmitButton');
127128

128129
// Wait for the async search to be established on ES so that cancellation can retrieve
129130
// partial results via the async search ID

src/platform/test/functional/apps/discover/esql_2/_esql_view.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
9999
await unifiedFieldList.waitUntilSidebarHasLoaded();
100100

101101
expect(await testSubjects.exists('showQueryBarMenu')).to.be(true);
102-
// TODO: use timePicker page object instead of hard-coding test subjects (handles both old and new picker)
103-
expect(await testSubjects.exists('superDatePickerToggleQuickMenuButton')).to.be(true);
102+
expect(await timePicker.timePickerExists()).to.be(true);
104103
expect(await testSubjects.exists('addFilter')).to.be(true);
105104
expect(await testSubjects.exists('dscViewModeDocumentButton')).to.be(true);
106105
expect(await testSubjects.exists('unifiedHistogramChart')).to.be(true);
@@ -122,8 +121,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
122121

123122
expect(await testSubjects.exists('fieldListFiltersFieldSearch')).to.be(true);
124123
expect(await testSubjects.exists('ESQLEditor')).to.be(true);
125-
// TODO: use timePicker page object instead of hard-coding test subjects (handles both old and new picker)
126-
expect(await testSubjects.exists('superDatePickerToggleQuickMenuButton')).to.be(true);
124+
expect(await timePicker.timePickerExists()).to.be(true);
127125

128126
expect(await testSubjects.exists('showQueryBarMenu')).to.be(false);
129127
expect(await testSubjects.exists('addFilter')).to.be(false);
9.48 KB
Loading
7.87 KB
Loading

x-pack/platform/test/serverless/functional/test_suites/discover/esql/_esql_view.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
8282
await PageObjects.unifiedFieldList.waitUntilSidebarHasLoaded();
8383

8484
await testSubjects.existOrFail('showQueryBarMenu');
85-
// TODO: use timePicker page object instead of hard-coding test subjects (handles both old and new picker)
86-
await testSubjects.existOrFail('superDatePickerToggleQuickMenuButton');
85+
expect(await PageObjects.timePicker.timePickerExists()).to.be(true);
8786
await testSubjects.existOrFail('addFilter');
8887
await testSubjects.existOrFail('dscViewModeDocumentButton');
8988
await testSubjects.existOrFail('unifiedHistogramChart');
@@ -105,8 +104,7 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
105104

106105
await testSubjects.existOrFail('fieldListFiltersFieldSearch');
107106
await testSubjects.existOrFail('ESQLEditor');
108-
// TODO: use timePicker page object instead of hard-coding test subjects (handles both old and new picker)
109-
await testSubjects.existOrFail('superDatePickerToggleQuickMenuButton');
107+
expect(await PageObjects.timePicker.timePickerExists()).to.be(true);
110108

111109
await testSubjects.missingOrFail('showQueryBarMenu');
112110
await testSubjects.missingOrFail('addFilter');

0 commit comments

Comments
 (0)