Bug 76912

Summary: Web Inspector: TabbedEditorContainer should save open tabs.
Product: WebKit Reporter: Vsevolod Vlasov <vsevik>
Component: Web Inspector (Deprecated)Assignee: Vsevolod Vlasov <vsevik>
Status: RESOLVED FIXED    
Severity: Normal CC: apavlov, bweinstein, joepeck, keishi, loislo, pfeldman, pmuellr, rik, timothy, yurys
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Bug Depends on: 77098    
Bug Blocks: 75093    
Attachments:
Description Flags
Patch
none
Patch pfeldman: review+

Description Vsevolod Vlasov 2012-01-24 07:12:09 PST
TabbedEditorContainer should save open tabs.
Comment 1 Vsevolod Vlasov 2012-01-24 07:19:25 PST
I suggest following approach:

 - We store (in settings)
   - last opened script url
   - the list of urls that were shown recently
 - All these settings are updated after each user initiated action that affects editor container.
 - when the list of recent urls is updated we save all currently open tabs sorted by the time they were last shown. Then we make sure the list length does not exceed some fixed size (30).
 - When scripts are loaded in the scripts panel we show tabs for all recent urls unless user already performed some action.
Comment 2 Vsevolod Vlasov 2012-01-24 08:22:55 PST
Created attachment 123739 [details]
Patch
Comment 3 Pavel Feldman 2012-01-25 01:41:25 PST
Comment on attachment 123739 [details]
Patch

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

> Source/WebCore/inspector/front-end/ScriptsPanel.js:36
> +    this._lastViewedFileSetting = WebInspector.settings.createSetting("lastViewedFile", "");

Please use the old setting name here for the smooth transition.

> Source/WebCore/inspector/front-end/ScriptsPanel.js:269
> +        var previouslyViewedFiles = this._previouslyViewedFilesSetting.get();

Please cover this code with tests

> Source/WebCore/inspector/front-end/ScriptsPanel.js:1201
> +    addFirstSourceFrame: function(title, sourceFrame, tooltip) { },

This editor container API seems too verbose.
Comment 4 Vsevolod Vlasov 2012-01-27 07:19:38 PST
> Please use the old setting name here for the smooth transition.
Left old setting untouched, just moved its handling to SingleFileEditorContainer

> > Source/WebCore/inspector/front-end/ScriptsPanel.js:269
> > +        var previouslyViewedFiles = this._previouslyViewedFilesSetting.get();
> 
> Please cover this code with tests
Extracted History object and covered with tests.

> > Source/WebCore/inspector/front-end/ScriptsPanel.js:1201
> > +    addFirstSourceFrame: function(title, sourceFrame, tooltip) { },
> 
> This editor container API seems too verbose.
Only uiSourceCodeAdded() method is now used on EditorContainer for history handling.
Comment 5 Vsevolod Vlasov 2012-01-27 07:22:07 PST
Created attachment 124313 [details]
Patch
Comment 6 Vsevolod Vlasov 2012-01-30 05:10:49 PST
Committed r106238: <http://trac.webkit.org/changeset/106238>