alexa / ask-toolkit-for-vscode

ASK Toolkit is an extension for Visual Studio Code (VSC) that that makes it easier for developers to develop and deploy Alexa Skills.
https://developer.amazon.com/en-US/docs/alexa/ask-toolkit/get-started-with-the-ask-toolkit-for-visual-studio-code.html
Apache License 2.0
107 stars 52 forks source link

fix: viewport.mode always showing hub #274

Closed rahulbanerjee26 closed 12 months ago

rahulbanerjee26 commented 12 months ago

There is currently an issue with the apl preview. If the user uses ${viewport.mode} in their APL document, it always shows "hub" irrespective of what device/viewport is being used t preview the APL document.

Steps to Reproduce

  1. Copy the sample APL document
  2. Use the VS Code plugin to preview above document in different viewports
  3. The mode is always "hub"

This PR fixes the above issue.

Description

The bug was that the viewport mode was not being passed as an option to web viewhost for rendering. By default if no mode is provided, when rendering web viewhost returns "hub". The major change is adding an extra parameter to the function that renders the APL doc and updating it's invocations by passing the viewport mode.

Motivation and Context

This bug doesn't exist on authoring tool and hence we need to fix it in the vs code plugin as well.

Testing

I ran npm run test. Below is the output

  122 passing (4s)

  10 pending

Screenshots (if appropriate)

Types of changes

Checklist

License