Skip to content

Commit 354214c

Browse files
hakan458hakan458yyassi-heartex
authored
feat: UTC-349: Show tooltip for tasks over agreement selected threshold (#8710)
Co-authored-by: hakan458 <[email protected]> Co-authored-by: Yousif Yassi <[email protected]>
1 parent d3fd5f2 commit 354214c

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

web/libs/datamanager/src/components/CellViews/AgreementSelected.jsx

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import { useSDK } from "../../providers/SDKProvider";
22
import { isDefined } from "../../utils/utils";
33
import { useState, useEffect } from "react";
4+
import { Tooltip } from "@humansignal/ui";
5+
import { IconInfoOutline } from "@humansignal/icons";
46

57
const LOW_AGREEMENT_SCORE = 33;
68
const MEDIUM_AGREEMENT_SCORE = 66;
@@ -25,11 +27,20 @@ const formatNumber = (num) => {
2527
export const AgreementSelected = (cell) => {
2628
const { value, original: task } = cell;
2729

28-
const score = (
30+
const threshold = window.APP_SETTINGS?.agreement_selected_threshold;
31+
const overThreshold = Number(task?.total_annotations) > Number(threshold);
32+
33+
const content = overThreshold ? (
34+
<Tooltip title={`Agreement (Selected) is not computed for tasks with more than ${threshold} annotations`}>
35+
<span className="inline-flex items-center text-neutral-content-subtler">
36+
<IconInfoOutline />
37+
</span>
38+
</Tooltip>
39+
) : (
2940
<span className={agreementScoreTextColor(value)}>{isDefined(value) ? `${formatNumber(value)}%` : ""}</span>
3041
);
3142

32-
return <div className="flex items-center">{score}</div>;
43+
return <div className="flex items-center">{content}</div>;
3344
};
3445

3546
AgreementSelected.userSelectable = false;

web/libs/editor/tests/e2e/tests/paragraphs-enhanced.test.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,9 @@ Scenario(
119119
assert.deepStrictEqual(result[0].value.paragraphlabels, ["General: Positive1"]);
120120
});
121121
},
122-
);
122+
)
123+
.tag("@flakey")
124+
.retry(3);
123125

124126
Scenario("Select All button is disabled when no label is selected", async ({ I, LabelStudio, AtOutliner }) => {
125127
await retryScenario(async () => {

0 commit comments

Comments
 (0)