Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App supports bazel #3338

Merged
merged 42 commits into from
Jul 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
45e2e75
externalize styled-components
imanjra Jun 8, 2023
9430704
add filter/visibility toggle control for dataset
lanzhenw Jun 27, 2023
4b28d46
update visibility setting on string field
lanzhenw Jun 28, 2023
6c7e4f6
update filter options and items for visibility
lanzhenw Jun 28, 2023
bfc8d4c
updated numeric fields
lanzhenw Jun 29, 2023
ac877ea
updated boolean fields
lanzhenw Jun 29, 2023
5407cc7
update search component
lanzhenw Jun 29, 2023
72380a2
update clear visibility selections icon in the group entries
lanzhenw Jun 29, 2023
624f158
update overlay for string visibility settings
lanzhenw Jun 29, 2023
5cc062b
update looker tags to use visibility filter and refresh
lanzhenw Jun 30, 2023
bc0a40e
fix boolean filter issue
lanzhenw Jul 5, 2023
f8ae6f3
boolean filter clean up
lanzhenw Jul 5, 2023
9ce3c59
fix list_string and sample tags
lanzhenw Jul 5, 2023
899f226
fix list_boolean
lanzhenw Jul 5, 2023
6a7bb9d
refactor
lanzhenw Jul 5, 2023
ccfb998
fix numeric visibility looker bug
lanzhenw Jul 5, 2023
4bdcf12
fix list_floats
lanzhenw Jul 5, 2023
79b3655
.
lanzhenw Jul 5, 2023
fe8b37c
numerber field reset UI
lanzhenw Jul 5, 2023
546d52b
fix reset issue on looker tags
lanzhenw Jul 6, 2023
fd01195
make sidebar search filter sticky
lanzhenw Jul 6, 2023
a6442f3
update UI display styles
lanzhenw Jul 6, 2023
faa1a93
fix tag merge conflict for looker display
lanzhenw Jul 6, 2023
2c70f51
update filterentry style
lanzhenw Jul 6, 2023
9fd5d7f
fix refresh and a only match bug with toggleing mode
lanzhenw Jul 10, 2023
1379dab
fix an issue displaying label tag visibility
lanzhenw Jul 11, 2023
0de7033
address PR comments
lanzhenw Jul 12, 2023
3fd72c8
use count instead of omitAggregation in visibility mode for checkbox
lanzhenw Jul 13, 2023
fa1edeb
remove useEffect on filterOption
lanzhenw Jul 13, 2023
3390060
fix a initialization display bug
lanzhenw Jul 13, 2023
9aa7a2c
split selector and hooks out from groupEntries component and add unit…
lanzhenw Jul 16, 2023
da2427b
test useclearvisibility and useclearfiltered
lanzhenw Jul 16, 2023
1459e00
1)fix bug with modal view 2) nest listfield still use filter mode as …
lanzhenw Jul 16, 2023
44707d8
remove field filter and update modal UI
lanzhenw Jul 16, 2023
4f3ea4d
reset attribute filters before using select_field rules
lanzhenw Jul 16, 2023
2beefda
improve toggle ux
lanzhenw Jul 17, 2023
2a741d2
remove filter bar on modal
lanzhenw Jul 17, 2023
1d25b8c
clean up
lanzhenw Jul 17, 2023
f4075dd
address PR comments
lanzhenw Jul 20, 2023
5a929eb
only use MPS when manually specified
brimoor Jul 21, 2023
ab947f5
Merge pull request #3328 from voxel51/bug/mps
brimoor Jul 21, 2023
ee2001b
Update app.py
mys007 Jul 25, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/packages/core/src/components/Actions/ActionsRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export const shouldToggleBookMarkIconOnSelector = selector<boolean>({
const isSimilarityOn = get(fos.similarityParameters);

const affectedPathCount = get(affectedPathCountState);
const isFieldVisibilityOn = affectedPathCount > 0;
const isAttributeVisibilityOn = affectedPathCount > 0;

const isExtendedSelectionOn =
(selection && selection.length > 0) || isSimilarityOn;
Expand All @@ -69,7 +69,7 @@ export const shouldToggleBookMarkIconOnSelector = selector<boolean>({
isExtendedSelectionOn ||
hasFiltersValue ||
selectedSampleSet.size > 0 ||
isFieldVisibilityOn
isAttributeVisibilityOn
);
},
});
Expand Down
5 changes: 2 additions & 3 deletions app/packages/core/src/components/Common/Checkbox.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { useTheme } from "@fiftyone/components";
import { Checkbox as MaterialCheckbox } from "@mui/material";
import { animated } from "@react-spring/web";
import React, { useMemo } from "react";
import styled from "styled-components";

import { useTheme } from "@fiftyone/components";
import { constSelector, RecoilValueReadOnly } from "recoil";
import styled from "styled-components";
import { prettify } from "../../utils/generic";
import { ItemAction } from "../Actions/ItemAction";
import { useHighlightHover } from "../Actions/utils";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ const NumericFieldFilter = ({
color,
}: Props) => {
const name = path.split(".").slice(-1)[0];
const isFilterMode = useRecoilValue(fos.isSidebarFilterMode);
const excludeAtom = fos.numericExcludeAtom({
path,
modal,
Expand Down Expand Up @@ -161,6 +162,9 @@ const NumericFieldFilter = ({
});

const isFiltered = useRecoilValue(fos.fieldIsFiltered({ modal, path }));
const hasVisibilitySetting = useRecoilValue(
fos.fieldHasVisibilitySetting({ modal, path })
);

const bounded = useRecoilValue(
fos.boundedCount({ modal, path, extended: false })
Expand Down Expand Up @@ -267,7 +271,7 @@ const NumericFieldFilter = ({
disabled={true}
name={bounds[0]}
setValue={() => {}}
count={bounded}
count={isFilterMode ? bounded : undefined} // visibility mode does not show count
subcountAtom={fos.boundedCount({
modal,
path,
Expand Down Expand Up @@ -305,7 +309,7 @@ const NumericFieldFilter = ({
isKeyPointLabel={isKeyPoints}
/>
)}
{isFiltered && (
{(isFiltered || hasVisibilitySetting) && (
<Button
text={"Reset"}
color={color}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,13 @@ const CategoricalFilter = <T extends V = V>({
: path.startsWith("_label_tags")
? "label tag"
: name;

const isFilterMode = useRecoilValue(fos.isSidebarFilterMode);
const selectedCounts = useRef(new Map<V["value"], number>());
const onSelect = useOnSelect(selectedValuesAtom, selectedCounts);
const selectVisibility = useRef(new Map<V["value"], number>());
const onSelect = useOnSelect(
selectedValuesAtom,
isFilterMode ? selectedCounts : selectVisibility
);
const useSearch = getUseSearch({ modal, path });
const skeleton = useRecoilValue(isKeypointLabel(path));
const theme = useTheme();
Expand Down Expand Up @@ -247,7 +251,9 @@ const CategoricalFilter = <T extends V = V>({
!skeleton && (
<Selector
useSearch={useSearch}
placeholder={`+ filter by ${name}`}
placeholder={`+ ${
isFilterMode ? "filter" : "set visibility"
} by ${name}`}
component={ResultComponent}
onSelect={onSelect}
inputStyle={{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import * as fos from "@fiftyone/state";
import React from "react";
import { useRecoilValue } from "recoil";
import { V } from "./CategoricalFilter";

const ResultComponent = ({ value: { value, count } }: { value: V }) => {
const isFilterMode = useRecoilValue(fos.isSidebarFilterMode);
return (
<div
style={{
Expand All @@ -22,7 +25,7 @@ const ResultComponent = ({ value: { value, count } }: { value: V }) => {
>
{value}
</div>
<div style={{ fontSize: "1rem" }}>{count}</div>
{isFilterMode && <div style={{ fontSize: "1rem" }}>{count}</div>}
</div>
);
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
import React, { MutableRefObject } from "react";
import {
RecoilState,
useRecoilState,
useRecoilValue,
useSetRecoilState,
} from "recoil";
import { RecoilState, useRecoilState, useRecoilValue } from "recoil";

import * as fos from "@fiftyone/state";

Expand Down Expand Up @@ -41,11 +36,10 @@ const Wrapper = ({
const schema = useRecoilValue(fos.field(path));
const [selected, setSelected] = useRecoilState(selectedValuesAtom);
const selectedSet = new Set(selected);
const setExcluded = excludeAtom ? useSetRecoilState(excludeAtom) : null;
const setIsMatching = isMatchingAtom
? useSetRecoilState(isMatchingAtom)
: null;
const [excluded, setExcluded] = useRecoilState(excludeAtom);
const [isMatching, setIsMatching] = useRecoilState(isMatchingAtom);
const sorting = useRecoilValue(fos.sortFilterResults(modal));
const isFilterMode = useRecoilValue(fos.isSidebarFilterMode);

const counts = Object.fromEntries(results);
let allValues: V[] = selected.map<V>((value) => ({
Expand Down Expand Up @@ -83,8 +77,8 @@ const Wrapper = ({
const isKeyPoints = fieldSchema?.dbField === "keypoints";

const initializeSettings = () => {
setExcluded && setExcluded(false);
setIsMatching && setIsMatching(!nestedField);
excluded && setExcluded(false);
setIsMatching(!nestedField);
};

if (totalCount === 0) {
Expand All @@ -111,7 +105,7 @@ const Wrapper = ({
value={selectedSet.has(value)}
name={value}
count={
count < 0
count < 0 || !isFilterMode
? null
: selectedCounts.current.has(value)
? selectedCounts.current.get(value)
Expand All @@ -138,7 +132,7 @@ const Wrapper = ({
{
<FilterOption
nestedField={nestedField}
shouldNotShowExclude={shouldNotShowExclude}
shouldNotShowExclude={Boolean(shouldNotShowExclude)}
excludeAtom={excludeAtom}
isMatchingAtom={isMatchingAtom}
valueName={name}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import React, { DetailedReactHTMLElement } from "react";
import styled from "styled-components";
import { IconButton } from "@mui/material";
import { Tooltip } from "@fiftyone/components";
import FilterAltIcon from "@mui/icons-material/FilterAlt";
import FilterAltOffIcon from "@mui/icons-material/FilterAltOff";
import ImageIcon from "@mui/icons-material/Image";
import HideImageIcon from "@mui/icons-material/HideImage";
import { Tooltip } from "@fiftyone/components";
import ImageIcon from "@mui/icons-material/Image";
import VisibilityIcon from "@mui/icons-material/Visibility";
import VisibilityOffIcon from "@mui/icons-material/VisibilityOff";
import { IconButton } from "@mui/material";
import React from "react";
import styled from "styled-components";

type ItemProp = {
icon?: string;
Expand Down Expand Up @@ -53,6 +55,10 @@ const Item = React.memo(
return <ImageIcon fontSize="small" />;
case "hideimageicon":
return <HideImageIcon fontSize="small" />;
case "visibilityicon":
return <VisibilityIcon fontSize="small" />;
case "visibilityofficon":
return <VisibilityOffIcon fontSize="small" />;
}
};

Expand Down