Description
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
- Uses stable selection from feat(viewer): add molecular picking and selection #28/engine(viewer): establish renderer-neutral viewer core state and update boundaries #33.
- Camera semantics belong to viewer/renderer-neutral state or commands; GPUI/browser code should only adapt input.
- This issue should not introduce a second selection or representation state model.
Alternatives Considered
Keep the current orbit/pan/zoom implementation and add semantic commands around it rather than replacing the camera backend immediately.
Activity
[-]feat: improve molecular camera and interaction controls[/-][+]feat(viewer): improve molecular camera and interaction controls[/+]