Skip to content

Commit 26328a1

Browse files
authored
refactor: OPTIC-921: Remove Stale Feature Flag - fflag_feat_front_dev_4081_magic_wand_tool (#6701)
1 parent 6a6b8cf commit 26328a1

File tree

14 files changed

+10
-33
lines changed

14 files changed

+10
-33
lines changed

label_studio/core/feature_flags/stale_feature_flags.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
'fflag_feat_front_lsdv_4659_skipduplicates_060323_short': True,
2727
'fflag_fix_font_lsdv_1148_hotkeys_namespaces_01022023_short': True,
2828
'fflag_fix_back_lsdv_1044_check_annotations_24012023_short': False,
29-
'fflag_feat_front_dev_4081_magic_wand_tool': True,
3029
'fflag_fix_front_dev_4075_taxonomy_overlap_281222_short': True,
3130
'fflag_fix_front_dev_3730_shortcuts_initial_input_22122022_short': True,
3231
'ff_back_dev_3865_filters_anno_171222_short': True,

web/libs/editor/examples/image_magic_wand/START.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,5 @@ Note that in the gcp_cors_config.json example given in this directory that we ha
4040
Magic Wand for image segmentation:
4141

4242
```bash
43-
fflag_feat_front_dev_4081_magic_wand_tool=1 python server.py -c config.json -l ../examples/image_magic_wand/config.xml -i ../examples/image_magic_wand/tasks.json -o output
43+
python server.py -c config.json -l ../examples/image_magic_wand/config.xml -i ../examples/image_magic_wand/tasks.json -o output
4444
```

web/libs/editor/src/components/ImageView/ImageView.jsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import {
2525
FF_DEV_1442,
2626
FF_DEV_3077,
2727
FF_DEV_3793,
28-
FF_DEV_4081,
2928
FF_LSDV_4583_6,
3029
FF_LSDV_4711,
3130
FF_LSDV_4930,
@@ -451,15 +450,15 @@ const Crosshair = memo(
451450
* of the image to support Magic Wand tool
452451
*/
453452
const CanvasOverlay = observer(({ item }) => {
454-
return isFF(FF_DEV_4081) ? (
453+
return (
455454
<canvas
456455
className={styles.overlay}
457456
ref={(ref) => {
458457
item.setOverlayRef(ref);
459458
}}
460459
style={item.imageTransform}
461460
/>
462-
) : null;
461+
);
463462
});
464463

465464
export default observer(

web/libs/editor/src/core/feature-flags/flags.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
"fflag_fix_front_dev_3391_interactive_view_all": false,
66
"fflag_fix_front_dev_3617_taxonomy_memory_leaks_fix": true,
77
"fflag_feat_front_dev_3873_labeling_ui_improvements_short": true,
8-
"fflag_feat_front_dev_4081_magic_wand_tool": true,
98
"fflag_feat_front_lsdv_4620_richtext_opimization_060423_short": true,
109
"fflag_fix_front_lsdv_4620_memory_leaks_100723_short": false
1110
}

web/libs/editor/src/examples/image_magic_wand/START.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,5 @@ Note that in the gcp_cors_config.json example given in this directory that we ha
4040
Magic Wand for image segmentation:
4141

4242
```bash
43-
fflag_feat_front_dev_4081_magic_wand_tool=1 python server.py -c config.json -l ../examples/image_magic_wand/config.xml -i ../examples/image_magic_wand/tasks.json -o output
43+
python server.py -c config.json -l ../examples/image_magic_wand/config.xml -i ../examples/image_magic_wand/tasks.json -o output
4444
```

web/libs/editor/src/regions/BrushRegion.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import IsReadyMixin from "../mixins/IsReadyMixin";
1818
import { KonvaRegionMixin } from "../mixins/KonvaRegion";
1919
import { ImageModel } from "../tags/object/Image";
2020
import { colorToRGBAArray, rgbArrayToHex } from "../utils/colors";
21-
import { FF_DEV_3793, FF_DEV_4081, FF_ZOOM_OPTIM, isFF } from "../utils/feature-flags";
21+
import { FF_DEV_3793, FF_ZOOM_OPTIM, isFF } from "../utils/feature-flags";
2222
import { AliveRegion } from "./AliveRegion";
2323
import { RegionWrapper } from "./RegionWrapper";
2424

@@ -523,7 +523,7 @@ const HtxBrushView = ({ item, setShapeRef }) => {
523523

524524
let img;
525525

526-
if (item.maskDataURL && isFF(FF_DEV_4081)) {
526+
if (item.maskDataURL) {
527527
img = await Canvas.maskDataURL2Image(item.maskDataURL, { color: item.strokeColor });
528528
} else if (item.rle) {
529529
img = Canvas.RLE2Region(item, { color: item.strokeColor });

web/libs/editor/src/tags/control/MagicWand.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import { customTypes } from "../../core/CustomTypes";
66
import { AnnotationMixin } from "../../mixins/AnnotationMixin";
77
import SeparatedControlMixin from "../../mixins/SeparatedControlMixin";
88
import { ToolManagerMixin } from "../../mixins/ToolManagerMixin";
9-
import { FF_DEV_4081, isFF } from "../../utils/feature-flags";
109

1110
/**
1211
* The `Magicwand` tag makes it possible to click in a region of an image a user is doing segmentation
@@ -125,6 +124,6 @@ const HtxView = () => {
125124
return null;
126125
};
127126

128-
isFF(FF_DEV_4081) && Registry.addTag("magicwand", MagicWandModel, HtxView);
127+
Registry.addTag("magicwand", MagicWandModel, HtxView);
129128

130129
export { HtxView, MagicWandModel };

web/libs/editor/src/tags/object/Image/Image.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import {
1818
FF_DEV_3377,
1919
FF_DEV_3666,
2020
FF_DEV_3793,
21-
FF_DEV_4081,
2221
FF_LSDV_4583,
2322
FF_LSDV_4583_6,
2423
FF_LSDV_4711,
@@ -292,9 +291,6 @@ const Model = types
292291

293292
if (isFF(FF_LSDV_4711) && (!value || value === "none")) return "anonymous";
294293

295-
if (!isFF(FF_DEV_4081)) {
296-
return null;
297-
}
298294
if (!value || value === "none") {
299295
return null;
300296
}

web/libs/editor/src/tools/Brush.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { DrawingTool } from "../mixins/DrawingTool";
99
import { Tool } from "../components/Toolbar/Tool";
1010
import { Range } from "../common/Range/Range";
1111
import { NodeViews } from "../components/Node/Node";
12-
import { FF_DEV_3666, FF_DEV_4081, isFF } from "../utils/feature-flags";
12+
import { FF_DEV_3666, isFF } from "../utils/feature-flags";
1313

1414
const MIN_SIZE = 1;
1515
const MAX_SIZE = 50;
@@ -54,7 +54,7 @@ const _Tool = types
5454
group: "segmentation",
5555
shortcut: "B",
5656
smart: true,
57-
unselectRegionOnToolChange: !isFF(FF_DEV_4081),
57+
unselectRegionOnToolChange: false,
5858
})
5959
.volatile(() => ({
6060
canInteractWithRegions: false,

web/libs/editor/src/tools/Manager.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { destroy } from "mobx-state-tree";
22
import { guidGenerator } from "../utils/unique";
3-
import { FF_DEV_4081, isFF } from "../utils/feature-flags";
43

54
/** @type {Map<any, ToolsManager>} */
65
const INSTANCES = new Map();
@@ -56,7 +55,7 @@ class ToolsManager {
5655
const name = tool.toolName ?? toolName;
5756
const key = `${prefix ?? this._prefix}#${name}`;
5857

59-
if (isFF(FF_DEV_4081) && removeDuplicatesNamed && toolName === removeDuplicatesNamed) {
58+
if (removeDuplicatesNamed && toolName === removeDuplicatesNamed) {
6059
const findme = new RegExp(`^.*?#${name}.*$`);
6160

6261
if (Object.keys(this.tools).some((entry) => findme.test(entry))) {

0 commit comments

Comments
 (0)