detached 353ffbf

chore: cleanup and build improvements

- vite.config.homepage.ts: Inline CSS for shadow DOM compatibility.
  Set emitCss=false and cssCodeSplit=false, remove css file from page config.
- browser.go: Remove unused InjectGUIBundle method (28 lines)
- Makefile: Add GUI assets to clean target for complete cleanup

These changes improve the build process and remove unused code.
commit
353ffbf2d600d113701d57e6d2eab9c1bc42befa
author
bamen · · 2025-10-13 21:16 UTC
committer
bamen · · 2025-10-13 16:35 UTC
parent
eac27b2
signature
unsigned
3 files · +5 -25
M Makefile +1 -0
@@ -123,6 +123,7 @@ clean: ## Clean build artifacts
123123 rm -rf $(DIST_DIR)
124124 rm -f $(BINARY_NAME) # Remove any old binaries in root
125125 rm -rf gui/dist gui/node_modules
126+ rm -f assets/gui/gui.min.js assets/gui/homepage.min.js assets/gui/homepage.css assets/gui/main-world.min.js assets/gui/color-scheme.js
126127 go clean -cache
127128 go clean -testcache
128129
@@ -123,6 +123,7 @@ clean: ## Clean build artifacts
123 rm -rf $(DIST_DIR)123 rm -rf $(DIST_DIR)
124 rm -f $(BINARY_NAME) # Remove any old binaries in root124 rm -f $(BINARY_NAME) # Remove any old binaries in root
125 rm -rf gui/dist gui/node_modules125 rm -rf gui/dist gui/node_modules
126+ rm -f assets/gui/gui.min.js assets/gui/homepage.min.js assets/gui/homepage.css assets/gui/main-world.min.js assets/gui/color-scheme.js
126 go clean -cache127 go clean -cache
127 go clean -testcache128 go clean -testcache
128 129
M gui/vite.config.homepage.ts +4 -3
@@ -5,13 +5,14 @@ import { pageGenerator } from "./vite-plugin-pages";
55
66 export default defineConfig({
77 plugins: [
8- svelte(),
8+ svelte({
9+ emitCss: false, // Inline component CSS for shadow DOM compatibility
10+ }),
911 pageGenerator([
1012 {
1113 name: "homepage",
1214 title: "Dumber Browser",
1315 script: "homepage.min.js",
14- css: "homepage.css",
1516 filename: "index.html",
1617 },
1718 ]),
@@ -33,7 +34,7 @@ export default defineConfig({
3334 target: ["es2020", "chrome91", "firefox90"],
3435 minify: true,
3536 sourcemap: false,
36- cssCodeSplit: true,
37+ cssCodeSplit: false,
3738 assetsInlineLimit: 4096,
3839 },
3940 resolve: {
@@ -5,13 +5,14 @@ import { pageGenerator } from "./vite-plugin-pages";
5 5
6 export default defineConfig({6 export default defineConfig({
7 plugins: [7 plugins: [
8- svelte(),8+ svelte({
9+ emitCss: false, // Inline component CSS for shadow DOM compatibility
10+ }),
9 pageGenerator([11 pageGenerator([
10 {12 {
11 name: "homepage",13 name: "homepage",
12 title: "Dumber Browser",14 title: "Dumber Browser",
13 script: "homepage.min.js",15 script: "homepage.min.js",
14- css: "homepage.css",
15 filename: "index.html",16 filename: "index.html",
16 },17 },
17 ]),18 ]),
@@ -33,7 +34,7 @@ export default defineConfig({
33 target: ["es2020", "chrome91", "firefox90"],34 target: ["es2020", "chrome91", "firefox90"],
34 minify: true,35 minify: true,
35 sourcemap: false,36 sourcemap: false,
36- cssCodeSplit: true,37+ cssCodeSplit: false,
37 assetsInlineLimit: 4096,38 assetsInlineLimit: 4096,
38 },39 },
39 resolve: {40 resolve: {
M internal/services/browser.go +0 -22
@@ -124,28 +124,6 @@ func (s *BrowserService) GetGUIBundle() string {
124124 return s.guiBundle
125125 }
126126
127-// InjectGUIBundle injects the unified GUI bundle and initializes controls
128-func (s *BrowserService) InjectGUIBundle(ctx context.Context) error {
129- _ = ctx
130- if s.webView == nil {
131- return fmt.Errorf("webview not attached")
132- }
133- if s.guiBundle == "" {
134- return fmt.Errorf("GUI bundle not loaded")
135- }
136-
137- // Inject the unified GUI bundle first
138- bundleScript := s.guiBundle +
139- ";(function(){" +
140- "if(window.__dumber_gui && window.__dumber_gui.initializeControls){" +
141- "window.__dumber_gui.initializeControls();" +
142- "console.log('✅ Controls initialized via GUI bundle');" +
143- "}else{console.error('❌ GUI bundle not properly loaded');}" +
144- "})();"
145-
146- return s.webView.InjectScript(bundleScript)
147-}
148-
149127 // InjectToastSystem injects the GUI bundle and initializes the toast system
150128 func (s *BrowserService) InjectToastSystem(ctx context.Context, theme string) error {
151129 _ = ctx
@@ -124,28 +124,6 @@ func (s *BrowserService) GetGUIBundle() string {
124 return s.guiBundle124 return s.guiBundle
125 }125 }
126 126
127-// InjectGUIBundle injects the unified GUI bundle and initializes controls
128-func (s *BrowserService) InjectGUIBundle(ctx context.Context) error {
129- _ = ctx
130- if s.webView == nil {
131- return fmt.Errorf("webview not attached")
132- }
133- if s.guiBundle == "" {
134- return fmt.Errorf("GUI bundle not loaded")
135- }
136-
137- // Inject the unified GUI bundle first
138- bundleScript := s.guiBundle +
139- ";(function(){" +
140- "if(window.__dumber_gui && window.__dumber_gui.initializeControls){" +
141- "window.__dumber_gui.initializeControls();" +
142- "console.log('✅ Controls initialized via GUI bundle');" +
143- "}else{console.error('❌ GUI bundle not properly loaded');}" +
144- "})();"
145-
146- return s.webView.InjectScript(bundleScript)
147-}
148-
149 // InjectToastSystem injects the GUI bundle and initializes the toast system127 // InjectToastSystem injects the GUI bundle and initializes the toast system
150 func (s *BrowserService) InjectToastSystem(ctx context.Context, theme string) error {128 func (s *BrowserService) InjectToastSystem(ctx context.Context, theme string) error {
151 _ = ctx129 _ = ctx

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