Skip to content

Conversation

@sawka
Copy link
Member

@sawka sawka commented Dec 16, 2025

No description provided.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 16, 2025

Walkthrough

This PR migrates AI chat empty state to a Jotai atom (WaveAIModel.isChatEmptyAtom) and updates consumers to use the atom. It changes the aipanel input placeholder logic to reflect chat/builder/idle states. Onboarding is bumped to v0.13.1 and a new onboarding content component and patch entry are added. Telemetry for connection dropdown interactions is added. Monaco editor handling is enhanced with keyboard reinjection support and proper onKeyDown listener disposal. Minor lifecycle and event-handling tweaks appear across preview and block utilities.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

  • Review public API change: WaveAIModel.isChatEmpty -> isChatEmptyAtom and ensure all consumers correctly use globalStore.get/set patterns.
  • Verify aipanelinput.tsx placeholder logic and isChatEmptyAtom consumption.
  • Inspect keymodel.ts changes where logic now reads the atom (shouldSwitchToAI behavior and added early return).
  • Check telemetry addition in block/blockutil.tsx and keymodel.ts for correctness (event shape and invocation).
  • Review Monaco reinjection and keydown listener wiring/unwiring in waveconfig.tsx and preview-edit.tsx for event propagation/cleanup correctness.
  • Validate onboarding bump and new component (onboarding-upgrade-v0131.tsx and onboarding-upgrade-patch.tsx) for content, exports, and navigation links.

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Description check ❓ Inconclusive No pull request description was provided by the author. Add a description explaining the purpose of v0.13.1 updates, the onboarding changes, and the specific fixes being applied.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main changes: onboarding updates for v0.13.1 and several small fixes across the codebase.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch sawka/r131-minor

📜 Recent review details

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 72a0a9a and 40be9ad.

📒 Files selected for processing (2)
  • frontend/app/view/preview/preview-edit.tsx (2 hunks)
  • frontend/app/view/waveconfig/waveconfig.tsx (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • frontend/app/view/waveconfig/waveconfig.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Analyze (go)
  • GitHub Check: Build for TestDriver.ai
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (2)
frontend/app/view/preview/preview-edit.tsx (2)

79-86: LGTM: Proper disposer capture for cleanup.

Storing the onKeyDown disposer enables proper cleanup on unmount. The keyboard reinjection logic correctly stops propagation and prevents default when the key is handled.


93-95: LGTM: Proper cleanup prevents memory leaks.

Returning a cleanup function that disposes the keyDown listener ensures the event handler is removed on unmount, preventing potential memory leaks. This follows the correct lifecycle pattern for Monaco editor listeners.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6b26c25 and 72a0a9a.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (8)
  • frontend/app/aipanel/aipanelinput.tsx (2 hunks)
  • frontend/app/aipanel/waveai-model.tsx (4 hunks)
  • frontend/app/block/blockutil.tsx (2 hunks)
  • frontend/app/onboarding/onboarding-common.tsx (1 hunks)
  • frontend/app/onboarding/onboarding-upgrade-patch.tsx (2 hunks)
  • frontend/app/onboarding/onboarding-upgrade-v0131.tsx (1 hunks)
  • frontend/app/store/keymodel.ts (4 hunks)
  • frontend/app/view/waveconfig/waveconfig.tsx (2 hunks)
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: sawka
Repo: wavetermdev/waveterm PR: 2465
File: frontend/app/onboarding/onboarding-upgrade.tsx:13-21
Timestamp: 2025-10-21T05:09:26.916Z
Learning: In the waveterm codebase, clientData is loaded and awaited in wave.ts before React runs, ensuring it is always available when components mount. This means atoms.client will have data on first render.
📚 Learning: 2025-10-21T05:09:26.916Z
Learnt from: sawka
Repo: wavetermdev/waveterm PR: 2465
File: frontend/app/onboarding/onboarding-upgrade.tsx:13-21
Timestamp: 2025-10-21T05:09:26.916Z
Learning: The onboarding upgrade modal in frontend/app/onboarding/onboarding-upgrade.tsx intentionally freezes the lastVersion at mount using a ref to prevent the modal from changing or disappearing mid-interaction when the user is going through the onboarding flow.

Applied to files:

  • frontend/app/onboarding/onboarding-upgrade-v0131.tsx
  • frontend/app/onboarding/onboarding-upgrade-patch.tsx
  • frontend/app/onboarding/onboarding-common.tsx
📚 Learning: 2025-10-21T05:09:26.916Z
Learnt from: sawka
Repo: wavetermdev/waveterm PR: 2465
File: frontend/app/onboarding/onboarding-upgrade.tsx:13-21
Timestamp: 2025-10-21T05:09:26.916Z
Learning: In the waveterm codebase, clientData is loaded and awaited in wave.ts before React runs, ensuring it is always available when components mount. This means atoms.client will have data on first render.

Applied to files:

  • frontend/app/aipanel/waveai-model.tsx
🧬 Code graph analysis (4)
frontend/app/block/blockutil.tsx (1)
frontend/app/store/global.ts (1)
  • recordTEvent (873-873)
frontend/app/aipanel/waveai-model.tsx (1)
frontend/app/store/global.ts (1)
  • globalStore (865-865)
frontend/app/onboarding/onboarding-upgrade-patch.tsx (1)
frontend/app/onboarding/onboarding-upgrade-v0131.tsx (1)
  • UpgradeOnboardingModal_v0_13_1_Content (86-86)
frontend/app/view/waveconfig/waveconfig.tsx (1)
frontend/app/store/keymodel.ts (1)
  • tryReinjectKey (717-717)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Analyze (go)
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: Build for TestDriver.ai
🔇 Additional comments (10)
frontend/app/onboarding/onboarding-common.tsx (1)

4-4: LGTM! Version bump is correct.

The version update to v0.13.1 aligns with the new onboarding content and navigation structure added in the related files.

frontend/app/onboarding/onboarding-upgrade-patch.tsx (2)

21-21: LGTM! Import is correct.

The import statement correctly references the new v0.13.1 content component.


52-58: LGTM! Navigation structure is properly configured.

The version navigation is correctly set up:

  • v0.13.0 now points forward to v0.13.1
  • v0.13.1 points back to v0.13.0
  • v0.13.1 has no nextText, correctly indicating it's the latest version
frontend/app/onboarding/onboarding-upgrade-v0131.tsx (1)

4-86: LGTM! Well-structured onboarding content component.

The v0.13.1 content component is cleanly implemented and follows the established pattern from previous version components. The content is well-organized into three clear sections with appropriate visual hierarchy and styling.

frontend/app/block/blockutil.tsx (1)

5-5: LGTM! Clean telemetry integration.

The addition of telemetry tracking for mouse-initiated connection dropdown interactions is well-implemented. The event recording is non-invasive and follows the established pattern, complementing the keyboard-initiated tracking added in keymodel.ts line 584.

Also applies to: 171-171

frontend/app/aipanel/aipanelinput.tsx (1)

27-27: LGTM! Well-structured refactor to atom-based state.

The refactoring to use isChatEmptyAtom is clean and the dynamic placeholder logic provides a better user experience by adapting to the chat state and context (builder mode vs. standard mode). The three-way conditional is clear and appropriately prioritized.

Also applies to: 32-39, 154-154

frontend/app/store/keymodel.ts (2)

150-150: LGTM! Consistent atom-based state access.

The migration from direct isChatEmpty property access to globalStore.get(aiModel.isChatEmptyAtom) is consistent with the refactoring in waveai-model.tsx. Both call sites in uxCloseBlock and genericClose follow the same pattern correctly.

Also applies to: 188-188


18-18: LGTM! Telemetry tracking for keyboard-initiated flow.

The telemetry event recording for keyboard-initiated connection dropdown (Cmd:g) complements the mouse-initiated tracking in blockutil.tsx line 171, providing complete coverage of both interaction paths.

Also applies to: 584-584

frontend/app/aipanel/waveai-model.tsx (1)

69-69: LGTM! Well-executed migration to atom-based state management.

The refactoring from a direct isChatEmpty: boolean field to isChatEmptyAtom: jotai.PrimitiveAtom<boolean> is consistently applied across all mutation points:

  • clearChat() sets it to true
  • loadInitialChat() sets it based on message count
  • handleSubmit() sets it to false after sending

All consuming code in the PR has been updated to use globalStore.get() or useAtomValue(), making this a clean, complete refactoring. The atom-based approach enables reactive state management across components.

Also applies to: 274-274, 453-453, 526-526

frontend/app/view/waveconfig/waveconfig.tsx (1)

6-6: LGTM!

The new imports are appropriately scoped and used in the keyboard handling integration.

Also applies to: 9-9, 12-12

@sawka sawka merged commit 1e820e5 into main Dec 17, 2025
7 checks passed
@sawka sawka deleted the sawka/r131-minor branch December 17, 2025 00:04
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