Skip to content

[DX-1371] Update search and Ask AI behavor#3396

Open
m-hulbert wants to merge 1 commit into
mainfrom
dx-1371-search
Open

[DX-1371] Update search and Ask AI behavor#3396
m-hulbert wants to merge 1 commit into
mainfrom
dx-1371-search

Conversation

@m-hulbert
Copy link
Copy Markdown
Contributor

Description

This PR updates the Search bar and Ask AI button to match styles between local and production. It also changes the rendering so that they're always visible in a local setup, however the triggers are disabled.

Checklist

Replace the production Inkeep-rendered search bar with our own design-matched
trigger so the header search bar is identical in local and production.

- Add a SearchTrigger button (200x36, grey fill, border, 'Search' placeholder,
  Cmd/K keycaps) rendered in both environments. It opens the existing Inkeep
  search modal on click (via the hidden #inkeep-search instance) and is inert
  locally; the modal itself is unchanged.
- Park the Inkeep search instance in a hidden holder (#inkeep-search-holder)
  instead of surfacing its own bar on desktop; mobile behaviour is unchanged.
- Always render the Ask AI button (drop the inkeepChatEnabled gate) so it shows
  locally too; it no-ops when the chat widget isn't loaded.
- Update Header tests for the always-rendered trigger and Ask AI button.

DX-1371

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@m-hulbert m-hulbert self-assigned this Jun 4, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 4, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 21b22ff1-3ee5-4da8-a402-10f945121854

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dx-1371-search

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.

@m-hulbert m-hulbert requested a review from jamiehenson June 4, 2026 17:15
@m-hulbert m-hulbert marked this pull request as ready for review June 4, 2026 17:15
@jamiehenson jamiehenson added the review-app Create a Heroku review app label Jun 4, 2026
Copy link
Copy Markdown
Member

@jamiehenson jamiehenson left a comment

Choose a reason for hiding this comment

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

Mostly a heads-up plus a couple of nits — not blocking.

The bit I want to be sure of: the visible Search button now opens the modal by clicking into #inkeep-search's shadow DOM while that instance sits in a display:none holder — and that reach-in has only ever been done against the chat widget before. If Inkeep's search trigger isn't a bare <button> (or is nested differently) it silently no-ops and the button does nothing, with no error, and the jsdom tests only check it renders.

So — are we confident this works in both environments? i.e. unconfigured Inkeep (local / flags off, button inert by design) and configured Inkeep (prod / flags on, button actually opens the modal). I've kicked off a review app to poke at it.

Two nits inline. Also tiny: title typo, "behavor" → "behaviour".

~ 𝒞𝓁𝒶𝓊𝒹𝑒

Comment on lines +273 to +281
onClick={() => {
const chatContainer = document.querySelector('#inkeep-ai-chat > div');
const chatButton = chatContainer?.shadowRoot?.querySelector('button');

track('docs_ask_ai_button_clicked');
track('docs_ask_ai_button_clicked');

if (chatButton) {
chatButton.click();
}
}}
>
<Icon name="icon-gui-sparkles-outline" size="20px" />
<span>Ask AI</span>
</button>
)}
if (chatButton) {
chatButton.click();
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This Ask AI onClick is now a near-twin of openInkeepSearch up top — query #X > div → shadow button → track → click. Worth pulling both into one openInkeepWidget(hostSelector, trackEvent) so the shadow-DOM reach-in lives in a single place.

~ 𝒞𝓁𝒶𝓊𝒹𝑒

Comment on lines +182 to +183
expect(screen.getByText('Search')).toBeInTheDocument();
expect(screen.getByText('Ask AI')).toBeInTheDocument();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

These only assert the buttons render, not that clicking them opens anything — so if the shadow-DOM open path breaks, the tests stay green. A click-wiring test (mock querySelector, assert the trigger fires) would catch that. The real shadow DOM isn't jsdom-friendly so it's partial at best, but the click path is the risky bit worth pinning down.

~ 𝒞𝓁𝒶𝓊𝒹𝑒

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review-app Create a Heroku review app

Development

Successfully merging this pull request may close these issues.

3 participants