Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 3 additions & 15 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -140,14 +140,13 @@ run-ui-only:
@echo "Running UI..."
cd ui/desktop && pnpm install && pnpm run start-gui

debug-ui *alpha:
@echo "🚀 Starting goose frontend in external backend mode{{ if alpha == "alpha" { " with alpha features enabled" } else { "" } }}"
debug-ui:
@echo "🚀 Starting goose frontend in external backend mode"
cd ui/desktop && \
export GOOSE_EXTERNAL_BACKEND=true && \
export GOOSE_SERVER__SECRET_KEY="${GOOSE_SERVER__SECRET_KEY:-test}" && \
{{ if alpha == "alpha" { "export ALPHA=true &&" } else { "" } }} \
pnpm install && \
pnpm run {{ if alpha == "alpha" { "start-alpha-gui" } else { "start-gui" } }}
pnpm run start-gui

# Run UI with main process debugging enabled
# To debug main process:
Expand All @@ -173,12 +172,6 @@ package-ui:
codesign --force --deep --sign - --entitlements ui/desktop/entitlements.plist ui/desktop/out/Goose-darwin-arm64/Goose.app
@echo "Done! Launch with: open ui/desktop/out/Goose-darwin-arm64/Goose.app"

# Run UI with alpha changes
run-ui-alpha:
@just release-binary
@echo "Running UI with alpha features..."
cd ui/desktop && pnpm install && ALPHA=true pnpm run start-alpha-gui

# Run UI with latest (Windows version)
run-ui-windows:
@just release-windows
Expand Down Expand Up @@ -254,11 +247,6 @@ make-ui:
@just release-binary
cd ui/desktop && pnpm run bundle:default

# make GUI with latest binary and alpha features enabled
make-ui-alpha:
@just release-binary
cd ui/desktop && pnpm run bundle:alpha

# make GUI with latest Windows binary
make-ui-windows:
@just release-windows
Expand Down
4 changes: 1 addition & 3 deletions ui/desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
"start:test-error": "GOOSE_TEST_ERROR=true electron-forge start",
"package": "pnpm run i18n:compile && electron-forge package",
"make": "pnpm run i18n:compile && electron-forge make",
"bundle:default": "node scripts/prepare-platform-binaries.js && pnpm run make && BUNDLE_NAME=\"${GOOSE_BUNDLE_NAME:-Goose}\" && APP_DIR=\"out/${BUNDLE_NAME}-darwin-arm64\" && APP_BUNDLE=\"${APP_DIR}/${BUNDLE_NAME}.app\" && (cd \"$APP_DIR\" && ditto -c -k --sequesterRsrc --keepParent \"${BUNDLE_NAME}.app\" \"${BUNDLE_NAME}.zip\") || echo \"${APP_BUNDLE} not found; either the binary is not built or you are not on macOS\"",
"bundle:alpha": "ALPHA=true node scripts/prepare-platform-binaries.js && ALPHA=true pnpm run make && BUNDLE_NAME=\"${GOOSE_BUNDLE_NAME:-Goose}\" && APP_DIR=\"out/${BUNDLE_NAME}-darwin-arm64\" && APP_BUNDLE=\"${APP_DIR}/${BUNDLE_NAME}.app\" && (cd \"$APP_DIR\" && ditto -c -k --sequesterRsrc --keepParent \"${BUNDLE_NAME}.app\" \"${BUNDLE_NAME}_alpha.zip\") || echo \"${APP_BUNDLE} not found; either the binary is not built or you are not on macOS\"",
"bundle:default": "node scripts/prepare-platform-binaries.js && pnpm run make && BUNDLE_NAME=\"${GOOSE_BUNDLE_NAME:-Goose}\" && APP_DIR=\"out/${BUNDLE_NAME}-darwin-arm64\" && APP_BUNDLE=\"${APP_DIR}/${BUNDLE_NAME}.app\" && (cd \"$APP_DIR\" && ditto -c -k --sequesterRsrc --keepParent \"${BUNDLE_NAME}.app\" \"${BUNDLE_NAME}.zip\")",
"bundle:intel": "node scripts/prepare-platform-binaries.js && pnpm run make --arch=x64 && BUNDLE_NAME=\"${GOOSE_BUNDLE_NAME:-Goose}\" && APP_DIR=\"out/${BUNDLE_NAME}-darwin-x64\" && APP_BUNDLE=\"${APP_DIR}/${BUNDLE_NAME}.app\" && (cd \"$APP_DIR\" && ditto -c -k --sequesterRsrc --keepParent \"${BUNDLE_NAME}.app\" \"${BUNDLE_NAME}_intel_mac.zip\")",
"debug": "echo 'run --remote-debugging-port=8315' && BUNDLE_NAME=\"${GOOSE_BUNDLE_NAME:-Goose}\" && lldb \"out/${BUNDLE_NAME}-darwin-arm64/${BUNDLE_NAME}.app\"",
"test-e2e": "pnpm run generate-api && playwright test",
Expand All @@ -38,7 +37,6 @@
"test:integration": "vitest run --config vitest.integration.config.ts",
"test:integration:watch": "vitest --config vitest.integration.config.ts",
"test:integration:debug": "DEBUG=1 vitest run --config vitest.integration.config.ts",
"start-alpha-gui": "ALPHA=true pnpm run start-gui",
"i18n:extract": "formatjs extract 'src/**/*.{ts,tsx}' --out-file src/i18n/messages/en.json --flatten && pnpm run i18n:compile",
"i18n:check": "node scripts/i18n-check.js",
"i18n:compile": "node scripts/i18n-compile.js"
Expand Down
19 changes: 5 additions & 14 deletions ui/desktop/src/components/GooseSidebar/EnvironmentBadge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ import { Tooltip, TooltipContent, TooltipTrigger } from '../ui/Tooltip';
import { defineMessages, useIntl } from '../../i18n';

const i18n = defineMessages({
alpha: {
id: 'environmentBadge.alpha',
defaultMessage: 'Alpha',
},
dev: {
id: 'environmentBadge.dev',
defaultMessage: 'Dev',
Expand All @@ -19,18 +15,13 @@ interface EnvironmentBadgeProps {

const EnvironmentBadge: React.FC<EnvironmentBadgeProps> = ({ className = '' }) => {
const intl = useIntl();
const isAlpha = process.env.ALPHA;
const isDevelopment = import.meta.env.DEV;

// Don't show badge in production
if (!isDevelopment && !isAlpha) {
if (!isDevelopment) {
return null;
}

const tooltipText = isAlpha
? intl.formatMessage(i18n.alpha)
: intl.formatMessage(i18n.dev);
const bgColor = isAlpha ? 'bg-purple-600' : 'bg-orange-400';
const tooltipText = intl.formatMessage(i18n.dev);

return (
<Tooltip>
Expand All @@ -41,13 +32,13 @@ const EnvironmentBadge: React.FC<EnvironmentBadgeProps> = ({ className = '' }) =
aria-label={tooltipText}
>
<div className="absolute -inset-1" />
<div className={`${bgColor} w-2 h-2 rounded-full`} />
<div className="bg-orange-400 w-2 h-2 rounded-full" />
</div>
</TooltipTrigger>
<TooltipContent
side="bottom"
className={bgColor}
arrowClassName={isAlpha ? 'fill-purple-600 bg-purple-600' : 'fill-orange-400 bg-orange-400'}
className="bg-orange-400"
arrowClassName="fill-orange-400 bg-orange-400"
>
{tooltipText}
</TooltipContent>
Expand Down
3 changes: 0 additions & 3 deletions ui/desktop/src/i18n/messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -932,9 +932,6 @@
"envVarsSection.variableName": {
"defaultMessage": "Variable name"
},
"environmentBadge.alpha": {
"defaultMessage": "Alpha"
},
"environmentBadge.dev": {
"defaultMessage": "Dev"
},
Expand Down
2 changes: 0 additions & 2 deletions ui/desktop/vite.renderer.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import tailwindcss from '@tailwindcss/vite';
// https://vitejs.dev/config
export default defineConfig({
define: {
// This replaces process.env.ALPHA with a literal at build time
'process.env.ALPHA': JSON.stringify(process.env.ALPHA === 'true'),
'process.env.GOOSE_TUNNEL': JSON.stringify(process.env.GOOSE_TUNNEL !== 'no' && process.env.GOOSE_TUNNEL !== 'none'),
},

Expand Down
Loading