-
Notifications
You must be signed in to change notification settings - Fork 31
Cleanup mjs module #9059
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: master
Are you sure you want to change the base?
Cleanup mjs module #9059
Conversation
📝 WalkthroughWalkthroughReplaces Float32Array/typed-array defaults with plain JavaScript arrays across the mjs utilities and related viewers, introduces explicit Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
### Steps to test: - CI -- - [x] Needs datastore update after deployment --------- Co-authored-by: MichaelBuessemeyer <[email protected]>
### URL of deployed dev instance (used for testing): - https://datasetliststorage.webknossos.xyz ### Steps to test: - hit `yarn enable-storage-scan`, wait for next tick (every 10 minutes, 1 minute after startup, can be changed in application.conf) - after scan, see used storage in dashboard ### TODOs: - [x] Hide column if orga total used storage is 0 - [x] Gather feedback on tooltip wording and coulmn name (size vs storage vs ??) -> https://scm.slack.com/archives/C5AKLAV0B/p1761836548789409 - [x] CI (api types mismatch?) ### Issues: - contributes to #9005 ------ - [x] Added changelog entry (create a `$PR_NUMBER.md` file in `unreleased_changes` or use `./tools/create-changelog-entry.py`) - [x] Removed dev-only changes like prints and application.conf edits - [x] Considered [common edge cases](../blob/master/.github/common_edge_cases.md) --------- Co-authored-by: Charlie Meister <[email protected]> Co-authored-by: Charlie Meister <[email protected]> Co-authored-by: MichaelBuessemeyer <[email protected]>
### URL of deployed dev instance (used for testing): - https://___.webknossos.xyz ### Steps to test: - Open a publicly available annotation without being logged in -> no error toast :) - I tested this on commit ea18578 (the merge of #8961) ### TODOs: - [ ] test on current master. Wasnt able to run wk locally this morning (https://scm.slack.com/archives/C5AKLAV0B/p1762768096605689) ### Issues: - fixes https://scm.slack.com/archives/C5AKLAV0B/p1762764001604969 - follow-up for #8961 ------ (Please delete unneeded items, merge only when none are left open) - [ ] Added changelog entry (create a `$PR_NUMBER.md` file in `unreleased_changes` or use `./tools/create-changelog-entry.py`) - [ ] Added migration guide entry if applicable (edit the same file as for the changelog) - [ ] Updated [documentation](../blob/master/docs) if applicable - [ ] Adapted [wk-libs python client](https://github.com/scalableminds/webknossos-libs/tree/master/webknossos/webknossos/client) if relevant API parts change - [ ] Removed dev-only changes like prints and application.conf edits - [ ] Considered [common edge cases](../blob/master/.github/common_edge_cases.md) - [ ] Needs datastore update after deployment
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
frontend/javascripts/viewer/model/sagas/volumetracing_saga.tsx (1)
292-300: Strip debug logging before shipping.This console.log will fire for every brush step and flood the browser console in production. Please remove it (or guard it behind a proper logger/debug flag) before merging.
- console.log("Brushing between:", lastPosition, addToLayerAction.position);
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
frontend/javascripts/libs/mjs.ts(10 hunks)frontend/javascripts/types/mjs.d.ts(0 hunks)frontend/javascripts/viewer/api/api_latest.ts(2 hunks)frontend/javascripts/viewer/constants.ts(2 hunks)frontend/javascripts/viewer/model/bucket_data_handling/bucket_picker_strategies/flight_bucket_picker.ts(1 hunks)frontend/javascripts/viewer/model/sagas/volumetracing_saga.tsx(1 hunks)
💤 Files with no reviewable changes (1)
- frontend/javascripts/types/mjs.d.ts
🧰 Additional context used
🧠 Learnings (3)
📚 Learning: 2024-11-22T17:18:04.217Z
Learnt from: dieknolle3333
Repo: scalableminds/webknossos PR: 8168
File: frontend/javascripts/oxalis/model/sagas/proofread_saga.ts:1039-1039
Timestamp: 2024-11-22T17:18:04.217Z
Learning: In `frontend/javascripts/oxalis/model/sagas/proofread_saga.ts`, when calling `getMagInfo`, the use of `volumeTracingLayer.resolutions` is intentional and should not be changed to `volumeTracingLayer.mags`.
Applied to files:
frontend/javascripts/viewer/model/sagas/volumetracing_saga.tsx
📚 Learning: 2024-11-22T17:18:43.411Z
Learnt from: dieknolle3333
Repo: scalableminds/webknossos PR: 8168
File: frontend/javascripts/oxalis/geometries/materials/plane_material_factory.ts:568-585
Timestamp: 2024-11-22T17:18:43.411Z
Learning: In the file `frontend/javascripts/oxalis/geometries/materials/plane_material_factory.ts`, the uniform name `allResolutions` should remain unchanged to maintain consistency with the shader code.
Applied to files:
frontend/javascripts/viewer/constants.ts
📚 Learning: 2025-07-22T12:56:47.507Z
Learnt from: daniel-wer
Repo: scalableminds/webknossos PR: 8787
File: frontend/javascripts/viewer/model/accessors/dataset_layer_transformation_accessor.ts:132-136
Timestamp: 2025-07-22T12:56:47.507Z
Learning: Three.js Vector3 has explicitly defined x, y, and z properties that can be safely accessed via dynamic string indexing when using union types like "x" | "y" | "z". The pattern `vector[axis] = value` where axis is "x" | "y" | "z" does not cause TypeScript strict mode errors because TypeScript can infer the property access is valid.
Applied to files:
frontend/javascripts/viewer/constants.tsfrontend/javascripts/libs/mjs.ts
🧬 Code graph analysis (5)
frontend/javascripts/viewer/model/sagas/volumetracing_saga.tsx (1)
frontend/javascripts/viewer/model/actions/volumetracing_actions.ts (1)
addToLayerAction(180-184)
frontend/javascripts/viewer/model/bucket_data_handling/bucket_picker_strategies/flight_bucket_picker.ts (2)
frontend/javascripts/libs/mjs.ts (1)
M4x4(402-402)frontend/javascripts/viewer/constants.ts (1)
Vector3(15-15)
frontend/javascripts/viewer/api/api_latest.ts (2)
frontend/javascripts/libs/mjs.ts (1)
Matrix4x4(33-33)frontend/javascripts/types/mjs.d.ts (1)
Matrix4x4(6-24)
frontend/javascripts/viewer/constants.ts (1)
frontend/javascripts/libs/mjs.ts (1)
Vector16(15-32)
frontend/javascripts/libs/mjs.ts (2)
frontend/javascripts/types/mjs.d.ts (1)
Matrix4x4(6-24)frontend/javascripts/viewer/constants.ts (2)
Vector3(15-15)Vector2(14-14)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: backend-tests
- GitHub Check: build-smoketest-push
|
@ philippotto |
philippotto
left a comment
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.
thank you for doing this!
| const scaledPosition = V3.multiply(originalPosition, this.datasetScaleFactor); | ||
| // The offset is in world space already so no scaling is necessary. | ||
| const offsetPosition = V3.add(scaledPosition, positionOffset); | ||
| const offsetPosition: Vector3 = V3.add(scaledPosition, positionOffset); |
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.
shouldn't the return value of V3.add automatically be Vector3?
| // In addition, the variables stepX and stepY are initialized to either 1 or -1 indicating whether X and Y are | ||
| // incremented or decremented as the ray crosses voxel boundaries (this is determined by the sign of the x and y components of → v). | ||
| const [stepX, stepY, stepZ] = v.map((el) => Math.sign(el)); | ||
| const [stepX, stepY, stepZ] = v.map((el: number) => Math.sign(el)); |
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.
why is this change necessary?
| r?: Int32Array | Array<number> | null | undefined, | ||
| ): Int32Array | Array<number> { |
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.
why is Int32Array necessary here?
URL of deployed dev instance (used for testing):
Steps to test:
TODOs:
Issues:
(Please delete unneeded items, merge only when none are left open)
$PR_NUMBER.mdfile inunreleased_changesor use./tools/create-changelog-entry.py)