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

Timelist centering algorithm change and duration formatting change #7194

Merged
merged 25 commits into from
Jan 8, 2024

Conversation

shefalijoshi
Copy link
Contributor

@shefalijoshi shefalijoshi commented Nov 1, 2023

Closes #7130 #7161 #7167

Describe your changes:

Change the centering algorithm for timelist activities, prioritizing current and future activities and optimizing (with no scrolling) when there are no past activities.
Make duration formatting better for timelist activities

All Submissions:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • Is this change backwards compatible? For example, developers won't need to change how they are calling the API or how they've extended core plugins such as Tables or Plots.

Author Checklist

  • Changes address original issue?
  • Tests included and/or updated with changes?
  • Command line build passes?
  • Has this been smoke tested?
  • Testing instructions included in associated issue OR is this a dependency/testcase change?

Reviewer Checklist

  • Changes appear to address issue?
  • Reviewer has tested changes by following the provided instructions?
  • Changes appear not to be breaking changes?
  • Appropriate automated tests included?
  • Code style and in-line documentation are appropriate?
  • Has associated issue been labelled unverified? (only applicable if this PR closes the issue)
  • Has associated issue been labelled bug? (only applicable if this PR is for a bug fix)

Make duration formatting better
Copy link

deploysentinel bot commented Nov 1, 2023

Current Playwright Test Results Summary

✅ 15 Passing - ⚠️ 1 Flaky

Run may still be in progress, this comment will be updated as current testing workflow or job completes...

(Last updated on 01/08/2024 11:14:17pm UTC)

Run Details

Running Workflow e2e-couchdb on Github Actions

Commit: c9000cf

Started: 01/08/2024 11:12:18pm UTC

⚠️ Flakes

📄   functional/plugins/notebook/notebookWithCouchDB.e2e.spec.js • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Notebook Tests with CouchDB @couchdb Inspect Notebook Entry Network Requests
Retry 1Initial Attempt
2.94% (1) 1 / 34 run
failed over last 7 days
8.82% (3) 3 / 34 runs
flaked over last 7 days

View Detailed Build Results


Current Playwright Test Results Summary

✅ 175 Passing - ⚠️ 2 Flaky

Run may still be in progress, this comment will be updated as current testing workflow or job completes...

(Last updated on 01/08/2024 11:14:17pm UTC)

Run Details

Running Job e2e-stable on CircleCI

Commit: c9000cf

Started: 01/08/2024 09:40:23pm UTC

⚠️ Flakes

📄   functional/plugins/tabs/tabs.e2e.spec.js • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Tabs View Renders tabbed elements
Retry 1Initial Attempt
3.08% (2) 2 / 65 runs
failed over last 7 days
33.85% (22) 22 / 65 runs
flaked over last 7 days

📄   functional/plugins/flexibleLayout/flexibleLayout.e2e.spec.js • 1 Flake

Test Case Results

Test Case Last 7 days Failures Last 7 days Flakes
Flexible Layout Toolbar Actions @localStorage Add/Remove Container
Retry 1Initial Attempt
0% (0) 0 / 59 runs
failed over last 7 days
1.69% (1) 1 / 59 run
flaked over last 7 days

View Detailed Build Results


Copy link
Contributor

@charlesh88 charlesh88 left a comment

Choose a reason for hiding this comment

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

Everything is good for the duration formatting change, and the list works well as a standalone. The only problem I see is a regression when past events are in view and the user tries to scroll the view: previously, the user was able to scroll the view, leave the thumb at a desired position, and after a timeout the view would scroll back to bring current events into view. Now, the view fights the user for control of the scroll and tries to immediately reset the scroll. This regression should be fixed.

Time.List.7194.scroll.problem.mp4

Copy link

codecov bot commented Nov 7, 2023

Codecov Report

Attention: 19 lines in your changes are missing coverage. Please review.

Comparison is base (64d4ddd) 55.88% compared to head (c9000cf) 55.87%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7194      +/-   ##
==========================================
- Coverage   55.88%   55.87%   -0.02%     
==========================================
  Files         657      657              
  Lines       26180    26198      +18     
  Branches     2546     2548       +2     
==========================================
+ Hits        14632    14637       +5     
- Misses      10842    10855      +13     
  Partials      706      706              
Flag Coverage Δ *Carryforward flag
e2e-full 40.81% <ø> (+<0.01%) ⬆️ Carriedforward from 64d4ddd
e2e-stable 59.09% <100.00%> (+0.01%) ⬆️
unit 48.86% <60.78%> (-0.02%) ⬇️

*This pull request uses carry forward flags. Click here to find out more.

Files Coverage Δ
src/utils/duration.js 100.00% <100.00%> (ø)
src/plugins/timelist/TimelistComponent.vue 55.82% <54.76%> (-2.85%) ⬇️

... and 8 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 64d4ddd...c9000cf. Read the comment docs.

const START_TIME_COLUMN = 0;
const END_TIME_COLUMN = 1;
const TIME_TO_FROM_COLUMN = 2;
const ACTIVITY_COLUMN = 3;

Check notice

Code scanning / CodeQL

Unused variable, import, function or class

Unused variable ACTIVITY_COLUMN.
"textColor": "white"
},
{
"name": "Time since last accident",
Copy link
Contributor

Choose a reason for hiding this comment

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

lol

Copy link
Contributor

@unlikelyzero unlikelyzero left a comment

Choose a reason for hiding this comment

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

Masterclass.

I just have some small function name changes to help others discover as well as a flakiness question

const examplePlanSmall3 = require('../../../test-data/examplePlans/ExamplePlan_Small3.json');

// eslint-disable-next-line no-unused-vars
const START_TIME_COLUMN = 0;

Check notice

Code scanning / CodeQL

Unused variable, import, function or class

Unused variable START_TIME_COLUMN.
// eslint-disable-next-line no-unused-vars
const START_TIME_COLUMN = 0;
// eslint-disable-next-line no-unused-vars
const END_TIME_COLUMN = 1;

Check notice

Code scanning / CodeQL

Unused variable, import, function or class

Unused variable END_TIME_COLUMN.
Copy link
Contributor

@ozyx ozyx left a comment

Choose a reason for hiding this comment

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

Looking good so far! A I've left a few suggestions

let currentActivitiesCount = 0;
let pastActivitiesCount = 0;
let futureActivitiesCount = 0;
const styledActivities = activities.map((activity, index) => {
if (this.timestamp >= activity.start && this.timestamp <= activity.end) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's extract this condition to a boolean returning function for readability

@shefalijoshi
Copy link
Contributor Author

Everything is good for the duration formatting change, and the list works well as a standalone. The only problem I see is a regression when past events are in view and the user tries to scroll the view: previously, the user was able to scroll the view, leave the thumb at a desired position, and after a timeout the view would scroll back to bring current events into view. Now, the view fights the user for control of the scroll and tries to immediately reset the scroll. This regression should be fixed.
Time.List.7194.scroll.problem.mp4

Fixed this. Thanks for finding it!

@shefalijoshi shefalijoshi added the pr:e2e:couchdb npm run test:e2e:couchdb label Dec 11, 2023
@github-actions github-actions bot removed the pr:e2e:couchdb npm run test:e2e:couchdb label Dec 11, 2023
@akhenry
Copy link
Contributor

akhenry commented Dec 11, 2023

@shefalijoshi to fix failing tests. Thank you!

Copy link
Contributor

@ozyx ozyx left a comment

Choose a reason for hiding this comment

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

Caught a bad merge

Comment on lines 25 to 26
const { getEarliestStartTime } = require('../../../helper/planningUtils');
const examplePlanSmall3 = require('../../../test-data/examplePlans/ExamplePlan_Small3.json');
Copy link
Contributor

Choose a reason for hiding this comment

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

We're all ESM now, so we need to update these imports:

Suggested change
const { getEarliestStartTime } = require('../../../helper/planningUtils');
const examplePlanSmall3 = require('../../../test-data/examplePlans/ExamplePlan_Small3.json');
import { getEarliestStartTime } from '../../../helper/planningUtils.js';
const examplePlanSmall = JSON.parse(
fs.readFileSync(new URL('../../test-data/examplePlans/ExamplePlan_Small3.json', import.meta.url))
);

import { expect, test } from '../../../pluginFixtures.js';
import examplePlanSmall3 from '../../../test-data/examplePlans/ExamplePlan_Small3.json';
Copy link
Contributor

@ozyx ozyx Jan 3, 2024

Choose a reason for hiding this comment

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

Need to update this to be ESM style and path agnostic (as we do everywhere else)

Suggested change
import examplePlanSmall3 from '../../../test-data/examplePlans/ExamplePlan_Small3.json';
const examplePlanSmall3 = JSON.parse(
fs.readFileSync(new URL('../../test-data/examplePlans/ExamplePlan_Small3.json', import.meta.url))
);

@shefalijoshi shefalijoshi added the pr:e2e:couchdb npm run test:e2e:couchdb label Jan 4, 2024
@shefalijoshi shefalijoshi requested a review from ozyx January 4, 2024 05:18
@github-actions github-actions bot removed the pr:e2e:couchdb npm run test:e2e:couchdb label Jan 4, 2024
@ozyx ozyx added the pr:e2e:couchdb npm run test:e2e:couchdb label Jan 8, 2024
@github-actions github-actions bot removed the pr:e2e:couchdb npm run test:e2e:couchdb label Jan 8, 2024
@shefalijoshi shefalijoshi merged commit 67a1094 into master Jan 8, 2024
@shefalijoshi shefalijoshi deleted the timelist-7130-7161 branch January 8, 2024 23:14
@unlikelyzero unlikelyzero added this to the Target:4.0.0 milestone Jan 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Time List view] Better format for To/From "Days Hours" timestamp
5 participants