Skip to content

Distinguish viewer layers from image slices - #2

Merged
trissim merged 1 commit into
mainfrom
agent/napari-layer-mode
Aug 1, 2026
Merged

Distinguish viewer layers from image slices#2
trissim merged 1 commit into
mainfrom
agent/napari-layer-mode

Conversation

@trissim

@trissim trissim commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Outcome

Add the missing shared viewer placement term for components that route to separate Napari layers.

What changed

  • add ViewerComponentMode.LAYER = "layer"
  • retain ViewerComponentMode.SLICE = "slice" for genuine Fiji/ImageJ Z-slice placement
  • add a contract regression proving the two meanings remain distinct

Verification

PYTHONPATH=src ../../.venv/bin/python -m pytest tests/test_viewer_protocol.py -q
4 passed

PYTHONPATH=src ../../.venv/bin/python -m ruff check --select E9,F63,F7,F82 src/zmqruntime/viewer_protocol.py tests/test_viewer_protocol.py
All checks passed

No package version or release is included.

@trissim
trissim marked this pull request as ready for review August 1, 2026 17:46
Copilot AI review requested due to automatic review settings August 1, 2026 17:46
@trissim
trissim merged commit 058f072 into main Aug 1, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR clarifies viewer component placement semantics by introducing an explicit layer placement mode for components that map to separate Napari layers, while preserving slice specifically for Z-plane (Fiji/ImageJ-style) placement.

Changes:

  • Add ViewerComponentMode.LAYER = "layer" to the shared viewer protocol enum.
  • Preserve ViewerComponentMode.SLICE = "slice" as a distinct mode for plane/Z-slice placement.
  • Add a regression test asserting the two wire values remain distinct and stable.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/zmqruntime/viewer_protocol.py Adds the LAYER enum value to the shared viewer component placement modes.
tests/test_viewer_protocol.py Adds a contract/regression test asserting the layer vs slice wire values.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@augmentcode augmentcode Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Risk Analyzer Agent🛡️

Risk Analysis 🛡️ · Low Risk

✅ Approved — Low-Risk Change

Details Additive change: adds one enum member `ViewerComponentMode.LAYER = "layer"` and a test asserting `LAYER` and `SLICE` keep distinct wire values. No runtime dispatch enumerates the full member set — modes resolve by string value via `viewer_component_mode_value`, and unrecognized modes are handled gracefully in `component_mode_groups`. No existing tests were altered and no sensitive areas are touched.

@augmentcode augmentcode Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deep Code Review Agent🐛

Review completed with 0 suggestions.

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.

2 participants