Skip to content

Commit d39a84c

Browse files
Merge pull request #4271 from voxel51/merge/v0.23.8_to_main
Merge/v0.23.8 to main
2 parents 825e6cf + b0ee424 commit d39a84c

File tree

187 files changed

+9489
-4455
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

187 files changed

+9489
-4455
lines changed

.github/workflows/build-desktop.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ on:
1212

1313
jobs:
1414
build:
15-
runs-on: ubuntu-20.04
15+
runs-on: ubuntu-22.04
1616
strategy:
1717
fail-fast: false
1818
matrix:

.github/workflows/e2e.yml

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ jobs:
1212
FIFTYONE_DATABASE_NAME: playwright
1313
ELECTRON_EXTRA_LAUNCH_ARGS: "--disable-gpu"
1414
PLAYWRIGHT_BROWSERS_PATH: ${{ github.workspace }}/ms-playwright
15+
FIFTYONE_PLUGINS_DIR: ${{ github.workspace }}/e2e-pw/src/shared/assets/plugins
1516
defaults:
1617
run:
1718
shell: bash

app/__mocks__/recoil.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as recoil from "recoil";
22
export * from "recoil";
33

44
export let mockValues = {};
5-
export let mockValuesStore = {};
5+
export const mockValuesStore = {};
66
export let mockDefaults = {};
77
export function setMockAtoms(newMockValues: { [key: string]: any }) {
88
mockValues = {
@@ -15,8 +15,8 @@ export function setMockAtoms(newMockValues: { [key: string]: any }) {
1515
export const getValue = (atom) => {
1616
if (mockValuesStore[atom.key]) {
1717
const str = JSON.stringify(atom.params);
18-
if (mockValuesStore[atom.key].hasOwnProperty(str)) {
19-
return mockValuesStore[atom.key][JSON.stringify[str]];
18+
if (Object.hasOwn(mockValuesStore[atom.key], str)) {
19+
return mockValuesStore[atom.key][str];
2020
}
2121
}
2222

app/packages/app/src/pages/IndexPage.tsx

+3-6
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
import { Snackbar } from "@fiftyone/core";
1+
import { Snackbar, Starter } from "@fiftyone/core";
22
import React from "react";
33
import { usePreloadedQuery } from "react-relay";
44
import { graphql } from "relay-runtime";
55
import Nav from "../components/Nav";
66
import { Route } from "../routing";
77
import { IndexPageQuery } from "./__generated__/IndexPageQuery.graphql";
8-
import { Starter } from "@fiftyone/core";
98

109
const IndexPageQueryNode = graphql`
1110
query IndexPageQuery($search: String = "", $count: Int, $cursor: String) {
@@ -16,17 +15,15 @@ const IndexPageQueryNode = graphql`
1615
multicolorKeypoints
1716
showSkeletons
1817
}
19-
allDatasets: datasets(search: "") {
20-
total
21-
}
18+
allDatasets: estimatedDatasetCount
2219
...NavFragment
2320
...configFragment
2421
}
2522
`;
2623

2724
const IndexPage: Route<IndexPageQuery> = ({ prepared }) => {
2825
const queryRef = usePreloadedQuery(IndexPageQueryNode, prepared);
29-
const totalDatasets = queryRef?.allDatasets?.total;
26+
const totalDatasets = queryRef.allDatasets;
3027

3128
return (
3229
<>

app/packages/app/src/pages/__generated__/IndexPageQuery.graphql.ts

+19-33
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/packages/components/src/components/Selection/Selection.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ export default function Selection(props: SelectionProps) {
114114
defaultValue={selectedId}
115115
sx={{
116116
width: "100%",
117-
zIndex: 999,
118117
background: theme.background.level3,
119118
}}
120119
renderValue={() => {

app/packages/components/src/components/ThemeProvider/index.tsx

+9
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,15 @@ let theme = extendMuiTheme({
210210
},
211211
},
212212
},
213+
MuiIconButton: {
214+
styleOverrides: {
215+
root: {
216+
"&:hover": {
217+
backgroundColor: "unset",
218+
},
219+
},
220+
},
221+
},
213222
},
214223
fontFamily: {
215224
body: "Palanquin, sans-serif",

app/packages/core/src/components/Actions/Tagger.tsx

+6-1
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,9 @@ const useTagCallback = (
368368
selectedSamples: await snapshot.getPromise(fos.selectedSamples),
369369
targetLabels,
370370
view: await snapshot.getPromise(fos.view),
371+
extended: !modal
372+
? await snapshot.getPromise(fos.extendedStages)
373+
: null,
371374
}),
372375
current_frame: lookerRef?.current?.frameNumber,
373376
changes,
@@ -418,7 +421,9 @@ const useLabelPlaceHolder = (
418421
return (): [number, string] => {
419422
const selectedSamples = useRecoilValue(fos.selectedSamples).size;
420423
const selectedLabels = useRecoilValue(fos.selectedLabelIds).size;
421-
const selectedLabelCount = useRecoilValue(numItemsInSelection(true));
424+
const selectedLabelCount = useRecoilValue(
425+
numItemsInSelection({ labels: true, modal })
426+
);
422427
const totalLabelCount = useRecoilValue(
423428
fos.labelCount({ modal, extended: true })
424429
);

app/packages/core/src/components/Actions/utils.tsx

+7-3
Original file line numberDiff line numberDiff line change
@@ -92,17 +92,21 @@ export const tagStatistics = selectorFamily<
9292
selectedLabels: get(fos.selectedLabels),
9393
targetLabels: countLabels,
9494
view: get(fos.view),
95+
extended: !modal ? get(fos.extendedStages) : null,
9596
})
9697
);
9798
},
9899
});
99100

100-
export const numItemsInSelection = selectorFamily<number, boolean>({
101+
export const numItemsInSelection = selectorFamily<
102+
number,
103+
{ modal: boolean; labels: boolean }
104+
>({
101105
key: "numLabelsInSelectedSamples",
102106
get:
103-
(labels) =>
107+
({ modal = false, labels }) =>
104108
({ get }) => {
105-
return get(tagStatistics({ modal: false, labels })).count;
109+
return get(tagStatistics({ modal, labels })).count;
106110
},
107111
});
108112

app/packages/core/src/components/Filters/StringFilter/Checkboxes.tsx

+21-10
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,25 @@ const useValues = ({
140140
};
141141
};
142142

143+
const useGetCount = (modal: boolean, path: string) => {
144+
const isFilterMode = useRecoilValue(fos.isSidebarFilterMode);
145+
const keypoints = useRecoilValue(isInKeypointsField(path));
146+
const lightning = useRecoilValue(fos.isLightningPath(path));
147+
return (count: number | null, value: string | null) => {
148+
// show no count for the 'points' field of a Keypoint, and visibility mode
149+
if (!isFilterMode || keypoints) {
150+
return undefined;
151+
}
152+
153+
// request subcount for non-lightning paths
154+
if (typeof count !== "number" && !lightning) {
155+
return pathSearchCount({ modal, path, value: value as string });
156+
}
157+
158+
return count ?? undefined;
159+
};
160+
};
161+
143162
const Checkboxes = ({
144163
results,
145164
selectedAtom,
@@ -150,7 +169,6 @@ const Checkboxes = ({
150169
}: CheckboxesProps) => {
151170
const [selected, setSelected] = useRecoilState(selectedAtom);
152171
const color = useRecoilValue(fos.pathColor(path));
153-
const isFilterMode = useRecoilValue(fos.isSidebarFilterMode);
154172

155173
const { loading, name, selectedSet, sorting, values } = useValues({
156174
modal,
@@ -160,8 +178,7 @@ const Checkboxes = ({
160178
});
161179

162180
const show = useRecoilValue(showSearchSelector({ modal, path }));
163-
const keypoints = useRecoilValue(isInKeypointsField(path));
164-
const lightning = useRecoilValue(fos.isLightningPath(path));
181+
const getCount = useGetCount(modal, path);
165182

166183
if (loading) {
167184
return <LoadingDots text={"Loading"} />;
@@ -186,13 +203,7 @@ const Checkboxes = ({
186203
forceColor={value === null}
187204
name={value === null ? "None" : value}
188205
loading={loading}
189-
count={
190-
(typeof count !== "number" || !isFilterMode || keypoints) &&
191-
!lightning
192-
? // only string and id fields use pathSearchCount
193-
pathSearchCount({ modal, path, value: value as string })
194-
: count
195-
}
206+
count={getCount(count, value)}
196207
setValue={(checked: boolean) => {
197208
if (checked) {
198209
selectedSet.add(value);

app/packages/core/src/components/Sidebar/Entries/FilterablePathEntry/Arrow.tsx

+16-7
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,37 @@ import { useTheme } from "styled-components";
88
import AddIndex from "./AddIndex";
99

1010
export default ({
11+
id,
1112
color,
13+
disabled,
1214
expanded,
13-
id,
1415
unindexed,
1516
}: {
17+
id: string;
1618
color?: string;
17-
unindexed?: boolean;
19+
disabled?: boolean;
1820
expanded: RecoilState<boolean>;
19-
id: string;
21+
unindexed?: boolean;
2022
}) => {
2123
const [isExpanded, setExpanded] = useRecoilState(expanded);
2224
const Arrow = isExpanded ? KeyboardArrowUp : KeyboardArrowDown;
2325
const theme = useTheme();
2426
const unlocked = useLightningUnlocked();
27+
const arrow = (
28+
<Arrow
29+
data-cy={`sidebar-field-arrow-disabled-${id}`}
30+
style={{ margin: 0, color: theme.text.secondary }}
31+
/>
32+
);
33+
34+
if (disabled) {
35+
return arrow;
36+
}
2537

2638
if (unindexed && !unlocked) {
2739
return (
2840
<Tooltip text={<AddIndex />} placement="top-center">
29-
<Arrow
30-
data-cy={`sidebar-field-arrow-disabled-${id}`}
31-
style={{ margin: 0, color: theme.text.secondary }}
32-
/>
41+
{arrow}
3342
</Tooltip>
3443
);
3544
}

app/packages/core/src/components/Sidebar/Entries/FilterablePathEntry/Icon.tsx

+4-1
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,17 @@ const Lightning = ({ path }: { path: string }) => {
1919
};
2020

2121
const IconWrapper = ({ modal, path }: { modal: boolean; path: string }) => {
22-
const lightning = useRecoilValue(fos.lightning);
22+
const disabled = useRecoilValue(fos.isDisabledPath(path));
2323
const expandedPath = useRecoilValue(fos.expandPath(path));
24+
const lightning = useRecoilValue(fos.lightning);
25+
2426
if (lightning && !modal) {
2527
return <Lightning path={path} />;
2628
}
2729

2830
return (
2931
<Arrow
32+
disabled={disabled}
3033
expanded={fos.sidebarExpanded({ modal, path: expandedPath })}
3134
id={path}
3235
/>

0 commit comments

Comments
 (0)