Skip to content

Conversation

@nerlichman
Copy link

What this does

  • Added chat UI messages partial for displaying content raw
  • Modified the chat UI messages partial to render the new partial when there's no content and there's a content raw present
  • Content raw hash is displayed collapsed with a preview of the keys.
  • Content raw expandend is styled with monospace font and gray background, similar to Tool Calls.
image image

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation
  • Performance improvement

Scope check

  • I read the Contributing Guide
  • This aligns with RubyLLM's focus on LLM communication
  • This isn't application-specific logic that belongs in user code
  • This benefits most users, not just my specific use case

Quality check

  • I ran overcommit --install and all hooks pass
  • I tested my changes thoroughly
    • For provider changes: Re-recorded VCR cassettes with bundle exec rake vcr:record[provider_name]
    • All tests pass: bundle exec rspec
  • I updated documentation if needed
  • I didn't modify auto-generated files manually (models.json, aliases.json)

API changes

  • Breaking change
  • New public methods/classes
  • Changed method signatures
  • No API changes

Related issues

Copilot AI review requested due to automatic review settings January 18, 2026 00:26
@nerlichman
Copy link
Author

Personally, I prefer the style of JSON.pretty_generate(content) (the screenshot attached on the PR description).

However, if a more ruby-like style is prefered, we could swap it for PP.pp(content, +""), which would look like:

image

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for displaying raw message content in the chat UI when structured content is present but no plain text content exists. The feature displays Hash-based raw content in a collapsible details element with a preview of keys and values.

Changes:

  • Added new _content_raw.html.erb partial template for rendering Hash-based raw content with collapsible preview
  • Modified _message.html.erb template to conditionally render raw content when no plain text content exists
  • Updated chat UI generator to create the new content_raw partial file

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
spec/ruby_llm/generators/chat_ui_generator_spec.rb Added test expectations to verify _content_raw.html.erb file is generated
lib/generators/ruby_llm/chat_ui/templates/views/messages/_message.html.erb.tt Added conditional logic to render content_raw when content is absent
lib/generators/ruby_llm/chat_ui/templates/views/messages/_content_raw.html.erb.tt New template for displaying raw content as collapsible JSON with preview
lib/generators/ruby_llm/chat_ui/chat_ui_generator.rb Added generator command to create _content_raw.html.erb template

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@nerlichman nerlichman force-pushed the chat_ui/show-raw-content-messages branch from fa90b1d to 5736a1f Compare January 18, 2026 00:39
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