Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preview zoom/scroll issues #102

Open
synclpz opened this issue Jul 15, 2020 · 3 comments
Open

Preview zoom/scroll issues #102

synclpz opened this issue Jul 15, 2020 · 3 comments

Comments

@synclpz
Copy link

synclpz commented Jul 15, 2020

Expected behaviour

Loading a decent diagram requires zooming/scrolling, which is definitely broken at least in my fresh install of VSCode and this extension.

Expected to use zoom with scrolling mouse/touchpad and to use scroll with dragging diagram using left mouse/tohchpad button.

sequenceDiagram
  participant User
  participant App as Mobile App
  participant Browser
  participant Backend as Mobile Backend
  participant Landing as Landing Web-server
  participant API as Service API
  participant SSO

  User->>+Browser: Open URL to Landing
  Browser->>+Landing: Get Landing 
  Landing-->>-Browser: Load Landing SPA JS
  Browser->>Browser: Run Landing JS and get token from URL fragment
  Browser->>+SSO: Get certs
  SSO-->>-Browser: Certs
  Browser->>Browser: Validate JWT and get MSISDN/subscriberId
  note over Browser: To not overcomplicate the diagram <br/>assuming JWT is valid and MSISDN <br/>or subscriberId is found
  Browser->>+SSO: Request own JWT with scope of invitation API and grant_type=token with intermediary JWT
  alt successful case
    SSO-->>Browser: Issue new token for invitation API
    Browser->>SSO: Invalidate Intermediary JWT
    SSO->>SSO: Invalidates JWT
    SSO-->>-Browser: JWT Invalidated
    Browser->>+API: Get invitations w/Authorization: Bearer <JWT>
    API->>API: Validate JWT
    alt successful case  
      API-->>-Browser: Reply as in specification
      Browser-->>-User: Show loaded page w/invitations
    else not valid JWT
	  activate API
      API-->>-Browser: Unauthenticated
	  note over Browser: tries Token refresh
	end
  else any checks on SSO side fail (IP changed/token invalid/so on)
	activate SSO
	activate Browser
	SSO-->>-Browser: Access denied
	Browser-->>-User: SPA shows a message asking user to log in to MLK
  end
Loading

Actual behaviour

Zoom works while scrolling up/down while mouse pointer placed on a diagram, scroll works while mouse pointer placed not on a diagram. Dragging the diagram is actually impossible due to diagram begins shaking and moving out of view.

@vstirbu
Copy link
Collaborator

vstirbu commented Jul 16, 2020

Mermaid does not have builtin zoom functionality. It might have changed, but last time I've checked most diagrams render to fill the view. Not a bit problem in the browser as you can zoom to a certain degree, but vscode does not allow that.

The plugin attempts to solve this using the d3.zoom functionality as the mermaid renders the diagrams with d3 anyway. The results are not perfect but I do not see a better solution at this time. I'm open to suggestions on this topic!

@ReginaldBull
Copy link

Hello,

The zoom functionality as it was in VS Code is now not any more available or broken.
It was possible a few months ago, not perfectly but good enough. At least in July 2022. Currently, I'm unable to zoom. That is a pity because with that, I don't have a practicable solution to check it. And convert it after a change to an HTML page and open it in a browser is not optimal.

@vstirbu
Copy link
Collaborator

vstirbu commented Nov 11, 2022

Mermaid.live has zoom functionality now.

I would appreciate if a volunteer can investigate if that solution can be integrated in the react app that runs in the webview.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants