inspector icon indicating copy to clipboard operation
inspector copied to clipboard

[FEATURE] Auto-adjust diagram zoom/pan to the participants involved in the current step

Open QY-25123 opened this issue 4 months ago • 3 comments

Feature

In the OAuth Debugger's sequence diagram, when the interaction moves between participants that are far apart (e.g. Step 5 switches from Client–MCP Server to Client–Authorization Server), the diagram view doesn't follow. Since the two participants sit far apart horizontally, the current pan/zoom only shows the empty space between them and misses the actual message content, as shown in the attached screenshot.

Solution

Automatically adjust zoom/pan (fit-to-view or center-and-zoom) to the two participants relevant to the currently active step whenever the step changes, so the interaction is always fully visible without manual scrolling/zooming.

Alternatives

  • Keep manual zoom, but add a "Focus this step" action (distinct from the existing "Show in diagram") that recenters the view.
  • Add a mini-map indicator showing which part of the diagram is off-screen.

Additional Context

Screenshot attached showing Step 5's interaction only partially visible in the diagram.

Image

QY-25123 avatar Aug 05 '26 23:08 QY-25123

thanks for the feedback @QY-25123 will take a look into the issue, please dont forget to attach the screenshot!

olartgabo avatar Aug 05 '26 23:08 olartgabo

Thanks for the reminder! I’ve attached the screenshot showing the issue at Step 5. Please let me know if you need any additional information.

QY-25123 avatar Aug 06 '26 00:08 QY-25123

Hi @chelojimenez, I'd like to take this one. The cause looks like client/src/components/oauth/shared/DiagramLayout.tsx: each step centers on the midpoint of its two participants at a fixed zoom: 1.2, so a step between far-apart participants (like Step 5, Client ↔ Authorization Server) can't fit both ends. I'd compute the zoom from the step's horizontal span against the pane width, capped at the current 1.2, so short steps look the same and long ones zoom out enough to show both participants. It would keep the existing rule that an unchanged diagram preserves the user's pan and zoom, and I'd add a test next to DiagramLayout.visibility.test.tsx. Sound OK? Also, the PR template asks for a Kestral task. How should outside contributors fill that in?

helloigig avatar Nov 03 '26 03:11 helloigig