Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add quick shift buttons to timeline and autocomplete end date from start #649

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

RTnhN
Copy link

@RTnhN RTnhN commented Mar 1, 2025

This change has two different changes.

  1. On the forum, someone had a suggestion to be able to shift over the date in the timeline view. I also had this problem. It is also nice to have a today button even though you can just click the 24 hour option above the date pickers. The date shift actually works on the start and end dates independently, so you are able to select a two day range in the date pickers and shift that two day range over by a day or a week.

  2. While I was working on this change, I also added a change to resolve Timeline: select only one date selects this date #596. This will fill the end date with the start date if the end date is blank. Worst case, the person will just modify the end date to be the date that they really wanted to select. Best case, they wanted a one day range anyways.

demo.mp4

Important

Add quick shift buttons and auto-fill end date from start in InputTimeInterval.vue.

  • Features:
    • Add quick shift buttons (-1w, -1d, Today, +1d, +1w) in InputTimeInterval.vue for date navigation.
    • Auto-fill end date with start date if end is blank in InputTimeInterval.vue.
  • Functions:
    • Add shiftDay() and setToday() methods for date manipulation in InputTimeInterval.vue.
    • Add watcher on start to auto-fill end date in InputTimeInterval.vue.

This description was created by Ellipsis for a6d6bb9. It will automatically update as commits are pushed.

RTnhN added 2 commits March 1, 2025 13:36
The buttons allow the user to shift the date by a day or
a week. It also adds a today button to quickly go to today.
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Reviewed everything up to a6d6bb9 in 1 minute and 51 seconds

More details
  • Looked at 102 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 9 drafted comments based on config settings.
1. src/components/InputTimeInterval.vue:48
  • Draft comment:
    Consider adding ARIA labels to the shift date buttons for improved accessibility.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50%
    None
2. src/components/InputTimeInterval.vue:114
  • Draft comment:
    The watcher for 'start' sets 'end' automatically if blank. Confirm that this behavior is acceptable for users who might intentionally clear the end date.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50%
    None
3. src/components/InputTimeInterval.vue:200
  • Draft comment:
    In the 'setToday' method, consider storing moment() in a variable to avoid any potential discrepancy between setting 'start' and 'end'.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50%
    None
4. src/components/InputTimeInterval.vue:212
  • Draft comment:
    In 'shiftDay', the use of moment's mutating add() is acceptable here, but consider using clone() if further operations on the original moments are needed in the future.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50%
    None
5. src/components/InputTimeInterval.vue:30
  • Draft comment:
    Nice formatting improvement for the date input fields. Splitting attributes across lines improves readability.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50%
    None
6. src/components/InputTimeInterval.vue:48
  • Draft comment:
    New 'Shift date' row adds quick shift buttons. Consider refactoring common state resets (mode, duration, valueChanged call) in setToday and shiftDay for DRYness.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50%
    None
7. src/components/InputTimeInterval.vue:153
  • Draft comment:
    The watch on 'start' auto-populates 'end' if it is blank, which resolves Timeline: select only one date selects this date #596. Ensure this behavior is as intended when users want to clear the end date.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50%
    None
8. src/components/InputTimeInterval.vue:211
  • Draft comment:
    In the shiftDay method, moment(...).add() mutates the moment object. In this context it's acceptable, but consider using clone() if the original date value might be needed later.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50%
    None
9. src/components/InputTimeInterval.vue:5
  • Draft comment:
    Consider revising the text on line 5: "The second date must be greater or equal to the first date." to "The second date must be greater than or equal to the first date." for enhanced clarity.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.

Workflow ID: wflow_9dja051jCsVDabEU


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link

codecov bot commented Mar 1, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 26.76%. Comparing base (1b9d787) to head (a6d6bb9).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #649   +/-   ##
=======================================
  Coverage   26.76%   26.76%           
=======================================
  Files          28       28           
  Lines        1655     1655           
  Branches      292      292           
=======================================
  Hits          443      443           
  Misses       1155     1155           
  Partials       57       57           

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

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.

Timeline: select only one date selects this date
1 participant