Skip to content

Chore: change query log time range - #28052

Merged
iamjoel merged 14 commits into
mainfrom
chore/change-query-log-time-range
Nov 10, 2025
Merged

iamjoel merged 14 commits into
mainfrom
chore/change-query-log-time-range

Conversation

@iamjoel

@iamjoel iamjoel commented Nov 10, 2025

Copy link
Copy Markdown
Contributor

Summary

change query log time range and ui.

Checklist

  • This change requires a documentation update, included: Dify Document
  • I understand that this PR may be closed in case there was no previous discussion or issues. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.
  • I ran dev/reformat(backend) and cd web && npx lint-staged(frontend) to appease the lint gods

Copilot AI review requested due to automatic review settings November 10, 2025 10:09
@dosubot dosubot Bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Nov 10, 2025
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @iamjoel, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request refactors the time range selection mechanism within the application's overview charts. The primary goal is to provide users with more flexible and intuitive options for filtering data by time, including both predefined periods and custom date ranges, thereby improving the overall user experience for data analysis.

Highlights

  • New Time Range Picker Component: Introduced a new TimeRangePicker component to enhance the selection of time periods for overview charts, replacing the previous simple select dropdown.
  • Custom Date Range Selection: The new time range picker includes a DatePicker sub-component that allows users to select custom start and end dates, with a constraint of a 30-day maximum range.
  • Date Picker Enhancements: The base DatePicker component has been updated to support disabling specific dates and to allow for direct date selection without requiring an explicit confirmation button.
  • Internationalization Updates: Added new translation keys for 'last 30 days' and 'custom' time periods across English, Japanese, and Simplified Chinese locales.
  • Utility and Icon Additions: A new utility function formatToLocalTime for localized date formatting and an 'HourglassShape' icon have been added to the codebase.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request introduces a new, more flexible time range picker component and integrates it into the app overview page. The changes are well-structured, breaking down the new functionality into smaller, reusable components. I've identified a critical issue with a useCallback hook that could lead to stale state and incorrect behavior. Additionally, there are several instances where dayjs() is called at the module level, which can result in stale date values. I've also included some suggestions to improve code readability and performance. With these fixes, this will be a solid improvement.

zxhlyh
zxhlyh previously approved these changes Nov 10, 2025
@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Nov 10, 2025

Copilot AI 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.

Pull Request Overview

This PR adds a custom time range picker component with locale-aware date formatting for the app overview page. The implementation includes a new date range selection interface with presets (Today, Last 7 Days, Last 30 Days) and custom date pickers.

Key Changes

  • Added formatToLocalTime utility function to support localized date formatting with dayjs
  • Enhanced date picker component with optional confirmation mode (noConfirm) and date validation (getIsDateDisabled)
  • Implemented new TimeRangePicker component with preset ranges and custom date selection
  • Updated select component to pass open state to custom trigger renderers

Reviewed Changes

Copilot reviewed 17 out of 18 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
web/utils/format.ts Added locale mapping and formatToLocalTime utility function for internationalized date display
web/i18n/*/app-log.ts Added translations for "Last 30 Days" and "Custom" period options
web/app/components/base/select/index.tsx Updated renderTrigger to receive open state for dynamic styling
web/app/components/base/icons/* Added new HourglassShape icon for time range separator
web/app/components/base/date-and-time-picker/* Enhanced date picker with no-confirm mode and date disabling capability
web/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/time-range-picker/* New time range picker components implementing preset and custom date selection
web/app/(commonLayout)/app/(appDetailLayout)/[appId]/overview/chart-view.tsx Replaced inline time period logic with new TimeRangePicker component
web/app/components/app/overview/app-chart.tsx Minor formatting cleanup in tooltip template

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread web/utils/format.ts Resolved
iamjoel and others added 2 commits November 10, 2025 18:30
….tsx

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
…time-range-picker/index.tsx

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

Copilot AI 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.

Pull Request Overview

Copilot reviewed 17 out of 18 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@iamjoel
iamjoel merged commit 2c62a77 into main Nov 10, 2025
@iamjoel
iamjoel deleted the chore/change-query-log-time-range branch November 10, 2025 10:39
frf12 pushed a commit to oceanbase/dify-on-mysql that referenced this pull request Nov 11, 2025
* test: adding some web tests (langgenius#27792)

* feat: add validation to prevent saving empty opening statement in conversation opener modal (langgenius#27843)

* fix(web): improve the consistency of the inputs-form UI (langgenius#27837)

* fix(web): increase z-index of PortalToFollowElemContent (langgenius#27823)

* fix: installation_id is missing when in tools page (langgenius#27849)

* fix: avoid passing empty uniqueIdentifier to InstallFromMarketplace (langgenius#27802)

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* test: create new test scripts and update some existing test scripts o… (langgenius#27850)

* feat: change feedback to forum (langgenius#27862)

* chore: translate i18n files and update type definitions (langgenius#27868)

Co-authored-by: crazywoola <100913391+crazywoola@users.noreply.github.com>

* Fix/template transformer line number (langgenius#27867)

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: crazywoola <100913391+crazywoola@users.noreply.github.com>

* bump vite to 6.4.1 (langgenius#27877)

* Add WEAVIATE_GRPC_ENDPOINT as designed in weaviate migration guide (langgenius#27861)

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>

* Fix: correct DraftWorkflowApi.post response model (langgenius#27289)

Signed-off-by: Yongtao Huang <yongtaoh2022@gmail.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>

* fix Version 2.0.0-beta.2: Chat annotations Api Error langgenius#25506  (langgenius#27206)

Co-authored-by: crazywoola <100913391+crazywoola@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: Asuka Minato <i@asukaminato.eu.org>

* fix jina reader creadential migration command (langgenius#27883)

* fix agent putout the output of workflow-tool twice (langgenius#26835) (langgenius#27087)

* fix jina reader transform (langgenius#27922)

* fix: prevent fetch version info in enterprise edition (langgenius#27923)

* fix(api): fix `VariablePool.get` adding unexpected keys to variable_dictionary (langgenius#26767)

Co-authored-by: -LAN- <laipz8200@outlook.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* refactor: implement tenant self queue for rag tasks (langgenius#27559)

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: -LAN- <laipz8200@outlook.com>

* fix: bump brotli to 1.2.0 resloved CVE-2025-6176 (langgenius#27950)

Signed-off-by: kenwoodjw <blackxin55+@gmail.com>

* docs: clarify how to obtain workflow_id for version execution (langgenius#28007)

Signed-off-by: OneZero-Y <aukovyps@163.com>

* fix: fix langgenius#27939 (langgenius#27985)

* fix:  the model list encountered two children with the same key (langgenius#27956)

Co-authored-by: haokai <haokai@shuwen.com>

* add onupdate=func.current_timestamp() (langgenius#28014)

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* chore(deps): bump scipy-stubs from 1.16.2.3 to 1.16.3.0 in /api (langgenius#28025)

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Fix typo in weaviate comment, improve time test precision, and add security tests for get-icon utility (langgenius#27919)

Signed-off-by: NeatGuyCoding <15627489+NeatGuyCoding@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* feat: Add Audio Content Support for MCP Tools (langgenius#27979)

* fix: elasticsearch_vector version (langgenius#28028)

Co-authored-by: huangzhuo <huangzhuo1@xiaomi.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: crazywoola <100913391+crazywoola@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

* fix workflow default updated_at (langgenius#28047)

* feat(api): Introduce Broadcast Channel (langgenius#27835)

This PR introduces a `BroadcastChannel` abstraction with broadcasting and at-most once delivery semantics, serving as the communication component between celery worker and API server.

It also includes a reference implementation backed by Redis PubSub.

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>

* Chore: change query log time range (langgenius#28052)

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* tmp ci

* fix

* chore: Remove trailing space from migration filename (langgenius#28040)

* chore: translate i18n files and update type definitions (langgenius#28054)

Co-authored-by: iamjoel <2120155+iamjoel@users.noreply.github.com>

* tmp ci

* fix

---------

Signed-off-by: Yongtao Huang <yongtaoh2022@gmail.com>
Signed-off-by: kenwoodjw <blackxin55+@gmail.com>
Signed-off-by: OneZero-Y <aukovyps@163.com>
Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: NeatGuyCoding <15627489+NeatGuyCoding@users.noreply.github.com>
Co-authored-by: aka James4u <smart.jamesjin@gmail.com>
Co-authored-by: Novice <novice12185727@gmail.com>
Co-authored-by: yangzheli <43645580+yangzheli@users.noreply.github.com>
Co-authored-by: Elliott <105957288+Elliott-byte@users.noreply.github.com>
Co-authored-by: crazywoola <100913391+crazywoola@users.noreply.github.com>
Co-authored-by: johnny0120 <johnny0120@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: Gritty_dev <101377478+codomposer@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: wangjifeng <163279492+kk-wangjifeng@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Boris Polonsky <BorisPolonsky@users.noreply.github.com>
Co-authored-by: Yongtao Huang <yongtaoh2022@gmail.com>
Co-authored-by: Cursx <33718736+Cursx@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Asuka Minato <i@asukaminato.eu.org>
Co-authored-by: Jyong <76649700+JohnJyong@users.noreply.github.com>
Co-authored-by: red_sun <56100962+redSun64@users.noreply.github.com>
Co-authored-by: NFish <douxc512@gmail.com>
Co-authored-by: QuantumGhost <obelisk.reg+git@gmail.com>
Co-authored-by: -LAN- <laipz8200@outlook.com>
Co-authored-by: hj24 <huangjian@dify.ai>
Co-authored-by: kenwoodjw <blackxin55+@gmail.com>
Co-authored-by: OneZero-Y <aukovyps@163.com>
Co-authored-by: wangxiaolei <fatelei@gmail.com>
Co-authored-by: Kenn <kennfalcon@gmail.com>
Co-authored-by: haokai <haokai@shuwen.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: NeatGuyCoding <15627489+NeatGuyCoding@users.noreply.github.com>
Co-authored-by: Will <vvfriday@gmail.com>
Co-authored-by: huangzhuo1949 <167434202+huangzhuo1949@users.noreply.github.com>
Co-authored-by: huangzhuo <huangzhuo1@xiaomi.com>
Co-authored-by: Joel <iamjoel007@gmail.com>
Co-authored-by: iamjoel <2120155+iamjoel@users.noreply.github.com>
Xiu-Lan pushed a commit to AICT-Team/dify that referenced this pull request Nov 13, 2025
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
CodingOnStar pushed a commit that referenced this pull request Nov 14, 2025
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Ssazurov pushed a commit to Ssazurov/dify that referenced this pull request Aug 8, 2026
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants