Skip to content

Complete onboarding preview coverage for init/telemetry-star flow and align preview state wiring#2965

Merged
sawka merged 4 commits intomainfrom
copilot/add-page-previews-to-onboarding
Mar 2, 2026
Merged

Complete onboarding preview coverage for init/telemetry-star flow and align preview state wiring#2965
sawka merged 4 commits intomainfrom
copilot/add-page-previews-to-onboarding

Conversation

Copy link
Contributor

Copilot AI commented Mar 2, 2026

The onboarding preview was missing the first two pages in the new-install flow (InitPage and NoTelemetryStarPage). This update adds those views to the preview and aligns state access with the current store pattern so they render correctly in preview mode.

  • Preview coverage

    • Added InitPage and NoTelemetryStarPage to frontend/preview/previews/onboarding.preview.tsx so the full early onboarding path is visible in the preview server.
  • Settings access modernization

    • Replaced full settingsAtom usage in InitPage with targeted useSettingsKeyAtom("telemetry:enabled").
    • Removes broad settings dependency and uses the existing preview-safe settings path.
  • Preview bootstrap state init

    • Added ClientModel.getInstance().initialize(null) in frontend/preview/preview.tsx to ensure clientAtom is initialized in preview runtime without backend client data.
// onboarding.tsx
const telemetrySetting = useSettingsKeyAtom("telemetry:enabled");
const clientData = useAtomValue(ClientModel.getInstance().clientAtom);
const [telemetryEnabled, setTelemetryEnabled] = useState<boolean>(!!telemetrySetting);

// preview.tsx
setWaveWindowType("preview");
ClientModel.getInstance().initialize(null);
    • Onboarding preview

🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Co-authored-by: sawka <2722291+sawka@users.noreply.github.com>
Copilot AI changed the title [WIP] Add InitPage and NoTelemetryStarPage previews Add Init and No-Telemetry-Star pages to onboarding preview Mar 2, 2026
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Mar 2, 2026

Deploying waveterm with  Cloudflare Pages  Cloudflare Pages

Latest commit: 7a734e0
Status: ✅  Deploy successful!
Preview URL: https://6ddce0d7.waveterm.pages.dev
Branch Preview URL: https://copilot-add-page-previews-to.waveterm.pages.dev

View logs

Copilot AI and others added 2 commits March 2, 2026 20:02
Co-authored-by: sawka <2722291+sawka@users.noreply.github.com>
Co-authored-by: sawka <2722291+sawka@users.noreply.github.com>
Copilot AI changed the title Add Init and No-Telemetry-Star pages to onboarding preview Complete onboarding preview coverage for init/telemetry-star flow and align preview state wiring Mar 2, 2026
Copilot finished work on behalf of sawka March 2, 2026 20:07
@sawka sawka marked this pull request as ready for review March 2, 2026 20:13
@kilo-code-bot
Copy link
Contributor

kilo-code-bot bot commented Mar 2, 2026

Code Review Summary

Status: 1 Issue Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 1
WARNING 0
SUGGESTION 0
Other Observations (not in diff)

Issues found in unchanged code that cannot receive inline comments:

File Line Issue
frontend/app/onboarding/onboarding.tsx 172, 182 CRITICAL: Runtime error in preview mode - NoTelemetryStarPage attempts RPC calls with null clientId when buttons are clicked in preview mode. The handleStarClick and handleMaybeLater functions should guard RPC calls with isPreviewWindow() check to prevent errors.

Details:

In preview mode, ClientModel.getInstance().initialize(null) is called (as added in this PR), which means clientId will be null. When users interact with the NoTelemetryStarPage preview by clicking either button, the code attempts to call RpcApi.SetMetaCommand with a null clientId, which will cause a runtime error.

Suggested fix:

const handleStarClick = async () => {
    if (isPreviewWindow()) {
        window.open("https://github.com/wavetermdev/waveterm?ref=not", "_blank");
        return;
    }
    const clientId = ClientModel.getInstance().clientId;
    await RpcApi.SetMetaCommand(TabRpcClient, {
        oref: WOS.makeORef("client", clientId),
        meta: { "onboarding:githubstar": true },
    });
    window.open("https://github.com/wavetermdev/waveterm?ref=not", "_blank");
    setPageName("features");
};

You'll need to import isPreviewWindow from "@/app/store/windowtype".

Files Reviewed (3 files)
  • frontend/app/onboarding/onboarding.tsx - 1 issue (in unchanged code)
  • frontend/preview/preview.tsx - No issues
  • frontend/preview/previews/onboarding.preview.tsx - No issues

Positive observations:

  • ✅ Good refactoring to use useSettingsKeyAtom instead of accessing settings object directly
  • ✅ Proper optional chaining added for clientData?.tosagreed to handle null in preview mode
  • ✅ Clean export of components for preview usage
  • ✅ Appropriate comment explaining why ClientModel.getInstance().initialize(null) is needed in preview mode

Fix these issues in Kilo Cloud

@sawka sawka merged commit 9d89f43 into main Mar 2, 2026
7 checks passed
@sawka sawka deleted the copilot/add-page-previews-to-onboarding branch March 2, 2026 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants