Bug 103944 - Web Inspector: Persist Audit selections across sessions
Summary: Web Inspector: Persist Audit selections across sessions
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: Andrey Kosyakov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-03 16:15 PST by Alice Boxhall
Modified: 2012-12-17 06:15 PST (History)
9 users (show)

See Also:


Attachments
Patch (6.31 KB, patch)
2012-12-17 04:00 PST, Andrey Kosyakov
no flags Details | Formatted Diff | Diff
Patch (7.14 KB, patch)
2012-12-17 05:42 PST, Andrey Kosyakov
apavlov: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alice Boxhall 2012-12-03 16:15:38 PST
In the Audits UI, remember which audits the user has selected in future sessions.
Comment 1 Andrey Kosyakov 2012-12-17 04:00:05 PST
Created attachment 179712 [details]
Patch
Comment 2 Alexander Pavlov (apavlov) 2012-12-17 05:13:40 PST
Comment on attachment 179712 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=179712&action=review

> Source/WebCore/inspector/front-end/AuditLauncherView.js:69
> +WebInspector.AuditLauncherView.AllCategoriesKey = "__AllCategories";

This can be a computed setting (will slightly break when more categories from new extensions are added, though)

> Source/WebCore/inspector/front-end/AuditLauncherView.js:268
> +    _selectedCategoriesUpdated: function()

Could you clean up the persisted list of categories to remove junk (e.g. leftover categories from disabled/removed extensions) here?
Comment 3 Andrey Kosyakov 2012-12-17 05:42:54 PST
Created attachment 179723 [details]
Patch
Comment 4 Andrey Kosyakov 2012-12-17 05:44:42 PST
(In reply to comment #2)
> (From update of attachment 179712 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=179712&action=review
> 
> > Source/WebCore/inspector/front-end/AuditLauncherView.js:69
> > +WebInspector.AuditLauncherView.AllCategoriesKey = "__AllCategories";
> 
> This can be a computed setting (will slightly break when more categories from new extensions are added, though)

Yep -- keeping all categories explicitly in the state we display to the user simplifies things a lot, given that categories come and go dynamically.

> > Source/WebCore/inspector/front-end/AuditLauncherView.js:268
> > +    _selectedCategoriesUpdated: function()
> 
> Could you clean up the persisted list of categories to remove junk (e.g. leftover categories from disabled/removed extensions) here?

Fixed -- now remove categories that are not present each time we update state due to a user action.
Comment 5 Alexander Pavlov (apavlov) 2012-12-17 05:59:14 PST
Comment on attachment 179723 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=179723&action=review

Looks good audits-wise. I'd like to hear an authoritative opinion on whether this kind of setting initialization is valid.

> Source/WebCore/inspector/front-end/AuditLauncherView.js:66
> +    this._selectedCategoriesSetting = WebInspector.settings.createSetting("selectedAuditCategories", defaultSelectedAuditCategory);

I'm not sure if this is the right way to initialize a setting (outside Settings.js) - need advice from someone who knows the settings handling well enough.
Comment 6 Alexander Pavlov (apavlov) 2012-12-17 06:03:51 PST
Comment on attachment 179723 [details]
Patch

r=me per the offline discussion
Comment 7 Andrey Kosyakov 2012-12-17 06:15:49 PST
Committed r137903: <http://trac.webkit.org/changeset/137903>