Last modified: 2013-09-21 05:29:36 UTC
Annotations probably shouldn't show by default in regular read mode. Ideally, there would be a toggle to show and hide them.
The first step is to think about how to do the interface for this. I have a few ideas, but I'm sure there's a lot more I haven't thought of: 1. An icon (similar to the watchlist star, but a different icon) to toggle them, with a visible on and off state. 2. A separate tab next to read (e.g. "View with annotations"). When that's selected, annotations will be visible and the tab will be selected. 3. A link in the toolbox Feel free to consider other ideas, and consult the design mailing list if you want.
I think having a separate tab next to read would be good.
Using SkinTemplateNavigation is an option. However, since it only works with JS anyway, it might be simpler to just use mw.util.addPortletLink. You can use https://git.wikimedia.org/blob/mediawiki%2Fextensions%2FVisualEditor.git/0e1ad8a1bbe161741ca43a406f7d36d1a38cf26b/modules%2Fve-mw%2Finit%2Ftargets%2Fve.init.mw.ViewPageTarget.init.js#L175 as a starting point. You don't need to use a URL parameter the way they're doing (veaction=edit), though you can (it would be a little more work, but it allows bookmarking the annotation view). The simpler approach is to just use a click listener. When it is clicked, load the annotations, and mark the tab selected (there is a 'selected' class you should add to the new tab and remove from the others). If they are in annotation view, and click ca-view, or a tab starting with ca-nstab- (e.g. "Page" on annotator.wmflabs.org), select that, unselect the annotator tab, and destroy the annotations. For the nstab one, I think you can use $( '[id^="ca-nstab-"]' ). This part means it won't trigger a reload when they want to leave annotation view.
Change 79839 had a related patch set uploaded by Rjain: Added a tab to toggle visibility of annotations https://gerrit.wikimedia.org/r/79839
(In reply to comment #2) > I think having a separate tab next to read would be good. From a user experience point of view, I'd recommend against making a tab next to Read. Tabs are usually separate pages/destinations, not tools for toggling ways to view articles. If you want it to be a primary page action, putting in the dropdown with Move etc. (this is Vector only) seems acceptable. For Monobook users, showing a tab is slightly more okay, since tabs tend to proliferate frequently in that skin. Another option is to put in the Toolbox sidebar links.
Are there any screenshots of this extension or is it available on a test wiki somewhere?
http://annotator.wmflabs.org/wiki/Main_Page . This particular feature is not merged yet (or on that wiki).
Change 79839 merged by jenkins-bot: Added a tab to toggle visibility of annotations https://gerrit.wikimedia.org/r/79839
This is fixed, but further enhancements to the UI later would still be useful.