Skip to content

Load AI dock on first open - #1122

Merged
tannerlinsley merged 1 commit into
mainfrom
agent/load-ai-dock-on-first-open
Aug 5, 2026
Merged

Load AI dock on first open#1122
tannerlinsley merged 1 commit into
mainfrom
agent/load-ai-dock-on-first-open

Conversation

@tannerlinsley

@tannerlinsley tannerlinsley commented Aug 5, 2026

Copy link
Copy Markdown
Member

Summary

  • Mount the lazy search/AI bundle when the AI dock is opened directly.
  • Apply the same invariant to questions routed directly into the dock.

Evidence

SearchProvider rendered LazySearchModal only after hasLoadedSearch became true. openSearch set that flag, but openAiDock and askAiDock did not, so a first direct Ask AI action could set the dock state without mounting the component that renders it. This matches the missing sidebar reported in #1116 and is independent of extension behavior.

Impact

The desktop and mobile Ask AI actions now render the dock on first use while keeping the search/AI bundle lazy until the user invokes it.

Validation

  • pnpm test (144 pass, 1 intentional skip; TypeScript and lint clean)
  • Commit hook reran formatting and pnpm test successfully
  • git diff --check

Risk

Low. The change only flips the existing lazy-mount flag in the two AI entry points; subsequent opens and normal Search behavior are unchanged.

Fixes #1116

Summary by CodeRabbit

  • Bug Fixes
    • Improved AI dock interactions by ensuring search is initialized before opening the dock or submitting a question.

@tannerlinsley tannerlinsley added the source-audit Tracked by the automated source audit label Aug 5, 2026
@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 807c4c91-9bf1-4d73-be38-44bac9e19bf1

📥 Commits

Reviewing files that changed from the base of the PR and between e95911b and 79186fb.

📒 Files selected for processing (1)
  • src/contexts/SearchContext.tsx

📝 Walkthrough

Walkthrough

The AI dock entry points now mark search as loaded before opening the dock or submitting a question.

Changes

AI dock search initialization

Layer / File(s) Summary
Initialize search before AI dock actions
src/contexts/SearchContext.tsx
openAiDock and askAiDock set hasLoadedSearch to true before continuing their existing operations.

Estimated code review effort: 1 (Trivial) | ~3 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes loading the AI dock on its first opening.
Linked Issues check ✅ Passed The change initializes the lazy bundle at both AI entry points, addressing the unresponsive Ask AI dock reported in [#1116].
Out of Scope Changes check ✅ Passed The changes are limited to lazy-loading behavior for the AI dock and match the linked issue objective.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch agent/load-ai-dock-on-first-open

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.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
tanstack-com 79186fb Commit Preview URL

Branch Preview URL
Aug 05 2026, 03:11 PM

@tannerlinsley
tannerlinsley merged commit 77a6ab5 into main Aug 5, 2026
7 checks passed
@tannerlinsley
tannerlinsley deleted the agent/load-ai-dock-on-first-open branch August 5, 2026 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

source-audit Tracked by the automated source audit

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ask AI button doesn't work when using uBlock Origin

1 participant