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

Auto-follow preview links #411

Closed
iafan opened this issue Feb 24, 2020 · 0 comments · Fixed by #420
Closed

Auto-follow preview links #411

iafan opened this issue Feb 24, 2020 · 0 comments · Fixed by #420
Assignees

Comments

@iafan
Copy link
Contributor

iafan commented Feb 24, 2020

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.

julen added a commit that referenced this issue Feb 25, 2020
@julen julen self-assigned this Feb 27, 2020
julen added a commit to julen/zing that referenced this issue Feb 27, 2020
This works for links in unit comments marked to be opened in a
`_preview` target window. Opened links will be higlighted and navigating
to new units will update the contents of the preview window, should it
be open.

Fixes serge-community#411.
@julen julen closed this as completed in aa9205e Feb 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants