Skip to content

feat(viewer): improve molecular camera and interaction controls #32

Open

Description

@meashgrey

Problem

The viewer has basic orbit, pan, zoom, and reset behavior, but reliable scientific inspection requires explicit camera operations tied to structure and selection semantics.

Desktop and browser interaction behavior should not drift into separate camera implementations.

Proposal

Define renderer-neutral camera commands/state transitions and map desktop/browser pointer input onto them.

Add fit, center, focus-selection, projection selection, and stable navigation behavior without resetting camera state during unrelated representation changes.

Proposed Commands

Conceptually:

CameraCommand
  ├── FitStructure
  ├── FitSelection
  ├── CenterSelection
  ├── FocusSelection
  ├── SetProjection
  └── ResetView

Frontend gestures remain platform-specific, but semantic camera commands should be shared.

Product Area

Molecule / structure viewer

Acceptance Criteria

  • User can fit the complete structure to the viewport.
  • User can fit/focus/center the current selection.
  • Double-click or an explicit command can focus a picked object.
  • Perspective and orthographic projection can be selected.
  • Pointer/wheel/modifier behavior is internally consistent in desktop.
  • Browser controls map to the same semantic camera operations where supported.
  • Camera commands are safe for empty and very large scenes.
  • Camera state survives representation changes unless an explicit camera command requests otherwise.
  • Camera bounds include the active visual representation radius where necessary.
  • Tests cover fit bounds, selection focus, projection changes, and input direction conventions.

Relationship to Other Issues

Alternatives Considered

Keep the current orbit/pan/zoom implementation and add semantic commands around it rather than replacing the camera backend immediately.

Activity

  1. added
    enhancement
    on Sep 5, 2026
  2. changed the title [-]feat: improve molecular camera and interaction controls[/-] [+]feat(viewer): improve molecular camera and interaction controls[/+] on Oct 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions