diff --git a/frontend/javascripts/viewer/view/components/button_component.tsx b/frontend/javascripts/viewer/view/components/button_component.tsx index 72d1d2b7b4..d3af977f4c 100644 --- a/frontend/javascripts/viewer/view/components/button_component.tsx +++ b/frontend/javascripts/viewer/view/components/button_component.tsx @@ -4,7 +4,6 @@ import noop from "lodash/noop"; import React from "react"; type ButtonComponentProps = ButtonProps & { - faIcon?: string; tooltipPlacement?: FastTooltipPlacement | undefined; }; /* @@ -20,15 +19,7 @@ const ButtonComponent = React.forwardRef< HTMLButtonElement | HTMLAnchorElement, ButtonComponentProps >((props, ref) => { - const { - children, - faIcon, - title, - tooltipPlacement, - onClick = noop, - onTouchEnd, - ...restProps - } = props; + const { children, title, tooltipPlacement, onClick = noop, onTouchEnd, ...restProps } = props; const handleClick = (e: React.MouseEvent) => { e.currentTarget.blur(); @@ -42,20 +33,12 @@ const ButtonComponent = React.forwardRef< } }; - const iconEl = faIcon != null && !props.loading ? : null; - const button = - // Differentiate via children != null, since antd uses a different styling for buttons - // with a single icon child (.ant-btn-icon-only will be assigned) - children != null ? ( - - ) : ( - - ); + const button = ( + + ); + return title != null ? ( {button} diff --git a/frontend/javascripts/viewer/view/right-border-tabs/advanced_search_popover.tsx b/frontend/javascripts/viewer/view/right-border-tabs/advanced_search_popover.tsx index 6411e6029d..09c0fe869d 100644 --- a/frontend/javascripts/viewer/view/right-border-tabs/advanced_search_popover.tsx +++ b/frontend/javascripts/viewer/view/right-border-tabs/advanced_search_popover.tsx @@ -159,7 +159,6 @@ export default class AdvancedSearchPopover< style={{ width: 450, }} - className="compact-items compact-icons" > - {areAllMatchesSelected - ? "all" - : `${currentPosition + 1}/${numberOfAvailableOptions}`} - - } ref={this.autoFocus} autoFocus /> + + {areAllMatchesSelected + ? "all" + : `${currentPosition + 1}/${numberOfAvailableOptions}`} + - + - + ; - } - function getSortDropdown(): MenuProps { return { selectedKeys: [sortBy], @@ -458,7 +453,7 @@ function CommentTabView(props: Props) { return ( {renderMarkdownModal()} - + { setActiveNode(comment.nodeId); @@ -510,9 +505,13 @@ function CommentTabView(props: Props) { icon={} /> - - {renderSortIcon()} - + : + } + /> { return ( <> { }; getMeshesHeader = () => ( - + { placeholder="Select a mesh file" value={this.props.currentMeshFile != null ? this.props.currentMeshFile.name : null} onChange={this.handleMeshFileSelected} - size="small" loading={this.props.availableMeshFiles == null} popupMatchSelectWidth={false} > @@ -1022,38 +1021,32 @@ class SegmentsView extends React.Component { - - - Store.dispatch( - maybeFetchMeshFilesAction( - this.props.visibleSegmentationLayer, - this.props.dataset, - true, - ), - ) - } - > - Reload from Server - - - - - - - + } + onClick={() => + Store.dispatch( + maybeFetchMeshFilesAction( + this.props.visibleSegmentationLayer, + this.props.dataset, + true, + ), + ) + } + /> + + } /> + {this.state.activeMeshJobId != null ? ( - - - + } + /> ) : null} - - - - - - + + } /> + + ); getToastForMissingPositions = (groupId: number | null) => { @@ -1860,7 +1853,7 @@ class SegmentsView extends React.Component { ).map((node) => node.key); return ( - + { onSelectAllMatches={this.handleSelectAllMatchingSegments} > } /> {this.getMeshesHeader()} - +
{isSegmentHierarchyEmpty ? ( { onClick: this.shuffleAllTreeColors, title: "Shuffle All Tree Colors", disabled: isEditingDisabled, - icon: , + icon: , label: "Shuffle All Tree Colors", }, { @@ -825,7 +829,7 @@ class SkeletonTabView extends React.PureComponent { onClick: this.handleMeasureAllSkeletonsLength, title: "Measure Length of All Skeletons", - icon: , + icon: , label: "Measure Length of All Skeletons", }, ], @@ -840,7 +844,7 @@ class SkeletonTabView extends React.PureComponent { totalLengthNm, LongUnitToShortUnitMap[unit], )} (${formatLengthAsVx(totalLengthVx)}).`, - icon: , + icon: , }); }; @@ -873,8 +877,6 @@ class SkeletonTabView extends React.PureComponent { } const { showSkeletons, trees, treeGroups } = skeletonTracing; - const activeTreeName = getActiveTree(skeletonTracing)?.name ?? ""; - const activeGroupName = getActiveTreeGroup(skeletonTracing)?.name ?? ""; const noTreesAndGroups = trees.size() === 0 && _.size(treeGroups) === 0; const orderAttribute = this.props.userConfiguration.sortTreesByName ? "name" : "timestamp"; // Avoid that the title switches to the other title during the fadeout of the Modal @@ -914,7 +916,7 @@ class SkeletonTabView extends React.PureComponent { > - + { - - + icon={} + /> - - + icon={} + /> - - + icon={} + /> - - + icon={} + /> - - - - - More - - - - - + icon={} + /> - - - } /> - - + icon={} + /> - - - + } /> + + + }>More {!showSkeletons ? ( diff --git a/frontend/stylesheets/trace_view/_right_menu.less b/frontend/stylesheets/trace_view/_right_menu.less index 4ee5a00a97..9a2846212d 100644 --- a/frontend/stylesheets/trace_view/_right_menu.less +++ b/frontend/stylesheets/trace_view/_right_menu.less @@ -34,22 +34,26 @@ padding-left: 5px; padding-right: 5px; border-radius: 2px; + .anticon-edit, .anticon-ellipsis { // Hide edit and ellipsis icon (unless hovered) display: none; } + &.is-selected-segment { background-color: var(--ant-blue-3); } &:hover { background-color: var(--ant-blue-1); + .anticon-edit, .anticon-ellipsis { display: inline-block; } } + // If a cell is hovered in the data viewports, // it should also be highlighted in the list. &.is-hovered-segment { @@ -77,7 +81,7 @@ height: inherit; display: flex; flex-direction: column; - + .ant-space-compact:not(.ant-tree .ant-space-compact) { // Override spacing between skeleton tab buttons and name input // Do not affect use of in in the elements @@ -94,6 +98,7 @@ } .markdown-small { + h1, h2, h3, @@ -103,6 +108,7 @@ margin-bottom: 0; color: var(--ant-color-text); } + max-height: 24px; overflow: hidden; } @@ -117,9 +123,11 @@ .ant-input-group-wrapper { .ant-input-wrapper { color: inherit; + .ant-input { color: inherit; } + .ant-input-group-addon { border-radius: 0; border-right: 0; @@ -128,26 +136,15 @@ } } -.compact-items { - button { - padding: 4px 8px; - } -} -.compact-icons { - .anticon, - i { - margin-right: 0px; - } -} - .compact-wrap { // Should only be used with antd + // Allows for wrapping of compact items flex-wrap: wrap; - button{ + button { // Slightly shift buttons up to prevent double borders when wrapping in flex container occurs margin-top: -1px; - } + } } @@ -206,23 +203,29 @@ .ant-table { border-bottom: none; } + .ant-table-cell { padding: 0px 20px !important; cursor: pointer; } + .ant-table-row:last-child { border-bottom: none; + .ant-table-cell { border-bottom: none; } } + .ant-table-row .ant-table-cell:first-child { // Hiding the extra checkbox column rendered due to using rowSelection in the table wrapping the bounding boxes. display: none; } + .ant-table-row .ant-table-cell:nth-child(2) { flex: 1 1 !important; } + .ant-table-footer { background-color: transparent; padding: 8px; @@ -241,10 +244,13 @@ width: 100%; } - input, .ant-input-affix-wrapper, .ant-input-number { + input, + .ant-input-affix-wrapper, + .ant-input-number { &:not(:hover) { background: transparent; } + border: 0; padding: 0; box-shadow: none !important; @@ -252,13 +258,16 @@ height: 100%; } - .ant-input-status-error, .ant-input-status-warning { + .ant-input-status-error, + .ant-input-status-warning { border: 0 !important; } + input.ant-input-status-error, .ant-input-status-error input { color: var(--ant-color-error); } + input.ant-input-status-warning, .ant-input-status-warning input { color: var(--ant-color-warning); @@ -270,11 +279,13 @@ .ant-select { width: 100%; + .ant-select-selector { background: transparent; padding-top: 0; padding-bottom: 0; } + &:not(.ant-select-focused) { .ant-select-selection-placeholder { // Align the placeholder with the other inputs @@ -285,18 +296,22 @@ // Table - th, td { + th, + td { padding: 2px 4px; text-align: left; color: var(--ant-color-text-base); } + th { font-weight: normal; } - th, tr:nth-child(even) td { + th, + tr:nth-child(even) td { background-color: var(--compact-table-bg1); } + td { background-color: var(--compact-table-bg2); } @@ -304,6 +319,7 @@ td:nth-child(2):not(:last-child) { border-right: 0; } + td:nth-child(3) { border-left: 0; } @@ -327,11 +343,12 @@ tr td:first-child { border-left: 1px solid var(--compact-table-border); } + tr:first-child th { border-top: solid 1px var(--compact-table-border); } - tr:first-child th:first-child{ + tr:first-child th:first-child { border-top-left-radius: var(--ant-border-radius); } @@ -346,4 +363,4 @@ tr:last-child td:last-child { border-bottom-right-radius: var(--ant-border-radius); } -} +} \ No newline at end of file