Skip to content

Commit 0560e63

Browse files
authored
Merge pull request Stack-Cairn#230 from Mieluoxxx/refactor/native-base-ui
refactor(ui): finish Base UI-only migration on GUI and WebUI
2 parents 3172561 + 0192095 commit 0560e63

29 files changed

Lines changed: 740 additions & 1560 deletions

Makefile

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ GATEWAY_DOCKER_IMAGE ?= liveagent-gateway:local
3030
RELEASE_TAG ?=
3131

3232
.PHONY: all dev build desktop-build-macos desktop-build-macos-release desktop-build-macos-intel desktop-build-macos-m desktop-build-windows desktop-build-linux github-release-main check-github-release-tag help
33-
.PHONY: dev-gateway dev-webui
33+
.PHONY: dev-gateway dev-webui ensure-webui-embed-stub
3434
.PHONY: proto proto-check webui gateway-build gateway-docker-build gateway-docker-run gateway-docker-smoke build-linux build-linux-amd build-linux-arm
3535
.PHONY: clean check-rust-target-% check-macos-signing-identity check-macos-notary-profile desktop-store-macos-notary-profile desktop-wait-macos-notary desktop-staple-macos desktop-verify-macos
3636

@@ -106,12 +106,27 @@ check-github-release-tag:
106106
@node scripts/release/prepare-app-version-from-tag.mjs "$(RELEASE_TAG)" --json >/dev/null
107107

108108
## Gateway development
109-
dev-gateway:
109+
# go:embed requires web/dist at compile time. Dev serves the SPA from Vite, so
110+
# a tiny stub is enough to let `go run` start without a full WebUI build.
111+
dev-gateway: ensure-webui-embed-stub
110112
go -C $(AGENT_GATEWAY_DIR) run ./cmd/gateway --token=$(DEV_GATEWAY_TOKEN) --http-addr=$(DEV_GATEWAY_HTTP_ADDR)
111113

112114
dev-webui:
113115
npm_config_proxy_api=$(DEV_WEBUI_PROXY_API) pnpm --dir $(AGENT_GATEWAY_WEB_DIR) dev
114116

117+
ensure-webui-embed-stub:
118+
@if [ ! -f "$(AGENT_GATEWAY_WEB_DIR)/dist/index.html" ]; then \
119+
mkdir -p "$(AGENT_GATEWAY_WEB_DIR)/dist"; \
120+
printf '%s\n' \
121+
'<!doctype html>' \
122+
'<html lang="en">' \
123+
'<head><meta charset="utf-8"><title>LiveAgent Gateway</title></head>' \
124+
'<body><p>WebUI embed stub. Run <code>make dev-webui</code> for the real SPA.</p></body>' \
125+
'</html>' \
126+
> "$(AGENT_GATEWAY_WEB_DIR)/dist/index.html"; \
127+
echo "created $(AGENT_GATEWAY_WEB_DIR)/dist stub for go:embed"; \
128+
fi
129+
115130
## Gateway build and generated assets
116131
proto:
117132
@command -v buf >/dev/null || (echo "buf is required. Run: mise install" && exit 1)

crates/agent-gateway/web/package.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@
1919
"@git-diff-view/file": "^0.1.3",
2020
"@git-diff-view/react": "^0.1.3",
2121
"@iconify-json/gravity-ui": "^1.2.12",
22-
"@radix-ui/react-dropdown-menu": "^2.1.16",
23-
"@radix-ui/react-scroll-area": "^1.2.10",
24-
"@radix-ui/react-select": "^2.2.6",
25-
"@radix-ui/react-slot": "^1.2.4",
2622
"@sinclair/typebox": "^0.34.49",
2723
"@streamdown/cjk": "^1.0.3",
2824
"@streamdown/code": "^1.1.1",

0 commit comments

Comments
 (0)