-
Notifications
You must be signed in to change notification settings - Fork 504
[CB] Remove tooltips from context menu #4033
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
base: devel
Are you sure you want to change the base?
Conversation
6dd1f10 to
285b6b7
Compare
|
|
||
| const title = translate(label); | ||
| const textRef = useRef<HTMLDivElement | null>(null); | ||
| const truncatedLabel = useTruncatedTooltip(textRef, label); |
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 think we dont need this, tooltips are just fine
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 also think so, we don't expect to have long tooltips or labels in the menu items, where we expect them, we should truncate them at the declaration point
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.
for example like here:
Lines 405 to 434 in a836412
| if (this.clipboardService.state === 'granted') { | |
| const filters = supportedOperations | |
| .filter(operation => !nullOperationsFilter(operation)) | |
| .map(operation => { | |
| const val = this.clipboardService.clipboardValue || ''; | |
| const wrappedValue = wrapOperationArgument(operation.id, val); | |
| const clippedValue = replaceMiddle(wrappedValue, ' ... ', 8, 30); | |
| const label = `${columnLabel} ${operation.expression} ${clippedValue}`; | |
| return new MenuBaseItem( | |
| { id: operation.id, icon: 'filter-clipboard', label }, | |
| { | |
| onSelect: async () => { | |
| const wrappedValue = wrapOperationArgument(operation.id, val); | |
| await this.applyFilter( | |
| model as unknown as IDatabaseDataModel<ResultSetDataSource>, | |
| resultIndex, | |
| key.column, | |
| operation.id, | |
| wrappedValue, | |
| ); | |
| }, | |
| }, | |
| { isDisabled: () => model.isLoading() }, | |
| ); | |
| }); | |
| result.push(...filters); | |
| } |
|
|
||
| const title = translate(label); | ||
| const textRef = useRef<HTMLDivElement | null>(null); | ||
| const truncatedLabel = useTruncatedTooltip(textRef, label); |
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 also think so, we don't expect to have long tooltips or labels in the menu items, where we expect them, we should truncate them at the declaration point
|
|
||
| const title = translate(label); | ||
| const textRef = useRef<HTMLDivElement | null>(null); | ||
| const truncatedLabel = useTruncatedTooltip(textRef, label); |
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.
for example like here:
Lines 405 to 434 in a836412
| if (this.clipboardService.state === 'granted') { | |
| const filters = supportedOperations | |
| .filter(operation => !nullOperationsFilter(operation)) | |
| .map(operation => { | |
| const val = this.clipboardService.clipboardValue || ''; | |
| const wrappedValue = wrapOperationArgument(operation.id, val); | |
| const clippedValue = replaceMiddle(wrappedValue, ' ... ', 8, 30); | |
| const label = `${columnLabel} ${operation.expression} ${clippedValue}`; | |
| return new MenuBaseItem( | |
| { id: operation.id, icon: 'filter-clipboard', label }, | |
| { | |
| onSelect: async () => { | |
| const wrappedValue = wrapOperationArgument(operation.id, val); | |
| await this.applyFilter( | |
| model as unknown as IDatabaseDataModel<ResultSetDataSource>, | |
| resultIndex, | |
| key.column, | |
| operation.id, | |
| wrappedValue, | |
| ); | |
| }, | |
| }, | |
| { isDisabled: () => model.isLoading() }, | |
| ); | |
| }); | |
| result.push(...filters); | |
| } |
Co-authored-by: Alexey Potsetsuev <[email protected]>
closes https://github.com/dbeaver/pro/issues/7772