Skip to content

Conversation

@aseemxs
Copy link
Contributor

@aseemxs aseemxs commented Dec 5, 2025

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Description

Problem:
External links in Amazon Q chat responses and footer (e.g., in /help command responses) were not opening when clicked in JetBrains IDEs.

Root Cause:
The existing link click handlers (CHAT_LINK_CLICK, CHAT_INFO_LINK_CLICK, CHAT_SOURCE_LINK_CLICK) were broken due to two issues:

  1. Incorrect JSON path: Handlers were delegating to LSP server methods which have empty/no-op implementations
  2. Wrong data extraction: Link URLs needed to be extracted from node.params.link on the client side
  3. Theme color bug: Link color was using link.foreground theme key which resolves to black in some themes

Fix:

  1. BrowserConnector.kt: Modified three link click handlers to:
    • Extract link URL directly from node.params.link
    • Open browser immediately using BrowserUtil.browse() instead of delegating to LSP server
    • Added support for legacy command names (response-body-link-click, footer-info-link-click, source-link-click)
  2. EditorThemeAdapter.kt: Fixed link color to use correct theme key (link instead of link.foreground) so links display in proper blue color
    across all themes
Screen.Recording.2025-12-11.at.1.14.26.PM.mov

Impact:

  • Links in chat responses now open correctly in the system browser
  • Link color now properly respects IntelliJ theme settings (displays as blue instead of black)
  • Cleaner solution using existing code paths rather than adding new infrastructure

Checklist

  • My code follows the code style of this project
  • I have added tests to cover my changes
  • A short description of the change has been added to the
    CHANGELOG if the change is customer-facing
    in the IDE.
  • I have added metrics for my changes (if required)

License

I confirm that my contribution is made under the terms of the Apache 2.0 license.

Links in chat responses were not opening because:
1. Link URL was being read from wrong JSON path (node.link instead of node.params.link)
2. Was delegating to LSP server which has empty handlers

Now opens browser directly on client side with correct URL extraction.
link.foreground returns black in some themes, use 'link' key instead which has the correct blue color
@aseemxs aseemxs marked this pull request as ready for review December 11, 2025 22:24
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.

1 participant