Add UI hints to redirect user to code search when code search syntax is used

Summary

When users enter code search literals (such as blob:, filename:, path:, extension:) in their search queries but are not in the code search scope, we should provide clear UI hints to guide them to the appropriate search scope.

Background

Following the changes in !212243 (merged), automatic redirection to the blobs (code) scope was removed to respect the configured default search scope setting. However, this may cause confusion when users include code search literals expecting to search code, but their results come from a different scope.

Proposal

Add visual indicators in the search UI that:

  1. Detect code search syntax: Identify when users include code search literals (blob:, filename:, path:, extension:) in their query
  2. Show contextual hints: Display a non-intrusive message or banner when code literals are detected but the current scope is not "Code"
  3. Provide quick action: Include a clear call-to-action (e.g., button or link) to switch to the code search scope with the same query

Example UI Patterns

Consider one or more of these approaches:

  • Info banner: "Your query contains code search syntax. [Switch to Code search →]"
  • Inline suggestion: Small hint near the search scope selector
  • Scope indicator: Visual highlight on the "Code" scope option when code literals are detected
  • Toast notification: Brief, dismissible message after search execution

Acceptance Criteria

  • Code search literals are detected in search queries
  • UI hint is displayed when code literals are present but scope is not "Code"
  • User can easily switch to code search scope with one click
  • Hint is non-intrusive and doesn't block the search workflow
  • Hint is accessible and follows GitLab UI/UX patterns
  • Works across all search contexts (global, project, group)

Technical Considerations

  • Ensure detection logic handles all code search literals
  • Consider performance impact of syntax detection
  • Follow existing search UI component patterns
  • Ensure proper i18n support for hint messages
  • Consider user preferences (e.g., "don't show again" option)