Skip to content

Fix off-by-one when clamping to dataset bounding box - #9936

Open
philippotto wants to merge 3 commits into
masterfrom
fix-off-by-one-ds-clamping
Open

Fix off-by-one when clamping to dataset bounding box#9936
philippotto wants to merge 3 commits into
masterfrom
fix-off-by-one-ds-clamping

Conversation

@philippotto

@philippotto philippotto commented Aug 25, 2026

Copy link
Copy Markdown
Member

Summary

Fixes off-by-one bug when clamping current position to the dataset bounding box.

Steps to test:

  • scroll to last section -> should still show the image

Issues:


(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 if applicable
  • Adapted wk-libs python client if relevant API parts change
  • Removed dev-only changes like prints and application.conf edits
  • Considered common edge cases
  • Needs datastore update after deployment

@philippotto philippotto self-assigned this Aug 25, 2026
@philippotto philippotto added the autodeploy Automatically create dev deployment on successful CI run label Aug 25, 2026
@coderabbitai

coderabbitai Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: f26f298d-4afc-4ba9-9cad-a7ddafdd011b

📥 Commits

Reviewing files that changed from the base of the PR and between 6e507ad and 5f44dda.

📒 Files selected for processing (3)
  • frontend/javascripts/viewer/model/accessors/dataset_layer_transformation_accessor.ts
  • frontend/javascripts/viewer/model/reducers/flycam_reducer.ts
  • unreleased_changes/9936.md

Included review availability: Your plan provides up to 2 included reviews per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The change documents exclusive dataset bounds and updates flycam clamping to use the final valid voxel coordinate. A changelog entry records the correction for last-section scrolling in XY, XZ, and YZ views.

Changes

Dataset bounds

Layer / File(s) Summary
Clamp flycam positions to dataset voxels
frontend/javascripts/viewer/model/accessors/dataset_layer_transformation_accessor.ts, frontend/javascripts/viewer/model/reducers/flycam_reducer.ts, unreleased_changes/9936.md
The accessor documents exclusive maximum bounds. The flycam reducer clamps moved axes to max[i] - 1. The changelog records the last-section scrolling fix.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 5f44d

This localized change corrects dataset-boundary clamping so the last section continues to display its image; no actionable merge-blocking risk remains beyond normal checks and review.

Suggested reviewers: michaelbuessemeyer

Poem

A rabbit checks the bounds with care

And finds the final voxel there
The flycam stops one step before
No off-by-one hops anymore
XY, XZ, YZ align
The dataset edges now look fine

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 2 files. (1 skipped: 1 …
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly and concisely describes the main change: fixing the off-by-one error when clamping to the dataset bounding box.
Description check ✅ Passed The description directly explains the off-by-one fix, expected scrolling behavior, testing steps, issue reference, and changelog update.
Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 2 files. (1 skipped: 1 unsupported.)

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-off-by-one-ds-clamping

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@philippotto
philippotto enabled auto-merge (squash) August 26, 2026 08:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autodeploy Automatically create dev deployment on successful CI run

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants