Skip to content

Auto-follow preview links #411

@iafan

Description

@iafan

When translators navigate through the units, and decide to open a preview link, it would be good to automatically update the preview window contents for as long as the preview window stays opened. This will allow to keep both the translation UI and the preview window opened on a larger monitor at the same time, and provide translators with the context without them to do any extra clicks.

Here's how this can be implemented:

Step 1: let's change the links that we render in unit comments so that they have the _preview target name instead of _blank. This will allow us to identify such links on a page easily, regardless of how they are created.

Step 2: when a preview link is clicked, dynamically open a preview window (or focus on an existing one), and send the link there (first, using postMessage to let the server handle the navigation, then falling back to setting a new location). It would be also nice to have a currently active preview link highlighted in the comments (we could render it in inverted color). See https://jsfiddle.net/iafan/crko8z9e/ for a complete example.

Step 3: when the user goes to a new translation unit, and we know that a preview window is open, auto-send the first preview link there.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions