Add Copy for LLM button to error details page#86
Add Copy for LLM button to error details page#86thieso2 wants to merge 3 commits intofractaledmind:mainfrom
Conversation
Adds a one-click button to copy error details formatted for LLM analysis. The button appears in the actions bar alongside Back/Resolve/Delete buttons with consistent styling. Features: - Copy button with standard copy icon in purple theme - Intelligently filtered backtrace (collapses GEM_ROOT frames) - Shows PROJECT_ROOT frames with one context frame above/below - Visual feedback when copied (green color + "Copied!" text) - Formats error data with context, occurrences, and analysis prompts - Generic "LLM" naming to work with any AI assistant The copied text includes: - Exception class, message, severity, source, and status - Occurrence statistics and timestamps - Most recent occurrence context and backtrace - Prompt questions for error analysis 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Previously, when users clicked "Copy for LLM", the copied text included HTML comments with BEGIN/END tags around the rendered partial content. This fix uses Rails' capture helper to render the partial content into a variable first, then strips whitespace before using it in the HTML attribute, eliminating the unwanted HTML comments. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
The previous fix using capture() wasn't sufficient to prevent Rails view annotation comments from appearing in development mode. This enhanced fix uses regex to explicitly strip all HTML comments (<!-- ... -->) from the captured content before embedding it in the data attribute, ensuring completely clean LLM text output. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
|
The PR #86 is failing because the codebase contains a reference to a bootstrap_svg helper method that doesn't exist. This In app/views/solid_errors/occurrences/_collection.html.erb on line 56, there's a call to: This helper method is expected to render a Bootstrap icon SVG, but:
The error only manifests when rendering a page with no occurrences (empty state), which explains why it might have gone This is a pre-existing bug in the upstream repository that has nothing to do with the changes in PR #86. The PR just happens |
Adds a one-click button to copy error details formatted for LLM analysis. The button appears in the actions bar alongside Back/Resolve/Delete buttons with consistent styling.
Features:
The copied text includes:
🤖 Generated with Claude Code