Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions label_studio/core/feature_flags/stale_feature_flags.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,20 @@
'fflag_root_223_optimize_delete_predictions': True,
'fflag_root_212_reduce_importstoragelink_counts': True,
# Jan 8
'fflag_feat_all_dia_2067_tasks_table_component': True, # Removed from code
'fflag_feat_front_dia_1747_projects_list_banner': True, # Removed from code
'fflag_feat_front_leap_1424_grid_preview_short': True, # Removed from code
'ff_front_dev_1536_taxonomy_user_labels_150222_long': True, # Removed from code
'fflag_feat_front_leap_2036_annotations_summary': True, # Removed from code
'fflag_feat_front_leap_1973_adjustable_spans_090425_short': True, # Removed from code
'fflag_feat_front_lsdv_5451_async_taxonomy_110823_short': True, # Removed from code
'fflag_feat_all_lsdv_e_294_llm_annotations_180723_long': True, # Removed from code
'fflag_fix_front_dev_3793_relative_coords_short': True, # Removed from code
'fflag_feat_front_lsdv_4583_6_images_preloading_short': True, # Removed from code
'fflag_feat_all_leap_1821_annotation_limit_short': True,
'fflag_all_feat_dia_1777_ls_homepage_short': True,
'fflag_feat_all_leap_1181_bulk_annotation_short': True,
'fflag_feat_front_lsdv_4583_multi_image_segmentation_short': True,
'fflag_fix_back_plt_914_projects_list_cache_sdk_09102025_short': True,
'fflag_fix_back_plt_913_cache_annotator_queue_total_07102025_short': True,
'fflag_fix_back_plt_913_cache_finished_task_number_06102025_short': True,
Expand Down
10 changes: 0 additions & 10 deletions web/libs/core/src/lib/utils/feature-flags/flags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,6 @@ export const FF_SAMPLE_DATASETS = "fflag_feat_dia_1920_project_creation_sample_d
*/
export const FF_JSON_PREVIEW = "fflag_feat_dia_1925_view_sample_raw_json_short";

/**
* Allow to resize spans in Text tag
*/
export const FF_ADJUSTABLE_SPANS = "fflag_feat_front_leap_1973_adjustable_spans_090425_short";

/**
* Enables the theme toggle in the UI to enable the dark mode
*/
Expand All @@ -69,11 +64,6 @@ export const FF_THEME_TOGGLE = "fflag_feat_front_optic_1217_theme_toggle_short";
*/
export const FF_SYNCED_BUFFERING = "fflag_fix_front_fit_31_synced_media_buffering";

/**
* Enables the summary view for annotations
*/
export const FF_SUMMARY = "fflag_feat_front_leap_2036_annotations_summary";

/**
* Enables enterprise email notifications
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { Checkbox, cnm } from "@humansignal/ui";
import { Space } from "../../Common/Space/Space";
import { getProperty, prepareColumns } from "../../Common/Table/utils";
import * as DataGroups from "../../DataGroups";
import { FF_GRID_PREVIEW, FF_LOPS_E_3, isFF } from "../../../utils/feature-flags";
import { FF_LOPS_E_3, isFF } from "../../../utils/feature-flags";
import { SkeletonLoader } from "../../Common/SkeletonLoader";
import { GridViewContext, GridViewProvider } from "./GridPreview";
import "./GridView.scss";
Expand Down Expand Up @@ -96,7 +96,7 @@ export const GridCell = observer(({ view, selected, row, fields, onClick, column

const handleBodyClick = useCallback(
(e) => {
if (!isFF(FF_GRID_PREVIEW) || !imageField) return;
if (!imageField) return;
e.stopPropagation();
setCurrentTaskId(row.id);
},
Expand Down
3 changes: 0 additions & 3 deletions web/libs/datamanager/src/utils/feature-flags.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ export const FF_LSDV_4620_3_ML = "fflag_fix_front_lsdv_4620_memory_leaks_100723_
*/
export const FF_SELF_SERVE = "fflag_feat_front_leap_482_self_serve_short";

/** Add ability to preview image tasks in Data Manager Grid View */
export const FF_GRID_PREVIEW = "fflag_feat_front_leap_1424_grid_preview_short";

/**
* Allow to filter tasks in Data Manager by control tag labels used in annotation results
* @link https://app.launchdarkly.com/projects/default/flags/fflag_root_13_annotation_results_filtering
Expand Down
3 changes: 1 addition & 2 deletions web/libs/editor/src/components/App/ViewAll.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import clsx from "clsx";
import { ff } from "@humansignal/core";
import { usePersistentState } from "@humansignal/core/lib/hooks/usePersistentState";
import type { MSTAnnotation, MSTStore } from "../../stores/types";
import TaskSummary from "../TaskSummary/TaskSummary";
Expand All @@ -24,7 +23,7 @@ const Tab = ({ title, active, onSelect }: { title: string; active: boolean; onSe
export const ViewAll = ({ store: annotationStore, annotations, root }: Props) => {
const [tab, setTab] = usePersistentState<"summary" | "compare">("view-all-tab", "summary");

if (annotationStore.store.hasInterface("annotations:summary") && ff.isActive(ff.FF_SUMMARY)) {
if (annotationStore.store.hasInterface("annotations:summary")) {
return (
<div>
<div className={styles.tabs}>
Expand Down
52 changes: 15 additions & 37 deletions web/libs/editor/src/components/ImageView/ImageView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import ResizeObserver from "../../utils/resize-observer";
import { debounce } from "../../utils/debounce";
import Constants from "../../core/Constants";
import { fixRectToFit, mapKonvaBrightness } from "../../utils/image";
import { FF_DEV_1442, FF_DEV_3077, FF_LSDV_4583_6, FF_LSDV_4930, FF_ZOOM_OPTIM, isFF } from "../../utils/feature-flags";
import { FF_DEV_1442, FF_LSDV_4930, FF_ZOOM_OPTIM, isFF } from "../../utils/feature-flags";
import { Pagination } from "../../common/Pagination/Pagination";
import { Image } from "./Image";

Expand Down Expand Up @@ -1051,9 +1051,9 @@ export default observer(

if (paginationEnabled) wrapperClasses.push(styles.withPagination);

const [toolsReady, stageLoading] = isFF(FF_LSDV_4583_6) ? [true, false] : [item.hasTools, item.stageWidth <= 1];
const [toolsReady, stageLoading] = [true, false];

const imageIsLoaded = item.imageIsLoaded || !isFF(FF_LSDV_4583_6);
const imageIsLoaded = item.imageIsLoaded;
const isViewingAll = store.annotationStore.viewingAll;

return (
Expand Down Expand Up @@ -1097,40 +1097,18 @@ export default observer(
style={{ width: "100%", marginTop: item.fillerHeight }}
/>

{isFF(FF_LSDV_4583_6) ? (
<Image
ref={(ref) => {
item.setImageRef(ref);
this.imageRef.current = ref;
}}
usedValue={item.usedValue}
imageEntity={item.currentImageEntity}
imageTransform={item.imageTransform}
updateImageSize={item.updateImageSize}
size={item.canvasSize}
overlay={<CanvasOverlay item={item} />}
/>
) : (
<div className={[styles.frame, ...imagePositionClassnames].join(" ")} style={item.canvasSize}>
<img
ref={(ref) => {
item.setImageRef(ref);
this.imageRef.current = ref;
}}
loading={isFF(FF_DEV_3077) && !item.lazyoff ? "lazy" : "false"}
style={item.imageTransform}
src={item.currentSrc}
onLoad={(e) => {
item.updateImageSize(e);
item.currentImageEntity.setImageLoaded(true);
}}
onError={this.handleError}
crossOrigin={item.imageCrossOrigin}
alt="LS"
/>
<CanvasOverlay item={item} />
</div>
)}
<Image
ref={(ref) => {
item.setImageRef(ref);
this.imageRef.current = ref;
}}
usedValue={item.usedValue}
imageEntity={item.currentImageEntity}
imageTransform={item.imageTransform}
updateImageSize={item.updateImageSize}
size={item.canvasSize}
overlay={<CanvasOverlay item={item} />}
/>
{/* @todo this is dirty hack; rewrite to proper async waiting for data to load */}
{stageLoading || !toolsReady ? (
<div className={styles.loading}>
Expand Down
13 changes: 5 additions & 8 deletions web/libs/editor/src/components/TopBar/TopBar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { observer } from "mobx-react";

import { IconViewAll, IconPlus } from "@humansignal/icons";
import { Button } from "@humansignal/ui";
import { ff } from "@humansignal/core";
import { cn } from "../../utils/bem";
import { isSelfServe } from "../../utils/billing";
import { FF_BULK_ANNOTATION, FF_DEV_3873, isFF } from "../../utils/feature-flags";
Expand Down Expand Up @@ -69,13 +68,11 @@ export const TopBar = observer(({ store }) => {
<IconPlus />
</Button>
)}
{(!isViewAll || ff.isActive(ff.FF_SUMMARY)) && (
<AnnotationsCarousel
store={store}
annotationStore={store.annotationStore}
commentStore={store.commentStore}
/>
)}
<AnnotationsCarousel
store={store}
annotationStore={store.annotationStore}
commentStore={store.commentStore}
/>
</div>
) : (
<>
Expand Down
52 changes: 25 additions & 27 deletions web/libs/editor/src/stores/Annotation/Annotation.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import Types from "../../core/Types";
import Area from "../../regions/Area";
import Result from "../../regions/Result";
import Utils from "../../utils";
import { FF_DEV_1284, FF_DEV_3391, FF_LLM_EPIC, FF_LSDV_4583, FF_REVIEWER_FLOW, isFF } from "../../utils/feature-flags";
import { FF_DEV_1284, FF_DEV_3391, FF_LSDV_4583, FF_REVIEWER_FLOW, isFF } from "../../utils/feature-flags";
import { delay, isDefined } from "../../utils/utilities";
import { CommentStore } from "../Comment/CommentStore";
import RegionStore from "../RegionStore";
Expand Down Expand Up @@ -1407,35 +1407,33 @@ const _Annotation = types
const isGlobalClassification = item.classification;

// this piece of code prevents from creating duplicated global classifications
if (isFF(FF_LLM_EPIC)) {
if (isGlobalClassification) {
const itemResult = item.results[0];
const areasIterator = self.areas.values();

for (const area of areasIterator) {
const areaResult = area.results[0];
const isFound =
areaResult.from_name === itemResult.from_name &&
areaResult.to_name === itemResult.to_name &&
areaResult.item_index === itemResult.item_index;

if (isFound) {
itemId = area.id;
break;
}
}
} else {
// @todo: there is a strange behaviour that should be documented somewhere
// On serialization we use area id as result id to save it somewhere
// and on deserialization we use result id as area id
// but when we use suggestions we should keep in mind that we need to do it manually or use serialized data instead
// or we can get weird regions duplication in some cases
const area = self.areas.get(item.cleanId);

if (area) {
if (isGlobalClassification) {
const itemResult = item.results[0];
const areasIterator = self.areas.values();

for (const area of areasIterator) {
const areaResult = area.results[0];
const isFound =
areaResult.from_name === itemResult.from_name &&
areaResult.to_name === itemResult.to_name &&
areaResult.item_index === itemResult.item_index;

if (isFound) {
itemId = area.id;
break;
}
}
} else {
// @todo: there is a strange behaviour that should be documented somewhere
// On serialization we use area id as result id to save it somewhere
// and on deserialization we use result id as area id
// but when we use suggestions we should keep in mind that we need to do it manually or use serialized data instead
// or we can get weird regions duplication in some cases
const area = self.areas.get(item.cleanId);

if (area) {
itemId = area.id;
}
}

self.areas.set(itemId, {
Expand Down
3 changes: 1 addition & 2 deletions web/libs/editor/src/stores/AppStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import { UserExtended } from "./UserStore";
import { UserLabels } from "./UserLabels";
import {
FF_CUSTOM_SCRIPT,
FF_DEV_1536,
FF_LSDV_4620_3_ML,
FF_LSDV_4998,
FF_REVIEWER_FLOW,
Expand Down Expand Up @@ -155,7 +154,7 @@ export default types

users: types.optional(types.array(UserExtended), []),

userLabels: isFF(FF_DEV_1536) ? types.optional(UserLabels, { controls: {} }) : types.undefined,
userLabels: types.optional(UserLabels, { controls: {} }),

queueTotal: types.optional(types.number, 0),

Expand Down
12 changes: 5 additions & 7 deletions web/libs/editor/src/tags/control/Taxonomy/Taxonomy.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import SelectedChoiceMixin from "../../../mixins/SelectedChoiceMixin";
import { SharedStoreMixin } from "../../../mixins/SharedChoiceStore/mixin";
import VisibilityMixin from "../../../mixins/Visibility";
import { parseValue } from "../../../utils/data";
import { FF_LSDV_4583, FF_TAXONOMY_ASYNC, FF_TAXONOMY_LABELING, isFF } from "../../../utils/feature-flags";
import { FF_LSDV_4583, FF_TAXONOMY_LABELING, isFF } from "../../../utils/feature-flags";
import ControlBase from "../Base";
import ClassificationBase from "../ClassificationBase";

Expand Down Expand Up @@ -260,7 +260,7 @@ const Model = types
},

get isLoadedByApi() {
return isFF(FF_TAXONOMY_ASYNC) && !!self.apiurl;
return !!self.apiurl;
},

get items() {
Expand Down Expand Up @@ -583,9 +583,7 @@ const TaxonomyModel = types.compose(

const HtxTaxonomy = observer(({ item }) => {
// literal "taxonomy" class name is for external styling
const className = [styles.taxonomy, "taxonomy", isFF(FF_TAXONOMY_ASYNC) ? styles.taxonomy__new : ""]
.filter(Boolean)
.join(" ");
const className = [styles.taxonomy, "taxonomy", styles.taxonomy__new].filter(Boolean).join(" ");
const visibleStyle = item.perRegionVisible() && item.isVisible ? {} : { display: "none" };
const options = {
showFullPath: item.showfullpath,
Expand All @@ -604,7 +602,7 @@ const HtxTaxonomy = observer(({ item }) => {
// they are indicated by loading icon on the item itself
const firstLoad = item.isLoadedByApi ? !item.items.length : true;

if (item.loading && isFF(FF_TAXONOMY_ASYNC) && firstLoad) {
if (item.loading && firstLoad) {
return (
<div className={className} style={visibleStyle}>
<div className={styles.taxonomy__loading}>
Expand All @@ -616,7 +614,7 @@ const HtxTaxonomy = observer(({ item }) => {

return (
<div className={className} style={visibleStyle} ref={item.elementRef}>
{isFF(FF_TAXONOMY_ASYNC) && !item.legacy ? (
{!item.legacy ? (
<NewTaxonomy
items={item.items}
selected={item.selectedItems}
Expand Down
11 changes: 2 additions & 9 deletions web/libs/editor/src/tags/object/Image/Image.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,7 @@ import { RectRegionModel } from "../../../regions/RectRegion";
import * as Tools from "../../../tools";
import ToolsManager from "../../../tools/Manager";
import { parseValue } from "../../../utils/data";
import {
FF_DEV_3377,
FF_DEV_3391,
FF_LSDV_4583,
FF_LSDV_4583_6,
FF_ZOOM_OPTIM,
isFF,
} from "../../../utils/feature-flags";
import { FF_DEV_3377, FF_DEV_3391, FF_LSDV_4583, FF_ZOOM_OPTIM, isFF } from "../../../utils/feature-flags";
import { guidGenerator } from "../../../utils/unique";
import { clamp, isDefined } from "../../../utils/utilities";
import ObjectBase from "../Base";
Expand Down Expand Up @@ -793,7 +786,7 @@ const Model = types

self.currentImage = index;
self.currentImageEntity = self.findImageEntity(index);
if (isFF(FF_LSDV_4583_6)) self.preloadImages();
self.preloadImages();
},

preloadImages() {
Expand Down
10 changes: 2 additions & 8 deletions web/libs/editor/src/tags/object/RichText/RichText.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,9 @@
position: relative;

&__container {
overflow: auto;
overflow: unset;
font-size: 16px;
line-height: 26px;

&_canResizeSpans {
overflow: unset;
font-size: 16px;
line-height: 20px;
}
line-height: 20px;
}

&__orig-container {
Expand Down
2 changes: 1 addition & 1 deletion web/libs/editor/src/tags/object/RichText/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ const Model = types
})
.views((self) => ({
get canResizeSpans() {
return ff.isActive(ff.FF_ADJUSTABLE_SPANS) && self.type === "text" && !self.isReadOnly();
return self.type === "text" && !self.isReadOnly();
},
get hasStates() {
const states = self.states();
Expand Down
7 changes: 1 addition & 6 deletions web/libs/editor/src/tags/object/RichText/view.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { LoadingOutlined } from "@ant-design/icons";
import * as ff from "@humansignal/core/lib/utils/feature-flags/ff";
import { observe } from "mobx";
import { inject, observer } from "mobx-react";
import { isAlive } from "mobx-state-tree";
Expand Down Expand Up @@ -562,11 +561,7 @@ class RichTextPieceView extends Component {
<ObjectTag item={item} className={cn("richtext").toClassName()}>
<div
key="root"
className={cn("richtext")
.elem("container")
.mod({ canResizeSpans: ff.isActive(ff.FF_ADJUSTABLE_SPANS) })
.mix("htx-richtext")
.toClassName()}
className={cn("richtext").elem("container").mix("htx-richtext").toClassName()}
ref={(el) => {
item.mountNodeRef.current = el;
el && this.markObjectAsLoaded();
Expand Down
Loading
Loading