diff --git a/spx-gui/public/tutorial-intro/code-drag-hint.mov b/spx-gui/public/tutorial-intro/code-drag-hint.mov new file mode 100644 index 0000000000..59e96e505c Binary files /dev/null and b/spx-gui/public/tutorial-intro/code-drag-hint.mov differ diff --git a/spx-gui/src/apps/xbuilder/.env b/spx-gui/src/apps/xbuilder/.env index 3c3fc31856..a898bba11a 100644 --- a/spx-gui/src/apps/xbuilder/.env +++ b/spx-gui/src/apps/xbuilder/.env @@ -40,6 +40,10 @@ VITE_USERCONTENT_UPLOAD_BASE_URL="" # Optional as they have default values. VITE_DISABLE_AIGC="false" +# Use a local mock Copilot response in Vite development so product walkthroughs +# are not blocked by Account OAuth. This is ignored in production builds. +VITE_COPILOT_LOCAL_PREVIEW="false" + # Version of spx, keep in sync with the version in `install-spx.sh`. VITE_SPX_VERSION="2.0.4" @@ -69,3 +73,10 @@ VITE_DEFAULT_LANG="en" # # Required when enabling the new Account OAuth flow. VITE_ACCOUNT_OAUTH_CLIENT_ID="" + +# Optional. Overrides the OAuth redirect URI used by app xbuilder. +# +# Leave empty for normal deployments so the app uses the current web origin. +# Local staging previews can set this to a callback URI registered in the +# staging Account backend. +VITE_ACCOUNT_OAUTH_REDIRECT_URI="" diff --git a/spx-gui/src/apps/xbuilder/.env.staging b/spx-gui/src/apps/xbuilder/.env.staging index f23aa21eac..c62b369cf5 100644 --- a/spx-gui/src/apps/xbuilder/.env.staging +++ b/spx-gui/src/apps/xbuilder/.env.staging @@ -10,5 +10,7 @@ VITE_USERCONTENT_UPLOAD_BASE_URL="https://upload.qiniup.com" VITE_SENTRY_DSN="https://0d463740215eb87f7e06f6572d64c93e@o4509472134987776.ingest.us.sentry.io/4509472136167424" VITE_SHOW_TUTORIALS_ENTRY="true" +VITE_COPILOT_LOCAL_PREVIEW="true" VITE_ACCOUNT_OAUTH_CLIENT_ID="1" +VITE_ACCOUNT_OAUTH_REDIRECT_URI="https://goplus-builder.qiniu.io/sign-in/callback" diff --git a/spx-gui/src/apps/xbuilder/env.ts b/spx-gui/src/apps/xbuilder/env.ts index d852b0181b..0e9f34169b 100644 --- a/spx-gui/src/apps/xbuilder/env.ts +++ b/spx-gui/src/apps/xbuilder/env.ts @@ -5,8 +5,11 @@ export const disableAIGC = import.meta.env.VITE_DISABLE_AIGC === 'true' export const spxVersion = import.meta.env.VITE_SPX_VERSION as string export const showLicense = import.meta.env.VITE_SHOW_LICENSE === 'true' export const showTutorialsEntry = import.meta.env.VITE_SHOW_TUTORIALS_ENTRY === 'true' +export const tutorialIntroVideoUrl = + (import.meta.env.VITE_TUTORIAL_INTRO_VIDEO_URL as string) || '/tutorial-intro/code-drag-hint.mov' export const defaultLang = (import.meta.env.VITE_DEFAULT_LANG as string) || 'en' export const accountOAuthClientId = import.meta.env.VITE_ACCOUNT_OAUTH_CLIENT_ID as string +export const accountOAuthRedirectUri = (import.meta.env.VITE_ACCOUNT_OAUTH_REDIRECT_URI as string) || undefined const sentryTracesSampleRate = parseFloat(import.meta.env.VITE_SENTRY_TRACES_SAMPLE_RATE as string) const sentryLSPSampleRate = parseFloat(import.meta.env.VITE_SENTRY_LSP_SAMPLE_RATE as string) export const sentry = { diff --git a/spx-gui/src/apps/xbuilder/pages/editor/index.vue b/spx-gui/src/apps/xbuilder/pages/editor/index.vue index e683866cbd..62ec4c83d4 100644 --- a/spx-gui/src/apps/xbuilder/pages/editor/index.vue +++ b/spx-gui/src/apps/xbuilder/pages/editor/index.vue @@ -3,7 +3,7 @@
-
+
{{ $t(allQueryRet.progress.value.desc ?? { en: 'Loading...', zh: '加载中...' }) }} @@ -64,6 +64,7 @@ import { cloudHelpers } from '@/models/common/cloud' import { localHelpers, type LocalHelpers } from '@/models/common/local' import type { ProjectSerialized } from '@/models/project' import { SpxProject } from '@/models/spx/project' +import { useMaybeTutorial } from '@/components/tutorials/tutorial' const props = defineProps<{ ownerNameInput: string @@ -72,6 +73,8 @@ const props = defineProps<{ const localCache = new LocalCache(localHelpers) const signedInStateQuery = useSignedInStateQuery() +const tutorial = useMaybeTutorial() +const isTutorialCourse = computed(() => tutorial?.currentCourse != null) const router = useRouter() const routeProjectIdentifier = computed(() => ({ diff --git a/spx-gui/src/apps/xbuilder/pages/tutorials/course-series.vue b/spx-gui/src/apps/xbuilder/pages/tutorials/course-series.vue index ebba6ea918..ece214ffc1 100644 --- a/spx-gui/src/apps/xbuilder/pages/tutorials/course-series.vue +++ b/spx-gui/src/apps/xbuilder/pages/tutorials/course-series.vue @@ -1,20 +1,18 @@