Rayquaza01 / note-taker

A Firefox addon that adds a text box to a toolbar button for taking notes.
MIT License
28 stars 4 forks source link

Bug: Sidebar note switches back to default display unexpectedly #21

Open ReporterX opened 5 years ago

ReporterX commented 5 years ago

I have yet to spot an exact pattern to reproduce this bug. Sometimes it happens if you do the following.

The default display is general note.

Let's say you have Window A and Window B. Window B has sidebar note opened. You switch the display to URL note.

You go to Window A. Switch to several tabs, viewing pages etc.

Then go back to Window B. Expected: The sidebar note stays the same, displaying URL note. Actual: Sometimes It suddenly switches back to general note.

It does not always happen. You may try several times. Open different tabs. Switch display to different notes. Browse away. Do some actions. Switch back. Let's see if you can trigger that bug.

Rayquaza01 commented 5 years ago

This one's a bit tricky. First, the sidebar gets the information about the current URL by looking at the active tab in the current window, not necessarily the window the sidebar is open in. That's why the sidebar changes when doing things in another window.

Second, the dropdown on the bottom of the page to change the mode is temporary. This is because if it weren't with the way it is right now, it would affect the default display of other tabs, which probably is unwanted.

A much simpler way of triggering it: Open the sidebar on a page with notes. Use the dropdown to change the display mode. Open a new tab. Switch back. The sidebar will now display the default display notes instead of the selected display mode.

A stopgap solution would be changing the note from the menu instead of the dropdown. That should survive tab changes.

ReporterX commented 5 years ago

I see. Perhaps you need to store the info about the current display (of the note) for each URL, so it will display the right note when they switch back.

Alternatively, if you implement this feature at https://github.com/Rayquaza01/note-taker/issues/20 , we don't really need to switch the display ourselves.

ReporterX commented 5 years ago

I encountered another bug.

Steps:

  1. Set general note by default
  2. Open sidebar note. Open site A
  3. Switch to domain/URL note by the drop-down menu screenshot 1
  4. It will force to switch back to general note after a few seconds.