Closed Bug 724121 Opened 13 years ago Closed 10 years ago

Style Editor window needs to do something when the page reloads

Categories

(DevTools :: Style Editor, defect)

10 Branch
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: sheppy, Unassigned)

Details

Something needs to be done in the case where you reload the page the style editor is showing you the styles for. One of these is a likely candidate: - Refresh the style sheets in the editor? - Offer to refresh the style sheets in the editor? - Display an indicator that the style sheets don't match the current page? Perhaps the latter with buttons offering to reapply the styles as they are in the editor, and another offering to reload the style sheets from the site into the editor?
I believe that as long as the Style Editor is open, we should just re-apply the style. Why would the user want to not reload the style he is writing? To get the original or cancel his modifications? If so, we should provide a better way to do that.
do we need to consider the case of navigating away from the original page? What do we do then? Read-only mode seems like the right thing to do if we can't reapply but would like the option to save or copy.
Something needs to happen in that situation too, yeah. Probably some kind of read-only mode, but it needs to be pretty clear that you're looking at source for something other than what you're looking at, too.
(In reply to Paul Rouget [:paul] from comment #1) > Why would the user want to not reload the style he is writing? > To get the original or cancel his modifications? If so, we should provide a > better way to do that. A page reload has always been a refresh from the network (or cache). It's always been a "get the original and cancel my modifications" option. Changing that behavior because a style editor is open sure seems jarring.
Automatically refreshing the style editor to the new styles (throwing away work) seems bad too though.
Could maybe treat it like some editors treat a file changing out from underneath you - go read only until the user indicates whether they want the editor version or the page version.
I think it would be a neat idea to include a "undo/time machine" button next to the css source after a page refresh if the styles were edited. In the backend, we can cache the edited css sources. For perf, navigating to a different page will remove the cache. Clicking on the undo button will revert to the previous edited styles.
This bug was filed 3 years ago and a lot has changed since. From my testing, I can see that the style-editor now clearly shows that it is reloading stylesheets when you navigate to a different page (or reload the same page). The list of stylesheets is emptied, a loading indicator appears, and when the new page has loaded, the new list appears. So in that sense, the original bug is fixed now. However, that doesn't solve the following problems: - if I changed the stylesheet text before navigating, my changes are lost, - if I changed the stylesheet text, then navigate, then hit back, the page shows the modified style (because of the bfcache), but the styleeditor doesn't show my changes anymore (because it gets the text from the network/cache). I'll file a new bug for this.
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → WORKSFORME
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.