Bug 76912 - Web Inspector: TabbedEditorContainer should save open tabs.
Summary: Web Inspector: TabbedEditorContainer should save open tabs.
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: Vsevolod Vlasov
URL:
Keywords:
Depends on: 77098
Blocks: 75093
  Show dependency treegraph
 
Reported: 2012-01-24 07:12 PST by Vsevolod Vlasov
Modified: 2012-01-30 05:10 PST (History)
10 users (show)

See Also:


Attachments
Patch (25.76 KB, patch)
2012-01-24 08:22 PST, Vsevolod Vlasov
no flags Details | Formatted Diff | Diff
Patch (22.52 KB, patch)
2012-01-27 07:22 PST, Vsevolod Vlasov
pfeldman: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>