Bug 23866 - Storage panel should be editable
Summary: Storage panel should be editable
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-10 07:01 PST by Anthony Ricaud
Modified: 2009-02-27 10:29 PST (History)
5 users (show)

See Also:


Attachments
Make DOMStorage view editable. (12.22 KB, patch)
2009-02-21 10:28 PST, Yael
timothy: review-
Details | Formatted Diff | Diff
Addressing comment #2. (13.29 KB, patch)
2009-02-26 08:48 PST, Yael
timothy: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Anthony Ricaud 2009-02-10 07:01:15 PST
The new listing is not editable. It would be a nice feature.
Comment 1 Yael 2009-02-21 10:28:46 PST
Created attachment 27855 [details]
Make DOMStorage view editable.
Comment 2 Timothy Hatcher 2009-02-25 17:57:32 PST
Comment on attachment 27855 [details]
Make DOMStorage view editable.


> +    get statusBarItems()
> +    {
> +        return [this.deleteButton];
> +    },

The delete button should be on the view side of the status bar, like we do in the ProfilesPanel/ProfilesView. A delete button here would imply deleting a local/session storage object not a row. r- for this

> +            this.visibleView._dataGrid._deleteRow();

Functions that are "public" like _deleteRow() should not have an underscore. Also deleteSelectedRow() would be best, since the row index isn't passed.

> +        var element = event.target.enclosingNodeOrSelfWithNodeName("td");

Why do you need to look for a element? Can't you get everything from dataGridNodeFromEvent?

> +            }
> +            else {

This should be: } else { on the same line.


> +        if (node && domStorage) {
> +            domStorage.removeItem(node.data[0]);
> +        }

No need for braces here.
Comment 3 Yael 2009-02-25 19:25:04 PST
(In reply to comment #2)
> (From update of attachment 27855 [details] [review])
> 
> > +    get statusBarItems()
> > +    {
> > +        return [this.deleteButton];
> > +    },
> 
> The delete button should be on the view side of the status bar, like we do in
> the ProfilesPanel/ProfilesView. A delete button here would imply deleting a
> local/session storage object not a row. r- for this
> 
> > +            this.visibleView._dataGrid._deleteRow();
> 
> Functions that are "public" like _deleteRow() should not have an underscore.
> Also deleteSelectedRow() would be best, since the row index isn't passed.
> 
> > +        var element = event.target.enclosingNodeOrSelfWithNodeName("td");
> 
> Why do you need to look for a element? Can't you get everything from
> dataGridNodeFromEvent?
> 
> > +            }
> > +            else {
> 
> This should be: } else { on the same line.
> 
> 
> > +        if (node && domStorage) {
> > +            domStorage.removeItem(node.data[0]);
> > +        }
> 
> No need for braces here.
> 

Thank you for the review. I will address your comments in my next patch. Regarding
> +        var element = event.target.enclosingNodeOrSelfWithNodeName("td");
I did that because I need to know not only the node, but also which of the columns was double clicked (is it key or is it value).
Could you suggest a better way to find which column was clicked? thanks!

Comment 4 Yael 2009-02-26 08:48:42 PST
Created attachment 28017 [details]
Addressing comment #2.

This patch is addressing comment #2, with the exception that I am still using
 var element = event.target.enclosingNodeOrSelfWithNodeName("td");
I am not sure how else to find out if a key was edited or a value was edited.
Comment 5 Timothy Hatcher 2009-02-26 10:44:20 PST
Comment on attachment 28017 [details]
Addressing comment #2.

Using enclosingNodeOrSelfWithNodeName("td") is fine, now that I understand it.

Nice work!
Comment 6 Yael 2009-02-26 17:17:51 PST
Thank you for the review. Now I need help committing this patch :-)
Comment 7 Timothy Hatcher 2009-02-27 10:29:27 PST
Landed in r41288.