Skip to content

Conversation

@brendan-kellam
Copy link
Contributor

@brendan-kellam brendan-kellam commented Feb 3, 2026

Summary

  • Changes convertLLMOutputToPortableMarkdown to embed full browse URLs instead of relative file paths
  • File references in copied chat answers and API responses now link directly to the browse page with line highlighting
  • Users can click links without needing an IDE open

Test plan

  • Start the dev server with yarn dev
  • Use the chat feature to ask a question that returns file references
  • Copy the answer to clipboard and verify links are full URLs (e.g., https://app.sourcebot.dev/~/browse/...)
  • Test the MCP/API endpoint (/api/chat/blocking) and verify response contains full URLs
  • Click the generated links to verify they navigate correctly with line highlighting

🤖 Generated with Claude Code

Fixes #576

Summary by CodeRabbit

Release Notes

  • Bug Fixes
    • Fixed file reference handling in copied chat answers. File references are now displayed as complete browse URLs rather than relative paths, ensuring links remain functional when answers are shared or referenced in different contexts.

brendan-kellam and others added 2 commits February 3, 2026 11:22
…kdown

Change convertLLMOutputToPortableMarkdown to embed full browse URLs instead
of relative file paths, so users can click links without needing an IDE open.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 3, 2026

Walkthrough

This PR updates file reference handling in chat answers to generate full browse URLs instead of relative paths by introducing a baseUrl parameter to the convertLLMOutputToPortableMarkdown function, coordinated across the API route, client component, and utility function.

Changes

Cohort / File(s) Summary
Documentation
CHANGELOG.md
Documents the change that file references in copied chat answers are now full browse URLs instead of relative paths.
Chat Utility Function
packages/web/src/features/chat/utils.ts
Updated convertLLMOutputToPortableMarkdown to accept baseUrl parameter and construct full browse URLs using repo, highlight ranges, and getBrowsePath. Added imports for getBrowsePath, BrowseHighlightRange, and SINGLE_TENANT_ORG_DOMAIN.
API Route & Client Component
packages/web/src/app/api/(server)/chat/blocking/route.ts, packages/web/src/features/chat/components/chatThread/answerCard.tsx
Updated calls to convertLLMOutputToPortableMarkdown to pass baseUrl as a second argument—sourced from env.AUTH_URL on the server and from window base URL on the client.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • PR #393: Modifies chat file-reference handling and the convertLLMOutputToPortableMarkdown callback to work with repo and path data.
  • PR #844: Updates the chat route to construct baseUrl using env.AUTH_URL, which this PR builds upon by passing the new baseUrl into URL generation.

Suggested reviewers

  • msukkari
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title directly describes the main change: converting file references to full browse URLs in portable markdown, which is the primary objective across all modified files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 bkellam/fix-SOU-353

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.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@claude
Copy link

claude bot commented Feb 3, 2026

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@brendan-kellam brendan-kellam merged commit 9c56827 into main Feb 3, 2026
10 checks passed
@brendan-kellam brendan-kellam deleted the bkellam/fix-SOU-353 branch February 3, 2026 19:32
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.

[FR] Resolve links embedded in Ask responses to URLs rather than relative paths

2 participants