From 5c01fdbebf4d1b71d3fbbb7bdf5be49a230bb8a7 Mon Sep 17 00:00:00 2001 From: Kraust Date: Sun, 31 Aug 2025 11:28:24 -0400 Subject: [PATCH] refactor: replace inline favicon SVGs with external assets - Add neovim.svg and neovim-inactive.svg icon files - Update favicon type from image/x-icon to image/svg+xml - Simplify status icon logic to use external SVG files - Add default favicon link in HTML head --- server/static/client.js | 26 ++++++++++---------------- server/static/index.html | 1 + server/static/neovim-inactive.svg | 27 +++++++++++++++++++++++++++ server/static/neovim.svg | 27 +++++++++++++++++++++++++++ 4 files changed, 65 insertions(+), 16 deletions(-) create mode 100644 server/static/neovim-inactive.svg create mode 100644 server/static/neovim.svg diff --git a/server/static/client.js b/server/static/client.js index fa1270a..1d9f1b4 100644 --- a/server/static/client.js +++ b/server/static/client.js @@ -58,31 +58,25 @@ class NeovimClient { let link = document.querySelector("link[rel*='icon']"); if (!link) { link = document.createElement("link"); - link.type = "image/x-icon"; + link.type = "image/svg+xml"; link.rel = "shortcut icon"; document.head.appendChild(link); } - let svgContent; switch (status) { - case "connected": - svgContent = - ''; + case "error": { + link.href = "neovim-inactive.svg"; break; - case "connecting": - svgContent = - '🔄'; + } + case "connecting": { + link.href = "neovim-inactive.svg"; break; - case "error": - svgContent = - ''; + } + default: { + link.href = "neovim.svg"; break; - default: - svgContent = - '📝'; + } } - - link.href = "data:image/svg+xml," + encodeURIComponent(svgContent); } handleMessage(msg) { diff --git a/server/static/index.html b/server/static/index.html index e290afc..56fefcf 100644 --- a/server/static/index.html +++ b/server/static/index.html @@ -4,6 +4,7 @@ Neovim Server + diff --git a/server/static/neovim-inactive.svg b/server/static/neovim-inactive.svg new file mode 100644 index 0000000..a8a9ea7 --- /dev/null +++ b/server/static/neovim-inactive.svg @@ -0,0 +1,27 @@ + + + neovim-mark-greyscale@2x + Created with Sketch (http://www.bohemiancoding.com/sketch) + + + + + + + + + + + + + + + + + + + + + + + diff --git a/server/static/neovim.svg b/server/static/neovim.svg new file mode 100644 index 0000000..46c5eb8 --- /dev/null +++ b/server/static/neovim.svg @@ -0,0 +1,27 @@ + + + neovim-mark@2x + Created with Sketch (http://www.bohemiancoding.com/sketch) + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file