Skip to content

fix(webui): Modify DatePicker callback to update time range on any change to prevent query submission with previous time range. #1171

Merged
hoophalab merged 4 commits into
y-scope:mainfrom
hoophalab:enter-fix
Aug 7, 2025

Conversation

@hoophalab

@hoophalab hoophalab commented Aug 6, 2025

Copy link
Copy Markdown
Contributor

Description

As the title suggests, this PR replaces the onChange callback with onCalendarChange.

DM: there was a bug where sometimes the time range does not update immediately, PR fixes that

Checklist

  • The PR satisfies the contribution guidelines.
  • This is a breaking change and that has been indicated in the PR title, OR this isn't a
    breaking change.
  • Necessary docs have been updated, OR no docs need to be updated.

Validation performed

  1. Change the custom time range by keyboard in the date picker.
  2. Hit Enter.
  3. The query is executed based on the new time range rather than the previous time range.

Summary by CodeRabbit

  • Style

    • Increased the minimum width of the date range picker for improved visibility.
  • Bug Fixes

    • Adjusted the event handling for the date range picker to ensure more accurate updates when selecting dates.

@hoophalab hoophalab requested a review from a team as a code owner August 6, 2025 22:16
@hoophalab hoophalab requested a review from davemarco August 6, 2025 22:16
@coderabbitai

coderabbitai Bot commented Aug 6, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

The changes update the event handler for the date range picker component from onChange to onCalendarChange in the TypeScript file, and increase the minimum width of the .rangePicker CSS class from 200px to 400px. No logic or exported entities were otherwise modified.

Changes

Cohort / File(s) Change Summary
Date Range Picker Event Handler
.../TimeRangeInput/index.tsx
Changed the event handler from onChange to onCalendarChange for the date range picker.
Date Range Picker Styling
.../TimeRangeInput/index.module.css
Increased .rangePicker minimum width from 200px to 400px.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~5–10 minutes

Possibly related PRs

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c72168a and 51f4c54.

📒 Files selected for processing (2)
  • components/webui/client/src/pages/SearchPage/SearchControls/TimeRangeInput/index.module.css (1 hunks)
  • components/webui/client/src/pages/SearchPage/SearchControls/TimeRangeInput/index.tsx (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{cpp,hpp,java,js,jsx,tpp,ts,tsx}

⚙️ CodeRabbit Configuration File

  • Prefer false == <expression> rather than !<expression>.

Files:

  • components/webui/client/src/pages/SearchPage/SearchControls/TimeRangeInput/index.tsx
🧠 Learnings (2)
📓 Common learnings
Learnt from: haiqi96
PR: y-scope/clp#0
File: :0-0
Timestamp: 2025-07-29T14:04:13.769Z
Learning: User haiqi96 requested creating a GitHub issue to document a bug fix from PR #1136, which addressed MySQL compatibility issues with invalid SQL CAST operations in the WebUI component.
Learnt from: junhaoliao
PR: y-scope/clp#937
File: components/log-viewer-webui/client/src/AntdApp.tsx:16-24
Timestamp: 2025-05-29T20:33:40.653Z
Learning: In components/log-viewer-webui React codebase: Return type annotations (like `: JSX.Element`) are unnecessary and not preferred for React components in JSX/TSX files.
📚 Learning: in components/log-viewer-webui react codebase: return type annotations (like `: jsx.element`) are un...
Learnt from: junhaoliao
PR: y-scope/clp#937
File: components/log-viewer-webui/client/src/AntdApp.tsx:16-24
Timestamp: 2025-05-29T20:33:40.653Z
Learning: In components/log-viewer-webui React codebase: Return type annotations (like `: JSX.Element`) are unnecessary and not preferred for React components in JSX/TSX files.

Applied to files:

  • components/webui/client/src/pages/SearchPage/SearchControls/TimeRangeInput/index.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: lint-check (ubuntu-24.04)
🔇 Additional comments (2)
components/webui/client/src/pages/SearchPage/SearchControls/TimeRangeInput/index.module.css (1)

14-14: LGTM - UI width improvement.

The increased minimum width from 200px to 400px provides better accommodation for the date range picker UI, especially when displaying custom time ranges with both dates and times.

components/webui/client/src/pages/SearchPage/SearchControls/TimeRangeInput/index.tsx (1)

82-84: LGTM - Improved keyboard input behavior.

Switching from onChange to onCalendarChange provides immediate feedback when users type custom date ranges, improving the user experience as described in the PR objectives. The handler logic remains unchanged and includes proper validation.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@hoophalab hoophalab changed the title fix(webui): Replace DatePicker onChange callback; Increase minimum width. fix(webui): Replace DatePicker's onChange callback; Increase minimum width. Aug 6, 2025
@hoophalab hoophalab changed the title fix(webui): Replace DatePicker's onChange callback; Increase minimum width. fix(webui): Replace DatePicker's onChange callback. Aug 6, 2025

@davemarco davemarco left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

title

fix(webui): Modify DatePicker callback to update time range on any change to prevent query submission with previous time range.

@hoophalab hoophalab changed the title fix(webui): Replace DatePicker's onChange callback. fix(webui): Modify DatePicker callback to update time range on any change to prevent query submission with previous time range. Aug 7, 2025

@kirkrodrigues kirkrodrigues left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Deferring to @davemarco's review.

@hoophalab hoophalab merged commit 0cb8aba into y-scope:main Aug 7, 2025
7 checks passed
@hoophalab hoophalab deleted the enter-fix branch August 14, 2025 22:04
junhaoliao pushed a commit to junhaoliao/clp that referenced this pull request May 17, 2026
…change to prevent query submission with previous time range. (y-scope#1171)
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.

3 participants