Bug 161456

Summary: Web Inspector: Resources with unsaved changes should have a dimmed icon
Product: WebKit Reporter: Nikita Vasilyev <nvasilyev>
Component: Web InspectorAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: hi, inspector-bugzilla-changes, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
[Image] Proposed change
none
Xcode Darkens none

Description Nikita Vasilyev 2016-08-31 13:59:41 PDT
Created attachment 287539 [details]
[Image] Proposed change

Chrome DevTools do it in their Sources tab. I think we should do the same for our Resources and Debugger tabs, and also for the Styles sidebar.
Comment 1 Radar WebKit Bug Importer 2016-08-31 14:00:13 PDT
<rdar://problem/28102546>
Comment 2 Devin Rousso 2016-08-31 14:35:06 PDT
+1, but there is a slight issue with this in that the current definition of InspectorFrontendHost::save does not actually return whether the save was completed or not.  If we don't care about that (or if it's not possible), then I imagine this just being the following:

1. Add another member variable to SourceCode called lastSavedRevision
2. Add getter for isModified that checks if lastSavedRevision !== currentRevision
3. Change the displayName getter to add "*" if isModified is true
Comment 3 Joseph Pecoraro 2016-08-31 15:04:42 PDT
(In reply to comment #2)
> +1, but there is a slight issue with this in that the current definition of
> InspectorFrontendHost::save does not actually return whether the save was
> completed or not.

I think it actually should call through to:

    InspectorFrontendAPI.savedURL

Which is currently unimplemented:

    InspectorFrontendAPI = {
        ...
        savedURL: function(url)
        {
            // Not used yet.
        },
        ...
    }

The frontend host (the person who injected InspectorFrontendHost) communicates with the inspector page by calling InspectorFrontendAPI methods. So the contract for InspectorFrontendHost.save will eventually response with a InspectorFrontendAPI.savedURL.

It is not a perfect API by any means, and totally changeable.
Comment 4 Timothy Hatcher 2016-10-19 10:16:20 PDT
I wouldn't use an asterisks. On Mac the convention is to have a dimmed icon.
Comment 5 Devin Rousso 2016-10-19 14:22:12 PDT
(In reply to comment #4)
> I wouldn't use an asterisks. On Mac the convention is to have a dimmed icon.

How would a dimmed icon work for the styles panel?  Currently, the icon is dimmed if the user "disables" the rule (which comments all the properties).  Would we not want to bother with that and instead implement something akin to <https://webkit.org/b/161965>.
Comment 6 Timothy Hatcher 2016-10-19 14:33:48 PDT
(In reply to comment #5)
> (In reply to comment #4)
> > I wouldn't use an asterisks. On Mac the convention is to have a dimmed icon.
> 
> How would a dimmed icon work for the styles panel?  Currently, the icon is
> dimmed if the user "disables" the rule (which comments all the properties). 
> Would we not want to bother with that and instead implement something akin
> to <https://webkit.org/b/161965>.

I should have said darken, not dim.
Comment 7 Timothy Hatcher 2016-10-19 14:34:06 PDT
Created attachment 292111 [details]
Xcode Darkens