feat(gsps): add next-overlay navigation button and shortcut#32
feat(gsps): add next-overlay navigation button and shortcut#32
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds GSPS navigation to the viewer: computes per-frame/viewport GSPS targets, cycles to the next target (keyboard and UI), updates frame/viewport state, schedules repaints, and includes unit tests for single and multi-viewport scenarios. Changes
Sequence DiagramsequenceDiagram
participant User as "User\n(running client)"
participant Input as "Input Handler\n(key/UI)"
participant Nav as "Navigation Logic\n(app.rs)"
participant GSPS as "GSPS Data\n(dicom / overlays)"
participant State as "Frame/Viewport State\n(app state)"
participant UI as "Renderer\n(redraw)"
User->>Input: Press N / Click Next GSPS
Input->>Nav: jump_to_next_gsps_overlay()
Nav->>GSPS: gsps_navigation_targets()
GSPS-->>Nav: target list
Nav->>Nav: next_gsps_navigation_target()
Nav->>State: update frame index or viewport index
State->>UI: schedule repaint
UI->>User: render updated frame/overlay
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/app.rs`:
- Around line 428-430: The Next GSPS action currently returns the same index
when GSPS is hidden (match arm Some(index) => index), causing the first press to
be a no-op; change the logic in the handler that computes target_index (using
symbols targets, current_target, self.gsps_overlay_visible) so that it always
advances to the next target (e.g., make the Some(index) case wrap to (index + 1)
% targets.len() instead of returning index), and add a regression test that
starts with the current target having GSPS hidden to assert that pressing "Next
GSPS (N)" advances to the next target and shows its overlay.
Summary by CodeRabbit