Skip to content

fix(web): compute log period starts from the current date - #45360

Merged
crazywoola merged 13 commits into
langgenius:mainfrom
JHC56:fix/log-period-start
Nov 3, 2026
Merged

crazywoola merged 13 commits into
langgenius:mainfrom
JHC56:fix/log-period-start

Conversation

@JHC56

@JHC56 JHC56 commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Fixes #45354

Summary

The log period filters stored their day counts once at module load. After the page stayed open past midnight, Month to date, Quarter to date, Year to date, Last 3 months, and Last 12 months started on the wrong date.

  • log/filter.tsx and workflow-log/filter.tsx now compute these day counts when the value is read. The count uses calendar days and rounds the result, so daylight saving changes do not move the start date.
  • The Overview time range picker reads the same mapping. The picker now also reads the current date when a period is selected. Without this change, the picker would mix a fresh day count with the date of page load.
  • I did not add the shared resolver that dosu suggested in the issue. The getters already give index.tsx a fresh day count when the request is built. A resolver would fix nothing more for this issue.

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 verified the change and added or updated tests where meaningful regression risk justifies coverage.
  • I've updated the documentation accordingly.
  • I ran make lint && make type-check (backend) and vp staged (frontend) to appease the lint gods

@github-actions github-actions Bot added size:L This PR changes 100-499 lines, ignoring generated files. web This relates to changes on the web. labels Nov 2, 2026
@codecov

codecov Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.78%. Comparing base (a8631e5) to head (5bb1301).

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #45360   +/-   ##
=======================================
  Coverage   89.77%   89.78%           
=======================================
  Files        6239     6239           
  Lines      390902   390926   +24     
  Branches    79285    79285           
=======================================
+ Hits       350934   350987   +53     
+ Misses      33870    33840   -30     
- Partials     6098     6099    +1     
Flag Coverage Δ
dify-ui 92.39% <ø> (ø)
web 89.77% <100.00%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@JHC56

JHC56 commented Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

@lyzno1 All checks have passed. This PR fixes the Logs period filters when the page stays open past midnight.

The filters counted days only once at page load, so some start dates were wrong the next day. The filters and the Overview picker now use the current date each time.

Could you take a look when you have time?

@crazywoola
crazywoola added this pull request to the merge queue Nov 3, 2026
Merged via the queue into langgenius:main with commit 0efd3c1 Nov 3, 2026
50 checks passed
@laipz8200 laipz8200 mentioned this pull request Nov 3, 2026
1 task done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L This PR changes 100-499 lines, ignoring generated files. web This relates to changes on the web.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Logs "Month to date" filter starts one day late after the page stays open past midnight

2 participants