Favicon matches the app icon

The white plane in a blue ring on the dark rounded square, tuned to read
at 16 px, instead of the plane emoji (which looked different everywhere).
Adds favicon.ico (16/32/48) for browsers and tools that ask for it, busts
the cached SVG with ?v=2, and keeps it with the offline page.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rickyandClaude Opus 5.5 committed 2026-11-14 14:37:30 -05:00
1 parent 291990412e
commit ec0f43019f
8 files changed
+21 -8

No files matched your search

+2 -1
View File
@@ -14,7 +14,8 @@
<meta name="theme-color" content="#0f172a"> <meta name="theme-color" content="#0f172a">
<meta name="apple-mobile-web-app-title" content="SAM"> <meta name="apple-mobile-web-app-title" content="SAM">
<meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="icon" href="/favicon.svg" type="image/svg+xml"> <link rel="icon" href="/favicon.ico" sizes="32x32">
<link rel="icon" href="/favicon.svg?v=2" type="image/svg+xml">
<link rel="apple-touch-icon" href="/apple-touch-icon.png"> <link rel="apple-touch-icon" href="/apple-touch-icon.png">
<%= stylesheet_link_tag :app, "data-turbo-track": "reload" %> <%= stylesheet_link_tag :app, "data-turbo-track": "reload" %>
<%= javascript_importmap_tags %> <%= javascript_importmap_tags %>
+2 -1
View File
@@ -12,7 +12,8 @@
<meta name="theme-color" content="#0f172a"> <meta name="theme-color" content="#0f172a">
<meta name="apple-mobile-web-app-title" content="SAM"> <meta name="apple-mobile-web-app-title" content="SAM">
<meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="icon" href="/favicon.svg" type="image/svg+xml"> <link rel="icon" href="/favicon.ico" sizes="32x32">
<link rel="icon" href="/favicon.svg?v=2" type="image/svg+xml">
<link rel="apple-touch-icon" href="/apple-touch-icon.png"> <link rel="apple-touch-icon" href="/apple-touch-icon.png">
<%= stylesheet_link_tag :app, "data-turbo-track": "reload" %> <%= stylesheet_link_tag :app, "data-turbo-track": "reload" %>
<%= javascript_importmap_tags %> <%= javascript_importmap_tags %>
+1 -1
View File
@@ -10,7 +10,7 @@
<%# Always a full page load: a Turbo visit would keep the app's dark theme <%# Always a full page load: a Turbo visit would keep the app's dark theme
on this white page, and leave this page's styles behind on Back. %> on this white page, and leave this page's styles behind on Back. %>
<meta name="turbo-visit-control" content="reload"> <meta name="turbo-visit-control" content="reload">
<% unless @standalone %><link rel="icon" href="/favicon.svg" type="image/svg+xml"><% end %> <% unless @standalone %><link rel="icon" href="/favicon.ico" sizes="32x32"><link rel="icon" href="/favicon.svg?v=2" type="image/svg+xml"><% end %>
<%= stylesheet_link_tag :app, "data-turbo-track": "reload" %> <%= stylesheet_link_tag :app, "data-turbo-track": "reload" %>
<%# No Turbo here (Back is then an ordinary page load); just the Print button. %> <%# No Turbo here (Back is then an ordinary page load); just the Print button. %>
<script nonce="<%= content_security_policy_nonce %>"> <script nonce="<%= content_security_policy_nonce %>">
+2 -1
View File
@@ -5,7 +5,8 @@
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="theme-color" content="#0f172a"> <meta name="theme-color" content="#0f172a">
<title><%= t(".title") %></title> <title><%= t(".title") %></title>
<link rel="icon" href="/favicon.svg" type="image/svg+xml"> <link rel="icon" href="/favicon.ico" sizes="32x32">
<link rel="icon" href="/favicon.svg?v=2" type="image/svg+xml">
<style> <style>
:root { --page: #f1f5f9; --surface: #fff; --text: #1e293b; --muted: #64748b; --accent: #0369a1; } :root { --page: #f1f5f9; --surface: #fff; --text: #1e293b; --muted: #64748b; --accent: #0369a1; }
@media (prefers-color-scheme: dark) { @media (prefers-color-scheme: dark) {
+1 -1
View File
@@ -24,7 +24,7 @@ const SHORTCUTS = { "/go/log-flight": "flight_logs", "/go/report-squawk": "squaw
// A proxy in front of the app (Traefik, Authentik) answers these when the app // A proxy in front of the app (Traefik, Authentik) answers these when the app
// itself can't be reached: treat them like no connection. // itself can't be reached: treat them like no connection.
const UNREACHABLE = [ 502, 503, 504 ] const UNREACHABLE = [ 502, 503, 504 ]
const SHELL = [ "/offline", "/offline.js", "/icon.svg", "/icon-192.png" ] const SHELL = [ "/offline", "/offline.js", "/icon.svg", "/icon-192.png", "/favicon.svg" ]
self.addEventListener("install", (event) => { self.addEventListener("install", (event) => {
event.waitUntil(caches.open(SHELL_CACHE).then((cache) => cache.addAll(SHELL)).then(() => self.skipWaiting())) event.waitUntil(caches.open(SHELL_CACHE).then((cache) => cache.addAll(SHELL)).then(() => self.skipWaiting()))
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

+5 -1
View File
@@ -1 +1,5 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text x="50" y="50" font-size="88" text-anchor="middle" dominant-baseline="central">✈️</text></svg> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
<rect width="512" height="512" rx="112" fill="#0f172a"/>
<circle cx="256" cy="256" r="200" fill="none" stroke="#0369a1" stroke-width="30"/>
<path fill="#fff" transform="translate(256 256) scale(1.08) translate(-256 -256)" d="M256 92C270 92 278 108 278 128L278 214L408 270L408 300L278 280L276 370L326 400L326 424L256 410L186 424L186 400L236 370L234 280L104 300L104 270L234 214L234 128C234 108 242 92 256 92Z"/>
</svg>

Before

Width:  |  Height:  |  Size: 166 B

After

Width:  |  Height:  |  Size: 486 B

+8 -2
View File
@@ -34,8 +34,14 @@ class PwaTest < ActionDispatch::IntegrationTest
assert_select "link[rel=manifest][href='/manifest.json'][crossorigin=use-credentials]" # behind an auth proxy (Authentik) the manifest needs cookies assert_select "link[rel=manifest][href='/manifest.json'][crossorigin=use-credentials]" # behind an auth proxy (Authentik) the manifest needs cookies
assert_select "meta[name=theme-color]" assert_select "meta[name=theme-color]"
assert_select "link[rel=apple-touch-icon][href='/apple-touch-icon.png']" assert_select "link[rel=apple-touch-icon][href='/apple-touch-icon.png']"
assert_select "link[rel=icon][href='/favicon.svg']" assert_select "link[rel=icon][href='/favicon.svg?v=2']"
assert_includes Rails.public_path.join("favicon.svg").read, "✈️" assert_select "link[rel=icon][href='/favicon.ico']"
# The same design as the app icon (colours and plane), not an emoji.
favicon, icon = %w[favicon.svg icon.svg].map { Rails.public_path.join(_1).read }
plane = icon[/<path fill="#fff" d="([^"]+)"/, 1]
assert_includes favicon, plane
%w[#0f172a #0369a1].each { assert_includes favicon, _1 }
assert_equal [ 0, 1, 3 ], Rails.public_path.join("favicon.ico").binread(6).unpack("v3") # an icon file with 3 sizes
token = create_aircraft(owner: create_user("o2@example.com")).share_tokens.create!(privilege: "status") token = create_aircraft(owner: create_user("o2@example.com")).share_tokens.create!(privilege: "status")
get shared_path(token.token) get shared_path(token.token)