---
name: "Clickable code references in frontend"
---

# Story 193: Clickable code references in frontend

## User Story

As a developer using the Story Kit web UI, I want code references (e.g. `file_path:line_number`) to be rendered as clickable links that open the file in my local editor, so that I can quickly navigate to the relevant source code.

Instead of using editor-specific URI schemes (vscode://, zed://, etc.), use a backend API endpoint to open files. The frontend sends a request like `POST /api/open-file?path=src/foo.rs&line=42` and the server invokes the configured editor CLI (e.g. `zed src/foo.rs:42`). This leverages the existing editor preference already used by the `get_editor_command` MCP tool, so changing the editor in one place works everywhere.

## Acceptance Criteria

- [ ] Code references in the format `path/to/file.rs:123` are detected and rendered as clickable links in the frontend
- [ ] Clicking a code reference link opens the file at the correct line in the user's configured editor (via custom URI scheme e.g. vscode://, zed://)
- [ ] Editor preference is configurable (VS Code, Zed, Sublime, IntelliJ)
- [ ] Works for code references in bot responses displayed in the web UI

## Out of Scope

- TBD
