hypothesis / hypothesis/product-backlog

Suggestion: don't show the view switcher when there are no page notes or orphans

Open
#334 1 comment 0 reactions 0 assignees View on GitHub
client Design
Dominant language
No language data
Stars
122
Forks
7
PR merge metrics
No merged PRs in 30d

Description

Just recording a suggestion that Dawa made:

@dawariley pointed out that when there are no page notes and no orphans there's no point in showing the view switcher control at the top of the sidebar at all, because the _Annotations_ view is the only one that actually contains anything. The _Orphans_ tab is already not shown when there are no orphans, but currently the _Page Notes_ tab is always shown even if there aren't any page notes:

![peek 2017-07-03 14-31](https://user-images.githubusercontent.com/22498/27795030-6f415672-5ffc-11e7-9856-cc86a2ff5778.gif)

The suggestion is the _none_ of the tabs (annotations, page notes, or orphans) would be shown if there are no page notes or orphans.

One question I have is what if there are some page notes (or some orphans) but no annotations? I guess then you would have to show `[ Annotations | Page Notes 3]` or `[ Annotations | Orphans 3]`. You can't just show the `[ Page Notes 3]` (or `[ Orphans 3]`) tab on its own (or can you?), it looks a bit odd:

![screenshot from 2017-07-03 14-50-53](https://user-images.githubusercontent.com/22498/27795725-127df5d2-5fff-11e7-934f-6ee9c2a9b217.png)

And nor can you show no tabs at all and just show the page notes or orphans (because it wouldn't be clear that they're page notes or orphans, and not normal annotations). But just showing `[ Annotations | Page Notes 3]` or `[ Annotations | Orphans 3]` seems fine?

Another potential problem with this is that the _New Page Note_ button creates a new page note and switches to the page notes view:

![peek 2017-07-03 14-30](https://user-images.githubusercontent.com/22498/27795062-85807918-5ffc-11e7-9b42-f15c878508eb.gif)

We could make the `[ Annotations 10 | Page Notes 1 ]` switcher appear _when the New Page Note button is clicked_. This might be slightly jarring / poppy (especially if it would suddenly push the new page note down a couple of centimeters) but if we made it perhaps a quick animated fade in and if we had the new page note already appear in its final location so it doesn't get pushed down, that might work.

Does anyone remember why the _Page Notes_ tab shows even when there are no page notes? I dig out the [original Trello card for the tabs](https://trello.com/c/OLdLTlLT/342-separate-annotations-and-notes) (from back when we used to use Trello for sprints) and the pull requests: , , , , , but I'm none the wiser.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing the view switcher and New Page Note button behavior in the client UI, using the linked historical pull requests for context. Done means the controls handle empty annotations, page notes, and orphan states clearly, including the transition when a new page note is created.

Written by the indexing model from the issue text.

Assessment

Domain
frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.