Skip to content

Fix custom date range Apply state - #2444

Merged
niemyjski merged 2 commits into
mainfrom
issue/date-range-picker-apply
Aug 6, 2026
Merged

Fix custom date range Apply state#2444
niemyjski merged 2 commits into
mainfrom
issue/date-range-picker-apply

Conversation

@niemyjski

Copy link
Copy Markdown
Member

Summary: Seed custom range fields when a quick range is selected so the now end value is preserved when changing Last 90 days to now-1y. Add focused regression coverage. Verification: npm run test:unit -- --run passed 34 files and 402 tests; npm run check passed with 0 errors and 0 warnings; Prettier and ESLint passed; agent-browser Storybook dogfood passed the Last 90 days to Custom range to now-1y to Apply flow; thermo-nuclear code-quality review found no structural blockers. Full local AppHost verification was blocked because Elasticsearch exited with code 1 after a Docker hostname-resolution UnknownHostException. Breaking changes: none.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 59e05fffbe

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +55 to +59
const range = extractRangeExpressions(rangeValue);
if (range) {
startValue = range.start ?? '';
endValue = range.end ?? '';
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Seed fields from the persisted quick range

In the production DateFacetedFilter flow, selecting a quick range invokes handleSelect, which sets open = false and unmounts the picker inside Popover.Content, so the state assigned here is discarded. When the picker is reopened, its value is a common range and the initialization effect intentionally skips common ranges; expanding Custom and changing now-90d to now-1y therefore still leaves endValue empty and Apply disabled. Initialize the fields from the current common value when the picker mounts or Custom is expanded, rather than only storing them during the quick-range click.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in 026301f. The picker now derives its custom fields from the persisted string value on mount and prop changes, so the values survive the DateFacetedFilter popover unmount/remount. Quick-range selection no longer stores a second ephemeral copy. Added a remount regression test and QuickRangeCustomEditing Storybook scenario. Verified with 34 client test files / 402 tests, svelte-check, lint, and agent-browser: [now-90d TO now] opens Custom with now-90d/now, accepts now-1y, and Apply is enabled/clickable.

@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown

Code Coverage

Package Line Rate Branch Rate Complexity Health
Exceptionless.Core 75% 67% 9957
Exceptionless.AppHost 38% 40% 139
Exceptionless.Insulation 37% 35% 286
Exceptionless.Web 85% 68% 7022
Summary 78% (23438 / 30233) 67% (10986 / 16482) 17404

@niemyjski
niemyjski merged commit a785976 into main Aug 6, 2026
1 check passed
@niemyjski
niemyjski deleted the issue/date-range-picker-apply branch August 6, 2026 22:10
niemyjski added a commit that referenced this pull request Aug 8, 2026
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