sandstorm icon indicating copy to clipboard operation
sandstorm copied to clipboard

shell: maybe grains should be able to set a favicon

Open zarvox opened this issue 10 years ago • 11 comments

And then the shell should use that favicon when viewing that grain, but the Sandstorm favicon otherwise.

From what I find on stackoverflow, updating the favicon dynamically appears to be an operation that:

  • only works in Firefox, Chrome, and Opera, and
  • only works if you completely remove the <link> element(s) and add (a) new one(s).

We'd need to add a new window.postMessage call, and then teach apps to use that. Maybe we could provide some JS that apps could include that would scan the page for link rel=icon tags a second after document.ready() to make integration easier for apps with static favicons?

zarvox avatar Sep 23 '15 21:09 zarvox

Hmm, my first thought is that as a user I might not actually want this, because often I am looking for "my Sandstorm tab" without remembering exactly which grain I was last looking at inside it.

kentonv avatar Sep 23 '15 21:09 kentonv

FWIW this came up because I was spending ~5 seconds looking for my Rocket.Chat tab and decided that a favicon would help, and mentioned it to Drew.

paulproteus avatar Sep 23 '15 21:09 paulproteus

I dunno if now that it's a multi-grain (healthy!) UI that this would make sense.

Rocket.Chat coming to the market?

ocdtrekkie avatar Sep 23 '15 22:09 ocdtrekkie

I guess it depends on how you use Sandstorm. There's also the case where I have multiple browser tabs with different grains open, and I right now I can't distinguish them by their favicons. It's kind of a question of whether we put the emphasis on Sandstorm, or on the content it frames.

I'm also perfectly happy not implementing this and leaving the shell favicon as-is. There are some possible weird corner cases with multiple tabs being open at once, and there's actually like 26 different favicons you have to implement for the different browsers, and you have to change a node in the

of the document, which means you can't do it with Blaze, and other reasons why implementing this would be a pain.

It just seemed kinda related to document.title, which is also a thing that we try to sync with the active view (#840 notwithstanding).

zarvox avatar Sep 23 '15 23:09 zarvox

Please please please put all the emphasis on grains, not on Sandstorm. Sandstorm UI should occupy no more places than is necessary to provide trusted-path and meta UI.

kpreid avatar Sep 24 '15 01:09 kpreid

I agree that we should aim for Sandstorm to stay out of the way as much as possible, but no more.

That said, to consider a similar situation, browsers on every platform I was able to test do not change their icons in your system task switcher to match the favicon of the page you're currently viewing. There's value in being able to distinguish "the Sandstorm tabs" from "all my dozens of other tabs" in the same way there's value in being able to distinguish "my Firefox windows" from "all my other application windows" in the system panel.

Matching what browser vendors do here seems pretty reasonable to me, especially since updating the favicon would require additional app modifications.

One alternative that I'd consider would be to use the app icon as the favicon, since that'd more closely mirror browser behavior. A couple of downsides would be that I'm not sure if favicons can have data-uris (which we'd have to use for identicons for apps that don't icons, or just keep the sandstorm favicon), and of course, poor browser support for SVG favicons. I suppose we could theoretically rasterize SVGs into PNGs, but that's also kinda annoying to implement...

Anyway, with all of the above in mind, revisiting this probably won't be at the top of my priority list for a while, but if someone else wants to jump in, I'd be happy to give feedback on proposed approaches or implementations!

zarvox avatar Sep 24 '15 02:09 zarvox

Given the disagreement I wonder if it might be worthwhile to have a global UI option for “let the app show through” vs “focus on Sandstorm as a whole” variations. For example, besides the favicon the former might default to not showing the grain-list sidebar.

kpreid avatar Sep 24 '15 02:09 kpreid

Global options add deceptively high complexity and maintenance costs, often for deceptively little real benefit. I think we should avoid minor "cosmetic" options like this. I could imagine someday implementing a broader concept of "themes" and allow the theme to decide this kind of behavior, and I could also imagine someone implementing this in a browser extension... but a checkbox in account settings really doesn't seem worthwhile IMO.

kentonv avatar Sep 24 '15 05:09 kentonv

Back again, because I'm actually using Sandstorm more these days. Still want the favicon to be the app icon.

New argument: Browsers generally consistently pair the favicon with the page <title>. Sandstorm's page titles are "<app> - <server title>". It would make sense to treat the favicon the same way.

One such way would be to display the app icon with a Sandstorm badge in the corner. (In particular, the bottom left corner so that it 'dissolves into' the app icon.) This satisfies the desire for both identifying the app to multi-tab users and identifying Sandstorm to single-tab users.

kpreid avatar Sep 23 '16 15:09 kpreid

My thumbs-up here doesn't indicate that I think we can get to it soon, but I do agree with you kpreid. (This makes sense, I suppose, since I'm the person who caused this bug to get filed!)

paulproteus avatar Oct 03 '16 20:10 paulproteus

I ran into this today when experimenting with RocketChat. Chat applications often use the favicon as an "unread messages" indicator, possibly even showing how many unread messages there are. With the grain, there's no unread indicator.

Some of them also change their title text to show something like "[*3] App name" but of course that doesn't help if you're using a pinned tab in Firefox, which only shows the icon. (I don't know how many users avail themselves of pinned tabs, though.)

timmc avatar Nov 27 '20 00:11 timmc