Table headers are not removed when selecting an empty storage

ASSIGNED
Assigned to

Status

()

Firefox
Developer Tools: Storage Inspector
P2
normal
ASSIGNED
a year ago
a month ago

People

(Reporter: sebo, Assigned: Parth, Mentored)

Tracking

(Blocks: 1 bug, {good-first-bug})

Trunk
good-first-bug
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox51 affected)

Details

(Whiteboard: [todo-mr][t1][lang=js])

Attachments

(2 attachments)

(Reporter)

Description

a year ago
As of bug 1264582:

The table headers of the previously selected storage are still shown when selecting a storage, which doesn't contain any items.

Steps to reproduce:
1. Open the Storage Inspector on this page
2. Expand 'Cookies' and select 'bugzilla.mozilla.org'
   => Some cookies will be shown in a table with the headers 'Name', 'Path', ..., 'isHttpOnly'
3. Select 'Local Storage'

=> The headers of the 'Cookies' table are still shown.

You'd expect that the table headers are hidden when there are no entries.

Sebastian
Priority: -- → P2
(Reporter)

Updated

a year ago
See Also: → bug 1309824
Blocks: 1312444
Whiteboard: [papercut-mr]
Filter on Brobdingnagian.
Whiteboard: [papercut-mr] → [todo-mr]
Filter on HOTFROG.
Whiteboard: [todo-mr] → [todo-mr][t1]
(Reporter)

Comment 3

4 months ago
I assume that should be easy to fix. So, adding 'good-first-bug'.

Sebastian
Keywords: good-first-bug
(Reporter)

Comment 4

3 months ago
Mike, I've added you as mentor, if that's ok. I may tackle this bug myself at some point if no one else steps up.

Sebastian
Mentor: mratcliffe@mozilla.com
Whiteboard: [todo-mr][t1] → [todo-mr][t1][lang=js]
Created attachment 8900519 [details]
Picture of STR step 2
Created attachment 8900520 [details]
Picture of STR step 3
Not seeing this on Nightly 57.0a1 64-bit on linux.
(Reporter)

Comment 8

3 months ago
Your second screenshot shows the error, the headers of the 'Cookies' table ('Name', 'Domain', 'Path', etc.) are shown at the top of the panel.

Sebastian
Oh, sorry, only on my second look-through do I see the word "headers." I'm not sure that I agree they shouldn't show, but I'll take a look at figuring out a patch if that's the consensus.
Also of note: The + button still appears when the panel is first opened. Should I open a new bug for this?
Why do we allow clicking on the host at all? If it never displays any data, what's the point? I think the better solution would be to make clicking the host either a) select the first subitem or b) expand/collapse the element. Thoughts?

Anyway, I was trying to figure out how to hide the tree headers, and I can't seem to figure it out. I think it needs to be added in ui.js at line 606 [1], surrounded in `if (howManyNodesIn <= 1) { ... }`. I have tried `this.table.clear()`.

[1] https://searchfox.org/mozilla-central/source/devtools/client/storage/ui.js#606
Flags: needinfo?(mratcliffe)
(In reply to Christopher Phonis-Phine from comment #11)
> Why do we allow clicking on the host at all? If it never displays any data,
> what's the point? I think the better solution would be to make clicking the
> host either a) select the first subitem or b) expand/collapse the element.
> Thoughts?
> 
> Anyway, I was trying to figure out how to hide the tree headers, and I can't
> seem to figure it out. I think it needs to be added in ui.js at line 606
> [1], surrounded in `if (howManyNodesIn <= 1) { ... }`. I have tried
> `this.table.clear()`.
> 
> [1]
> https://searchfox.org/mozilla-central/source/devtools/client/storage/ui.
> js#606

If there is no data then clicking on the host should really show a panel saying "There is no data for the selected host."

The host is selectable because in the future we plan on showing data relating to the storage type when it is clicked e.g. when an indexedDB host is selected we can show the number of databases, tables etc. along with their sizes and remaining capacities.
Flags: needinfo?(mratcliffe)
(Reporter)

Comment 13

3 months ago
(In reply to Michael Ratcliffe [:miker] [:mratcliffe] from comment #12)
> (In reply to Christopher Phonis-Phine from comment #11)
> > Why do we allow clicking on the host at all? If it never displays any data,
> > what's the point? I think the better solution would be to make clicking the
> > host either a) select the first subitem or b) expand/collapse the element.
> > Thoughts?
> 
> If there is no data then clicking on the host should really show a panel
> saying "There is no data for the selected host."
> 
> The host is selectable because in the future we plan on showing data
> relating to the storage type when it is clicked e.g. when an indexedDB host
> is selected we can show the number of databases, tables etc. along with
> their sizes and remaining capacities.

See also bug 1102716 and bug 1309824.

Sebastian
I thing bug 1102716 makes the most sense, and either way when either of those are resolved this bug becomes irrelevant.
(Assignee)

Comment 15

2 months ago
Hey is it okay if i take care of this bug? Im a student in an open-source class and im looking to start off in this community
(In reply to Parth from comment #15)
> Hey is it okay if i take care of this bug? I'm a student in an open-source
> class and im looking to start off in this community

Sure, just ping me if you need any help.

I have assigned you to this bug.
Assignee: nobody → ppatel221
(Reporter)

Updated

a month ago
Status: NEW → ASSIGNED
You need to log in before you can comment on or make changes to this bug.