Skip to content
This repository has been archived by the owner on Apr 18, 2024. It is now read-only.

fix: LSDV-4600: Lead time for TextArea #1214

Merged
merged 36 commits into from
Aug 14, 2023
Merged

fix: LSDV-4600: Lead time for TextArea #1214

merged 36 commits into from
Aug 14, 2023

Conversation

juliosgarbi
Copy link
Contributor

@juliosgarbi juliosgarbi commented Feb 24, 2023

PR fulfills these requirements

  • Commit message(s) and PR title follows the format [fix|feat|ci|chore|doc]: TICKET-ID: Short description of change made ex. fix: DEV-XXXX: Removed inconsistent code usage causing intermittent errors
  • Tests for the changes have been added/updated (for bug fixes/features)
  • Docs have been added/updated (for bug fixes/features)
  • Best efforts were made to ensure docs/code are concise and coherent (checked for spelling/grammatical errors, commented out code, debug logs etc.)
  • Self-reviewed and ran all changes on a local instance (for bug fixes/features)

Change has impacts in these area(s)

  • Product design
  • Frontend

Describe the reason for change

Annotation results now have a "lead_time"value in export data for textareas. The value reflects how much time the annotator spent typing values in this TextArea. Lead Time is calculated with minimal interaction time 0.5s and with debounce of the same 0.5s, for example:

  • slow typer, one letter per second, 10 letters: 10*0.5s = 5s lead time
  • fast typer, all 10 letters in 2s: 2+0.5s debounce = 2.5s

What does this fix?

This solves a time tracking problem so that typing time of annotators can be calculated.

What libraries were added/updated?

N/A

Does this change affect performance?

no

Does this change affect security?

no

What alternative approaches were there?

N/A

What feature flags were used to cover this change?

fflag_fix_front_lsdv_4600_lead_time_27072023_short

Does this PR introduce a breaking change?

(check only one)

  • Yes, and covered entirely by feature flag(s)
  • Yes, and covered partially by feature flag(s)
  • No
  • Not sure (briefly explain the situation below)

What level of testing was included in the change?

  • e2e
  • integration
  • unit

Which logical domain(s) does this change affect?

Textarea, Lead Time

src/mixins/LeadTime.js Outdated Show resolved Hide resolved
src/mixins/LeadTime.js Outdated Show resolved Hide resolved
Copy link
Collaborator

@hlomzik hlomzik left a comment

Choose a reason for hiding this comment

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

It's all good, but little comments+fix would be nice, and the main thing — Lead Time should be described in a PR and in mixin, as this is the first ever appearance of this calculations in the code.

src/tags/control/TextArea/TextArea.js Outdated Show resolved Hide resolved
}))
.actions(self => ({
internalCountTime(callTime) {
const now = +Date.now();
Copy link
Member

Choose a reason for hiding this comment

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

Date.now() returns a number, you don't need to convert it to number

Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
const now = +Date.now();
const now = Date.now();

- TypeScript!
- no debounce, it's detected during calculations
- two different approaches on how to count trailing events
- schema with explanations
- simpler usage
lead_time was not added up because of typo
Information in tags can be easily destroyed,
the only source of truth is results/regions, so store data there.
Remove useless metaValue — all data in results and this meta were
overrided by meta from result
Add check for flag enabled
@hlomzik
Copy link
Collaborator

hlomzik commented Aug 8, 2023

/git merge master

Successfully pushed new changes:
Merge remote-tracking branch 'origin/master' into fb-lsdv-4600 (26cab6e)

Workflow run

@hlomzik hlomzik enabled auto-merge (squash) August 14, 2023 13:22
@hlomzik hlomzik disabled auto-merge August 14, 2023 14:53
@codecov-commenter
Copy link

codecov-commenter commented Aug 14, 2023

Codecov Report

Patch coverage: 82.62% and project coverage change: +0.01% 🎉

Comparison is base (8139d7b) 68.15% compared to head (d76bd9c) 68.16%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1214      +/-   ##
==========================================
+ Coverage   68.15%   68.16%   +0.01%     
==========================================
  Files         439      441       +2     
  Lines       28086    28144      +58     
  Branches     7435     7455      +20     
==========================================
+ Hits        19141    19185      +44     
- Misses       7729     7740      +11     
- Partials     1216     1219       +3     
Files Changed Coverage Δ
src/components/Entity/Entity.js 68.75% <0.00%> (ø)
src/env/development.js 0.00% <0.00%> (ø)
src/regions/Area.js 100.00% <ø> (ø)
src/mixins/LeadTime.ts 60.00% <60.00%> (ø)
src/mixins/Normalization.ts 80.00% <60.00%> (ø)
src/tags/control/TextArea/TextAreaRegionView.js 86.56% <86.56%> (ø)
...mponents/SidePanels/DetailsPanel/RegionDetails.tsx 100.00% <100.00%> (ø)
...mponents/SidePanels/OutlinerPanel/ViewControls.tsx 97.26% <100.00%> (ø)
src/regions/Result.js 82.06% <100.00%> (+0.64%) ⬆️
src/regions/TextAreaRegion.js 81.48% <100.00%> (+1.08%) ⬆️
... and 2 more

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

@hlomzik hlomzik marked this pull request as draft August 14, 2023 15:03
@hlomzik hlomzik marked this pull request as ready for review August 14, 2023 15:03
@hlomzik hlomzik merged commit 74fbeb2 into master Aug 14, 2023
24 of 27 checks passed
@hlomzik hlomzik deleted the fb-lsdv-4600 branch August 14, 2023 19:08
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants