-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Annotations filters UI #2743
Annotations filters UI #2743
Conversation
FiltersInput component has to be removed after review |
@vnishukov , by a reason first image is zoomed when I open a job. Can it be connected with your changes? |
In help message:
|
Can we have an icon to clear filter somewhere instead of context menu? We actually can, but I'm pretty sure that current approach is more comfortable for users, and allow to keep filters pane with no extra elements. It actually not a big deal to change, so could we give users a chance to test it? |
Why did you decide to use hotkeys to add |
@vnishukov , did you look at https://github.com/ukrbublik/react-awesome-query-builder? Can it help? |
|
I'm absolutely sure this is more comfortable than it was described in concept (additional combine button in change filter panel). We should improve UX and make it possible for users to achieve theirs goals using minimum of clicks, navigations, etc. In current approach user can group filters by single clicks for each of them. In the approach described in concept it will be couple of clicks, and extra button. But the main benefit here is the multigrouping (two or more braces) in the current approach we still handle it by two clicks, in other approach it requires a "by hand" input in filters pane which is acts slowly and takes more efforts from user. Let's give a chance to test it by users as well? |
Current logic of json queries was not changed, as it works fine. What benefits will we have to change it with something else instead? |
@vnishukov , I see your point. @bsekachev , @ActiveChooN , what do you think? |
@ActiveChooN Can I ask you to review the PR when it is ready? |
This is the one of the reason of failed tests. I didn't make any specific with images, changes affect only right side panel, but seems somehow it affects annotation area as well |
Hi, I tried the patch and here are some thoughts:
I also looked at https://github.com/ukrbublik/react-awesome-query-builder and I would say it looks promising. IMO UX is simplier and the builder is quite flexible. I have some concerns related with output format (out of the box it is different, but GitHub says "Export to MongoDb, SQL, JsonLogic or your custom format", so maybe we will be able to setup it properly or adjust format that cvat-core expects (it is also possible because cvat-core expects custom format, not jsonpath and we have our code for convertation which could be adjusted). And additionally we need to be sure that this library is able to provide necessary flexibility (in possible queries). After quick review it looks like it is able more or less, but need more investigations. |
Let's have a meeting tomorrow about the patch, guys. I'll send an invite. |
Previously when dump file included server IDs some people used serverID to find objects from dump file in UI. |
@@ -1,4 +1,4 @@ | |||
// Copyright (C) 2019-2020 Intel Corporation | |||
// Copyright (C) 2021 Intel Corporation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be 2019-2021
// | ||
// SPDX-License-Identifier: MIT | ||
|
||
import { Tag } from 'antd'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use the same import policy, now project uses modular import: import Tag from /antd/lib/Tag
For information: https://nsisodiya.medium.com/reduce-size-in-ant-design-bundle-size-c35dad9ce3a8
}; | ||
function AnnotationFilterItem({ | ||
item, onEdit, onDelete, onGrouping, | ||
}: Props): ReactElement { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ReactElement > JSX.Element
case ActionType.addRight: | ||
return { ...state, right: [...state.right, ')'] }; | ||
case ActionType.removeLeft: | ||
state.left.pop(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
state.right property before reducing is equal to state.right property after.
It is better to use something destructive like that:
return { ...state, left: state.left.slice(0, -1) };
state.right.pop(); | ||
return { ...state }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same
@@ -1,4 +1,4 @@ | |||
// Copyright (C) 2020 Intel Corporation | |||
// Copyright (C) 2021 Intel Corporation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, abort changes in this file
@@ -1,4 +1,4 @@ | |||
// Copyright (C) 2020 Intel Corporation | |||
// Copyright (C) 2021 Intel Corporation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, abort changes in this file
@@ -1,4 +1,4 @@ | |||
// Copyright (C) 2020 Intel Corporation | |||
// Copyright (C) 2021 Intel Corporation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be 2020-2021
@@ -1,22 +1,21 @@ | |||
// Copyright (C) 2020 Intel Corporation | |||
// Copyright (C) 2021 Intel Corporation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be 2020-2021
import StatesOrderingSelector from 'components/annotation-page/standard-workspace/objects-side-bar/states-ordering-selector'; | ||
import React from 'react'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, do 3rdparty import before internal import
What is a reason to change import order in this file?
concatenator, | ||
filterBy, | ||
operator, | ||
value, | ||
attribute, | ||
attributeOperator, | ||
attributeValue, | ||
anotherAttributeLabel, | ||
anotherAttributeValue, | ||
fillState, | ||
partialReset, | ||
reset, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I expect all actions to be a verb (or contain a verb)
For example I cannot understand what such actions like concatenator
, value
, operator
, attribute
, etc. do.
Also to follow the current codestyle let actions to be written in upper case: FILTER_BY, FILL_STATE, PARTIAL_RESET.
Some common comments after code review:
|
Using |
I read about the difference, but in the code I do not see where it is important in our case. Could you please direct me? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most problems was described by @bsekachev and i have to add only few things:
- It's better to save state of the filter input for reducing clicks for similar filters (in case we want to select some obejcts with differnt clientID).
- There is no way to insert filter in the middle of the query, only remove secand half of the query.
- I guess it can be really nice feature to insert query as a string like it works for label editor. It can be helpful for common filters.
Probably bug: boolean attributes have only one option (I understand that it could be replaced with ==, !==, but for me personally it looks strange (maybe @ActiveChooN think in other way)
I did not notice anithing strange.
const { changeAnnotationsFilters } = props; | ||
|
||
const [editItem, setEditItem] = useState(); | ||
const [filters, setFilters] = useState([] as any); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use filter type from annotation-filter-item.tsx
and reduce using any
type as possible?
}, [state]); | ||
|
||
useEffect(() => { | ||
setTimeout(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess it's better to use recap for timeout in useEffect
hook
Reimplemented with new UI in #2871 using https://github.com/ukrbublik/react-awesome-query-builder |
Motivation and context
1418: CVAT new UI: find the way to simplify the syntax for filters
How has this been tested?
Checklist
develop
branchcvat-core, cvat-data and cvat-ui)
License
Feel free to contact the maintainers if that's a concern.