Skip to content

Commit

Permalink
Merge branch 'master' into async-file-vault
Browse files Browse the repository at this point in the history
  • Loading branch information
fm3 committed Nov 12, 2024
2 parents 8dbd347 + 8dec578 commit 28ddb66
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 16 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ For upgrade instructions, please check the [migration guide](MIGRATIONS.released
- Fix that scrolling in the trees and segments tab did not work while dragging. [#8162](https://github.com/scalableminds/webknossos/pull/8162)
- Fixed that uploading a dataset which needs a conversion failed when the angstrom unit was configured for the conversion. [#8173](https://github.com/scalableminds/webknossos/pull/8173)
- Fixed that the skeleton search did not automatically expand groups that contained the selected tree [#8129](https://github.com/scalableminds/webknossos/pull/8129)
- Fixed interactions in the trees and segments tab like the search due to a bug introduced by [#8162](https://github.com/scalableminds/webknossos/pull/8162). [#8186](https://github.com/scalableminds/webknossos/pull/8186)
- Fixed a bug that zarr streaming version 3 returned the shape of mag (1, 1, 1) / the finest mag for all mags. [#8116](https://github.com/scalableminds/webknossos/pull/8116)
- Fixed sorting of mags in outbound zarr streaming. [#8125](https://github.com/scalableminds/webknossos/pull/8125)
- Fixed a bug where you could not create annotations for public datasets of other organizations. [#8107](https://github.com/scalableminds/webknossos/pull/8107)
Expand All @@ -44,6 +45,7 @@ For upgrade instructions, please check the [migration guide](MIGRATIONS.released
- 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)
- Fixed that skeleton tree nodes were created with the wrong mag. [#8185](https://github.com/scalableminds/webknossos/pull/8185)
- Fixed a layout persistence bug leading to empty viewports, triggered when switching between orthogonal, flight, or oblique mode. [#8177](https://github.com/scalableminds/webknossos/pull/8177)

### Removed
Expand Down
4 changes: 2 additions & 2 deletions frontend/javascripts/oxalis/model/helpers/nml_helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ function serializeNodes(
rotY: node.rotation[1],
rotZ: node.rotation[2],
inVp: node.viewport,
inMag: node.mag,
inMag: node.resolution,
bitDepth: node.bitDepth,
interpolation: node.interpolation,
time: node.timestamp,
Expand Down Expand Up @@ -963,7 +963,7 @@ export function parseNml(nmlString: string): Promise<{
}),
bitDepth: _parseInt(attr, "bitDepth", { defaultValue: DEFAULT_BITDEPTH }),
viewport: _parseInt(attr, "inVp", { defaultValue: DEFAULT_VIEWPORT }),
mag: _parseInt(attr, "inMag", { defaultValue: DEFAULT_RESOLUTION }),
resolution: _parseInt(attr, "inMag", { defaultValue: DEFAULT_RESOLUTION }),
radius: _parseFloat(attr, "radius", { defaultValue: Constants.DEFAULT_NODE_RADIUS }),
timestamp: _parseTimestamp(attr, "time", { defaultValue: DEFAULT_TIMESTAMP }),
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export function createNode(
radius,
rotation,
viewport,
mag: resolution,
resolution,
id: nextNewId,
timestamp,
bitDepth: state.datasetConfiguration.fourBit ? 4 : 8,
Expand Down Expand Up @@ -846,7 +846,7 @@ function serverNodeToMutableNode(n: ServerNode): MutableNode {
rotation: Utils.point3ToVector3(n.rotation),
bitDepth: n.bitDepth,
viewport: n.viewport,
mag: n.resolution,
resolution: n.resolution,
radius: n.radius,
timestamp: n.createdTimestamp,
interpolation: n.interpolation,
Expand Down
2 changes: 1 addition & 1 deletion frontend/javascripts/oxalis/model/sagas/proofread_saga.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ function* createEditableMapping(): Saga<string> {
// Get volume tracing again to make sure the version is up to date
const upToDateVolumeTracing = yield* select((state) => getActiveSegmentationTracing(state));
if (upToDateVolumeTracing == null) {
throw new Error("No active segmentation tracing layer. Cannot create editble mapping.");
throw new Error("No active segmentation tracing layer. Cannot create editable mapping.");
}

const volumeTracingId = upToDateVolumeTracing.tracingId;
Expand Down
2 changes: 1 addition & 1 deletion frontend/javascripts/oxalis/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export type MutableNode = {
rotation: Vector3;
bitDepth: number;
viewport: number;
mag: number;
resolution: number;
radius: number;
timestamp: number;
interpolation: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ const synapseNodeCreator = (synapseId: number, synapsePosition: Vector3): Mutabl
radius: Constants.DEFAULT_NODE_RADIUS,
rotation: [0, 0, 0],
viewport: 0,
mag: 0,
resolution: 0,
id: synapseId,
timestamp: Date.now(),
bitDepth: 8,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Tree as AntdTree, type TreeProps } from "antd";
import type { BasicDataNode } from "antd/es/tree";
import { throttle } from "lodash";
import { useCallback, useRef } from "react";
import { forwardRef, useCallback, useRef } from "react";
import type RcTree from "rc-tree";

const MIN_SCROLL_SPEED = 30;
Expand All @@ -10,8 +10,10 @@ const MIN_SCROLL_AREA_HEIGHT = 60;
const SCROLL_AREA_RATIO = 10; // 1/10th of the container height
const THROTTLE_TIME = 25;

function ScrollableVirtualizedTree<T extends BasicDataNode>(
props: TreeProps<T> & { ref: React.RefObject<RcTree> },
// React.forwardRef does not support generic types, so we need to define the type of the ref separately.
function ScrollableVirtualizedTreeInner<T extends BasicDataNode>(
props: TreeProps<T>,
ref: React.Ref<RcTree>,
) {
const wrapperRef = useRef<HTMLDivElement>(null);
// biome-ignore lint/correctness/useExhaustiveDependencies: biome is not smart enough to notice that the function needs to be re-created when wrapperRef changes.
Expand Down Expand Up @@ -56,9 +58,15 @@ function ScrollableVirtualizedTree<T extends BasicDataNode>(

return (
<div ref={wrapperRef}>
<AntdTree {...props} onDragOver={onDragOver} />
<AntdTree {...props} onDragOver={onDragOver} ref={ref} />
</div>
);
}

const ScrollableVirtualizedTree = forwardRef(ScrollableVirtualizedTreeInner) as <
T extends BasicDataNode,
>(
props: TreeProps<T> & { ref?: React.Ref<RcTree> },
) => ReturnType<typeof ScrollableVirtualizedTreeInner>;

export default ScrollableVirtualizedTree;
Original file line number Diff line number Diff line change
Expand Up @@ -1904,7 +1904,7 @@ class SegmentsView extends React.Component<Props, State> {
overflow: "hidden",
}}
>
<ScrollableVirtualizedTree<SegmentHierarchyNode>
<ScrollableVirtualizedTree
allowDrop={this.allowDrop}
onDrop={this.onDrop}
onSelect={this.onSelectTreeItem}
Expand Down
2 changes: 1 addition & 1 deletion frontend/javascripts/test/libs/nml.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const createDummyNode = (id: number): Node => ({
untransformedPosition: [id, id, id],
additionalCoordinates: [],
radius: id,
mag: 10,
resolution: 10,
rotation: [id, id, id],
timestamp: id,
viewport: 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ test("SkeletonTracing should add a new node", (t) => {
untransformedPosition: position,
rotation,
viewport,
mag: resolution,
resolution,
id: 1,
radius: 1,
});
Expand Down Expand Up @@ -295,7 +295,7 @@ test("SkeletonTracing should delete nodes and split the tree", (t) => {
untransformedPosition: [0, 0, 0],
additionalCoordinates: null,
radius: 10,
mag: 10,
resolution: 10,
rotation: [0, 0, 0],
timestamp: 0,
viewport: 1,
Expand Down Expand Up @@ -453,7 +453,7 @@ test("SkeletonTracing should delete an edge and split the tree", (t) => {
untransformedPosition: [0, 0, 0],
additionalCoordinates: null,
radius: 10,
mag: 10,
resolution: 10,
rotation: [0, 0, 0],
timestamp: 0,
viewport: 1,
Expand Down

0 comments on commit 28ddb66

Please sign in to comment.