Git Product home page Git Product logo

Comments (9)

johngruen avatar johngruen commented on August 28, 2024 1

@lmorchard what if we just nuke this button and be done with it...

from firefoxcolor.

lmorchard avatar lmorchard commented on August 28, 2024

This could be considered done, insofar as uninstalling the add-on reverses theme changes.

Doing it while the add-on is installed might be a challenge, though - I don't think we can get a representation of the default theme to re-apply it.

from firefoxcolor.

lmorchard avatar lmorchard commented on August 28, 2024

Oh, actually, looks like we have a reset API call! One caveat:

Note that this will always reset the theme back to the original default theme, even if the user had selected a different theme before this extension's theme was applied.

There is also a getCurrent() API call, but I think that's limited to themes using the theme API - i.e. not the built-in default / light / dark themes

from firefoxcolor.

lmorchard avatar lmorchard commented on August 28, 2024

@johngruen Is the little circle-arrow icon here meant to be for reset-to-default?

capture

Guessing yeah, since I just found an SVG named icon_reset.svg :)

from firefoxcolor.

lmorchard avatar lmorchard commented on August 28, 2024

One more caveat, thinking through this: If the user resets to default, we probably can't populate the color settings with that default theme. Not quite sure what to reset the editor to in this case, then.

from firefoxcolor.

chuckharmston avatar chuckharmston commented on August 28, 2024

I'm a little concerned about the iconography here; that looks like "refresh", not "reset". Hopefully it's a non-destructive action, i.e. you can undo it?

from firefoxcolor.

johngruen avatar johngruen commented on August 28, 2024

We should also make sure to have tooltips

from firefoxcolor.

lmorchard avatar lmorchard commented on August 28, 2024

I poked at this one a bit. @johngruen - I think we might need to do some product thinking on this.

We can revert an extension-applied theme with browser.theme.reset() - so that leaves us with the default theme in the browser.

But, we can't read that theme. There's a browser.theme.getCurrent() but it returns undefined after a reset(). We can only use that API to fetch theme properties that have been set by an extension.

So, we can't set the current theme in the web editor to match the default theme after reset. And so the next edit to the theme in the editor just re-applies what was there before reset.

If you want to see what it does, I did a quick attempt to wire up the reset button in a branch.

from firefoxcolor.

lmorchard avatar lmorchard commented on August 28, 2024

I'm good with dropping the button. FWIW, the theme does revert to default on add-on uninstall, so we've got that at least. I'll call this closed for that.

from firefoxcolor.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.