θΏ™ζ˜―indexlocζδΎ›ηš„ζœεŠ‘οΌŒδΈθ¦θΎ“ε…₯任何密码
Skip to content

Conversation

@MateKristof
Copy link
Contributor

@MateKristof MateKristof commented Aug 13, 2025

Pull Request Type

  • ✨ feat
  • πŸ› fix
  • ♻️ refactor
  • πŸ’„ style
  • πŸ”¨ chore
  • πŸ“ docs

Relevant Issues

resolves #4280

What is in this change?

This pull request introduces several new features and improvements to the chat embed history page, enhancing its usability and providing more powerful tools for reviewing chat logs.

  1. Markdown Rendering for Responses:

    • The "RESPONSE" column now correctly renders markdown content, providing a much-improved reading experience for formatted text.
    • A new MarkdownRenderer component has been created to handle the parsing and rendering of markdown, leveraging the existing markdown-it library.
  2. "Thinking" Step Visibility Toggle:

    • A "Show 'thinking'" toggle has been added to the UI, allowing users to show or hide the text within <think> tags in the model's response. This is useful for debugging and understanding the model's thought process without cluttering the main view.
  3. Enlarged Response Modal:

    • The modal window for viewing the full response text has been enlarged to provide a better reading experience for detailed responses.

Additional Information

Developer Validations

  • I ran yarn lint from the root of the repo & committed changes
  • Relevant documentation has been updated
  • I have tested my code functionality
  • Docker build succeeds locally

@timothycarambat timothycarambat added the PR:needs review Needs review by core team label Aug 14, 2025
Improved "Thinking" View
@MateKristof
Copy link
Contributor Author

This update includes several follow-up fixes and refinements to the recently introduced features in the Chat Embed History view, addressing issues that were discovered during testing.

Key Changes

  1. Robust Markdown Rendering:

    • Problem: The initial implementation of the markdown renderer had issues with line breaks, causing either too much vertical space or rendering raw <br> tags.
    • Solution: The MarkdownRenderer component was completely refactored. It now uses a much more robust method of parsing the content into "thinking" and "normal" parts, and then renders them as separate React components. This approach avoids all the previous issues with string manipulation and HTML escaping, ensuring that the markdown is rendered correctly and reliably.
  2. Improved "Thinking" View:

    • Problem: The initial styling for the "thinking" text was not being applied correctly to multi-line content.
    • Solution: With the new rendering approach, the "thinking" text is now correctly wrapped in a styled component, ensuring that the blue color is applied to the entire block of text, regardless of how many lines it contains. A line break is also consistently added to separate it from the main response.

These refinements have significantly improved the stability and reliability of the new features, providing a much smoother and more polished user experience.

Copy link
Collaborator

@shatfield4 shatfield4 left a comment

Choose a reason for hiding this comment

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

Functionality wise, this works great! I do like what you did here with getting the markdown to render properly in the chat embed settings page. We are going to want to stay away from how you implemented the sessions endpoint in the backend here. Although functionally it works great, this does add a lot of complexity to how this is talking back to the frontend.

I do like the idea you have here about using colors for each of the sessions but lets remove this since the way it is currently setup, if we have more sessions that the colors available then colors will be repeated and be confusing to users.

In order to get this merged, let's do the following:

  • Remove the sorting by sessions for now, we can do this later in another PR just due to the complexity this adds to the current feature

  • Let's also revert the backend changes you have here too for getting all unique sessions. What you can do in the future is append this to the /embed/chats endpoint in each call since they are limited to 20 items for pagination anyways and this will not query the entire DB for all unique sessions, just the 20 items it is returning

  • In the frontend, leave what you did here for getting markdown to render properly but let's remove the colored sessions

  • The show thinking checkbox is great but when choosing the color for showing thinking, let's not use a hardcoded value here but check out in our main frontend index.css and tailwind.config.js so that you can see how we make theme variable so that the colors work for both default and light themes

Great work so far, and always remember that simpler is better since this will help our codebase be maintainable and easily readable for future developers that work on this.

@MateKristof
Copy link
Contributor Author

Thanks for the great feedback. I've updated the PR based on your suggestions:

  • Backend changes have been reverted.
  • Session-based filtering and coloring have been removed.
  • The improved markdown rendering and "Show 'thinking'" toggle are still in place.
  • The color for the "thinking" text now uses a theme variable (--theme-button-cta) to support both light and dark modes.

These changes simplify the implementation while keeping the core features. Let me know what you think.

@shatfield4 shatfield4 removed the PR:needs review Needs review by core team label Sep 18, 2025
Copy link
Collaborator

@shatfield4 shatfield4 left a comment

Choose a reason for hiding this comment

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

Made some changes to the UI, LGTM

@shatfield4 shatfield4 added the PR:Ready-to-merge PR has been reviewed by core team and is ready to merge label Sep 18, 2025
@shatfield4
Copy link
Collaborator

UI now looks like this in the text modal:
Screenshot 2025-09-17 at 5 54 21β€―PM

Also modified the UI for showing thinking:
Screenshot 2025-09-17 at 5 54 55β€―PM

@timothycarambat timothycarambat added PR:needs review Needs review by core team and removed PR:Ready-to-merge PR has been reviewed by core team and is ready to merge labels Sep 18, 2025
@timothycarambat timothycarambat merged commit 01a3cc9 into Mintplex-Labs:master Sep 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR:needs review Needs review by core team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT]: Enhance Chat Embed History View with Markdown Rendering and Advanced Filtering

3 participants