Skip to content

Split 'r' hotkey: fold-only vs full view reset#617

Open
Copilot wants to merge 2 commits intomainfrom
copilot/update-hotkey-for-refolding-brain
Open

Split 'r' hotkey: fold-only vs full view reset#617
Copilot wants to merge 2 commits intomainfrom
copilot/update-hotkey-for-refolding-brain

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 3, 2026

The r hotkey conflated two distinct operations: folding the brain and resetting camera position — while not even resetting zoom, making it neither a clean fold nor a true reset.

Changes

  • r key — now only folds the brain (mix → 0) without touching camera target, azimuth, altitude, or radius
  • t key (new) — full view reset: folds brain + resets camera to defaults (target=[0,0,0], azimuth=45°, altitude=75°, radius=400)
  • Docs — updated keyboard shortcut table and Camera Controls section in docs/userguide/webgl.rst

Relevant diff (mriview.js)

// r: fold only (no camera movement)
var fold_brain = function() {
    this.animate([{state:'mix', idx:parseFloat(viewopts.anim_speed), value:0}]);
}.bind(this);

// t: full reset
this.reset_view = function() {
    this.animate([
        {state:'camera.target',   idx:parseFloat(viewopts.anim_speed), value:[0,0,0]},
        {state:'camera.azimuth',  idx:parseFloat(viewopts.anim_speed), value:45},
        {state:'camera.altitude', idx:parseFloat(viewopts.anim_speed), value:75},
        {state:'camera.radius',   idx:parseFloat(viewopts.anim_speed), value:400},
        {state:'mix',             idx:parseFloat(viewopts.anim_speed), value:0},
    ]);
}.bind(this);

Copilot AI linked an issue Apr 3, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Update hotkey for re-folding brain without resetting view Split 'r' hotkey: fold-only vs full view reset Apr 3, 2026
Copilot AI requested a review from mvdoc April 3, 2026 21:36
Copilot finished work on behalf of mvdoc April 3, 2026 21:36
@mvdoc
Copy link
Copy Markdown
Contributor

mvdoc commented Apr 3, 2026

@copilot update the help window too if necessary

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 3, 2026

@copilot update the help window too if necessary

The help window is auto-generated by iterating over the UI descriptor objects (including this.ui._desc.camera._desc). Since both new entries already have key and help properties — fold: {action:fold_brain, key:'r', help:'Fold brain'} and reset: {action:this.reset_view, key:'t', help:'Reset view'} — they will appear correctly in the help overlay without any additional changes needed.

Copilot finished work on behalf of mvdoc April 3, 2026 21:41
@mvdoc mvdoc requested a review from marklescroart April 3, 2026 21:41
@mvdoc mvdoc marked this pull request as ready for review April 3, 2026 21:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

hotkey change for re-folding brain

2 participants