detached 3655ce7

fix: add public dir with favicon.png for webui dumb:// URLs

commit
3655ce7aa5921f25e5426b0ab8b9ed111d813ef6
author
brice · · 2025-12-28 16:59 UTC
parent
c7f6c5b
signature
unsigned
2 files · +21 -0
A webui/public/favicon.png +0 -0 binary file: no text diff

binary file: no text diff

M webui/vite.config.ts +21 -0
@@ -2,6 +2,7 @@ import { defineConfig } from "vite";
22 import { svelte } from "@sveltejs/vite-plugin-svelte";
33 import { resolve } from "path";
44 import { pageGenerator } from "./vite-plugin-pages";
5+import { copyFileSync, existsSync, mkdirSync } from "fs";
56
67 // Page configurations for dumb:// protocol pages
78 const pages = {
@@ -46,6 +47,20 @@ const pages = {
4647 // Get page from VITE_PAGE env var, default to building all
4748 const targetPage = process.env.VITE_PAGE as keyof typeof pages | undefined;
4849
50+// Copy public assets to output directory
51+function copyPublicAssets() {
52+ const outDir = resolve(__dirname, "../assets/webui");
53+ const publicDir = resolve(__dirname, "public");
54+ if (!existsSync(outDir)) {
55+ mkdirSync(outDir, { recursive: true });
56+ }
57+ // Copy favicon.png for dumb:// URL favicons
58+ const faviconSrc = resolve(publicDir, "favicon.png");
59+ if (existsSync(faviconSrc)) {
60+ copyFileSync(faviconSrc, resolve(outDir, "favicon.png"));
61+ }
62+}
63+
4964 // Build single page config
5065 function buildPageConfig(pageName: keyof typeof pages) {
5166 const page = pages[pageName];
@@ -55,6 +70,12 @@ function buildPageConfig(pageName: keyof typeof pages) {
5570 emitCss: false, // Inline component CSS for shadow DOM compatibility
5671 }),
5772 pageGenerator([page.html]),
73+ {
74+ name: "copy-public-assets",
75+ closeBundle() {
76+ copyPublicAssets();
77+ },
78+ },
5879 ],
5980 build: {
6081 rollupOptions: {
@@ -2,6 +2,7 @@ import { defineConfig } from "vite";
2 import { svelte } from "@sveltejs/vite-plugin-svelte";2 import { svelte } from "@sveltejs/vite-plugin-svelte";
3 import { resolve } from "path";3 import { resolve } from "path";
4 import { pageGenerator } from "./vite-plugin-pages";4 import { pageGenerator } from "./vite-plugin-pages";
5+import { copyFileSync, existsSync, mkdirSync } from "fs";
5 6
6 // Page configurations for dumb:// protocol pages7 // Page configurations for dumb:// protocol pages
7 const pages = {8 const pages = {
@@ -46,6 +47,20 @@ const pages = {
46 // Get page from VITE_PAGE env var, default to building all47 // Get page from VITE_PAGE env var, default to building all
47 const targetPage = process.env.VITE_PAGE as keyof typeof pages | undefined;48 const targetPage = process.env.VITE_PAGE as keyof typeof pages | undefined;
48 49
50+// Copy public assets to output directory
51+function copyPublicAssets() {
52+ const outDir = resolve(__dirname, "../assets/webui");
53+ const publicDir = resolve(__dirname, "public");
54+ if (!existsSync(outDir)) {
55+ mkdirSync(outDir, { recursive: true });
56+ }
57+ // Copy favicon.png for dumb:// URL favicons
58+ const faviconSrc = resolve(publicDir, "favicon.png");
59+ if (existsSync(faviconSrc)) {
60+ copyFileSync(faviconSrc, resolve(outDir, "favicon.png"));
61+ }
62+}
63+
49 // Build single page config64 // Build single page config
50 function buildPageConfig(pageName: keyof typeof pages) {65 function buildPageConfig(pageName: keyof typeof pages) {
51 const page = pages[pageName];66 const page = pages[pageName];
@@ -55,6 +70,12 @@ function buildPageConfig(pageName: keyof typeof pages) {
55 emitCss: false, // Inline component CSS for shadow DOM compatibility70 emitCss: false, // Inline component CSS for shadow DOM compatibility
56 }),71 }),
57 pageGenerator([page.html]),72 pageGenerator([page.html]),
73+ {
74+ name: "copy-public-assets",
75+ closeBundle() {
76+ copyPublicAssets();
77+ },
78+ },
58 ],79 ],
59 build: {80 build: {
60 rollupOptions: {81 rollupOptions: {

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 8

Tags 42

↑↓ moveenter openesc close