Skip to content

Commit

Permalink
Remove unnecessary scrollbars in skeleton tab (#8148)
Browse files Browse the repository at this point in the history
* make button bar flexbox

* remove unnessecary scrollbars

* line break group names

* style buttons

* remove stand-alone style

* add changelog

* adress review
  • Loading branch information
knollengewaechs authored Nov 11, 2024
1 parent c13694c commit 078fc20
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 52 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ For upgrade instructions, please check the [migration guide](MIGRATIONS.released
- Fixed a bug where you could not create annotations for public datasets of other organizations. [#8107](https://github.com/scalableminds/webknossos/pull/8107)
- Users without edit permissions to a dataset can no longer delete sharing tokens via the API. [#8083](https://github.com/scalableminds/webknossos/issues/8083)
- Fixed downloading task annotations of teams you are not in, when accessing directly via URI. [#8155](https://github.com/scalableminds/webknossos/pull/8155)
- Removed unnecessary scrollbars in skeleton tab that occurred especially after resizing. [#8148](https://github.com/scalableminds/webknossos/pull/8148)
- Deleting a bounding box is now possible independently of a visible segmentation layer. [#8164](https://github.com/scalableminds/webknossos/pull/8164)
- S3-compliant object storages can now be accessed via HTTPS. [#8167](https://github.com/scalableminds/webknossos/pull/8167)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ export function ColoredDotIcon({ colorRGBA }: { colorRGBA: Vector4 }) {
style={{
paddingLeft: "10px",
backgroundColor: rgbaCss,
alignSelf: "flex-start",
marginTop: 5,
}}
/>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -852,7 +852,7 @@ class SkeletonTabView extends React.PureComponent<Props, State> {
);

return (
<div id={treeTabId} className="padded-tab-content">
<div id={treeTabId} className="padded-tab-content" style={{ overflow: "hidden" }}>
<DomVisibilityObserver targetId={treeTabId}>
{(isVisibleInDom) =>
!isVisibleInDom ? null : (
Expand All @@ -870,52 +870,57 @@ class SkeletonTabView extends React.PureComponent<Props, State> {
<Spin />
</Modal>
<Space.Compact className="compact-icons">
<AdvancedSearchPopover
onSelect={this.handleSearchSelect}
data={this.getTreeAndTreeGroupList(trees, treeGroups, orderAttribute)}
searchKey="name"
provideShortcut
targetId={treeTabId}
onSelectAllMatches={this.handleSelectAllMatchingTrees}
>
<ButtonComponent title="Open the search via CTRL + Shift + F">
<SearchOutlined />
<div className="compact-buttons">
<AdvancedSearchPopover
onSelect={this.handleSearchSelect}
data={this.getTreeAndTreeGroupList(trees, treeGroups, orderAttribute)}
searchKey="name"
provideShortcut
targetId={treeTabId}
onSelectAllMatches={this.handleSelectAllMatchingTrees}
>
<ButtonComponent
title="Open the search via CTRL + Shift + F"
className="firstButton"
>
<SearchOutlined />
</ButtonComponent>
</AdvancedSearchPopover>
<ButtonComponent
onClick={this.props.onCreateTree}
title={isEditingDisabled ? isEditingDisabledMessage : "Create new Tree (C)"}
disabled={isEditingDisabled}
>
<i className="fas fa-plus" />
</ButtonComponent>
</AdvancedSearchPopover>
<ButtonComponent
onClick={this.props.onCreateTree}
title={isEditingDisabled ? isEditingDisabledMessage : "Create new Tree (C)"}
disabled={isEditingDisabled}
>
<i className="fas fa-plus" />
</ButtonComponent>
<ButtonComponent
onClick={this.handleDelete}
title={isEditingDisabled ? isEditingDisabledMessage : "Delete Selected Trees"}
disabled={isEditingDisabled}
>
<i className="far fa-trash-alt" />
</ButtonComponent>
<ButtonComponent
onClick={this.toggleAllTrees}
title="Toggle Visibility of All Trees (1)"
disabled={isEditingDisabled}
>
<i className="fas fa-toggle-on" />
</ButtonComponent>
<ButtonComponent
onClick={this.toggleInactiveTrees}
title="Toggle Visibility of Inactive Trees (2)"
disabled={isEditingDisabled}
>
<i className="fas fa-toggle-off" />
</ButtonComponent>
<Dropdown menu={this.getActionsDropdown()} trigger={["click"]}>
<ButtonComponent>
More
<DownOutlined />
<ButtonComponent
onClick={this.handleDelete}
title={isEditingDisabled ? isEditingDisabledMessage : "Delete Selected Trees"}
disabled={isEditingDisabled}
>
<i className="far fa-trash-alt" />
</ButtonComponent>
</Dropdown>
<ButtonComponent
onClick={this.toggleAllTrees}
title="Toggle Visibility of All Trees (1)"
disabled={isEditingDisabled}
>
<i className="fas fa-toggle-on" />
</ButtonComponent>
<ButtonComponent
onClick={this.toggleInactiveTrees}
title="Toggle Visibility of Inactive Trees (2)"
disabled={isEditingDisabled}
>
<i className="fas fa-toggle-off" />
</ButtonComponent>
<Dropdown menu={this.getActionsDropdown()} trigger={["click"]}>
<ButtonComponent style={{ overflow: "clip" }} className="lastButton">
More
<DownOutlined />
</ButtonComponent>
</Dropdown>
</div>
</Space.Compact>
<Space.Compact className="compact-icons compact-items">
<ButtonComponent
Expand All @@ -938,7 +943,7 @@ class SkeletonTabView extends React.PureComponent<Props, State> {
<i className="fas fa-arrow-right" />
</ButtonComponent>
<Dropdown menu={this.getSettingsDropdown()} trigger={["click"]}>
<ButtonComponent title="Sort">
<ButtonComponent title="Sort" style={{ overflow: "clip" }}>
<i className="fas fa-sort-alpha-down" />
</ButtonComponent>
</Dropdown>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,10 @@ export function renderTreeNode(

return (
<div
className="nowrap"
onContextMenu={(evt) =>
onOpenContextMenu(createMenuForTree(tree, props, hideContextMenu), evt)
}
style={{ wordBreak: "break-word" }}
>
<ColoredDotIcon colorRGBA={[...tree.color, 1.0]} />
{`(${tree.nodes.size()}) `} {maybeProofreadingIcon} {tree.name}
Expand Down Expand Up @@ -208,18 +208,16 @@ export function renderGroupNode(
const displayableName = name.trim() || "<Unnamed Group>";
return (
<div
className="nowrap"
onContextMenu={(evt) =>
onOpenContextMenu(
createMenuForTreeGroup(props, hideContextMenu, node, expandedNodeKeys),
evt,
)
}
style={{ wordBreak: "break-word" }}
>
<span>
<FolderOutlined className="icon-margin-right" />
{displayableName}
</span>
<FolderOutlined className="icon-margin-right" />
{displayableName}
</div>
);
}
Expand Down
21 changes: 21 additions & 0 deletions frontend/stylesheets/trace_view/_right_menu.less
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,27 @@
}
}

.compact-buttons{
display: "inline-flex";
flex-wrap: "wrap";

button{
border-radius: 0px;
margin-inline: -1px;
margin-top: -1px;
}

button.firstButton{
border-top-left-radius: 4px;
border-bottom-left-radius: 4px;
}

button.lastButton{
border-top-right-radius: 4px;
border-bottom-right-radius: 4px;
}
}

.margin-bottom {
margin-bottom: 10px;
}
Expand Down

0 comments on commit 078fc20

Please sign in to comment.