Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(chat): diplay special chars properly and blockquotes formatting #1090

Merged

Conversation

GoodluckH
Copy link
Collaborator

@GoodluckH GoodluckH commented Apr 4, 2025

Issue #, if available:
#1087

Handle Special Chars

Before:

Screenshot 2025-04-04 at 1 34 04 PM

After:
Screenshot 2025-04-04 at 1 33 44 PM

Pretty print blockquotes

Before:
Screenshot 2025-04-04 at 5 49 46 PM

After:
Screenshot 2025-04-04 at 5 51 22 PM

@GoodluckH GoodluckH requested a review from a team as a code owner April 4, 2025 20:36
@GoodluckH GoodluckH linked an issue Apr 4, 2025 that may be closed by this pull request
@codecov-commenter
Copy link

codecov-commenter commented Apr 4, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 13.69%. Comparing base (bb082c5) to head (25f2795).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1090   +/-   ##
=======================================
  Coverage   13.69%   13.69%           
=======================================
  Files        2361     2361           
  Lines      203703   203706    +3     
  Branches   184067   184070    +3     
=======================================
+ Hits        27890    27894    +4     
  Misses     174425   174425           
+ Partials     1388     1387    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@GoodluckH GoodluckH marked this pull request as draft April 4, 2025 20:37
@GoodluckH GoodluckH force-pushed the 1087-bugparent-unable-to-show-regex-in-plain-text-mode branch 4 times, most recently from 86d309f to a7c6147 Compare April 5, 2025 00:37
@GoodluckH GoodluckH marked this pull request as ready for review April 5, 2025 00:52
@GoodluckH GoodluckH requested review from mschrage and mr-lee April 5, 2025 00:52
@@ -138,9 +138,6 @@ pub fn interpret_markdown<'a, 'b>(
match state.in_codeblock {
false => {
stateful_alt!(
// This pattern acts as a short circuit for alphanumeric plaintext
Copy link
Contributor

Choose a reason for hiding this comment

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

You have a better idea of what this comment is referring to? Considering it's just being deleted and moved around

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Actually I just moved it back. I think someone else already pushed a fix for displaying square brackets. #971

@@ -743,7 +742,7 @@ mod tests {
validate!(bulleted_item_1, "- bullet", [style::Print("• bullet")]);
validate!(bulleted_item_2, "* bullet", [style::Print("• bullet")]);
validate!(numbered_item_1, "1. number", [style::Print("1. number")]);
validate!(blockquote_1, "&gt; hello", [
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this being updated because the model response never has &gt; and instead > directly? I guess if you haven't noticed anything break in your manual testing then it's probably fine

Copy link
Collaborator Author

@GoodluckH GoodluckH Apr 8, 2025

Choose a reason for hiding this comment

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

Yes, it appears that our model is responding back in MKD format. Even in rare case it sends back &gt;, it won't break anything, it'll just show ">" like what it's currently formatted for blockquotes.

Screenshot 2025-04-08 at 10 49 23 AM

Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like we have code that handles &gt; specifically, in which case I would prefer we don't remove this test case

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes there's a test case for it:

validate!(greater_than_1, ".&gt;.", [style::Print(".>.")]);

@GoodluckH GoodluckH force-pushed the 1087-bugparent-unable-to-show-regex-in-plain-text-mode branch 2 times, most recently from 68defad to 54e6fb3 Compare April 8, 2025 19:05
@GoodluckH GoodluckH force-pushed the 1087-bugparent-unable-to-show-regex-in-plain-text-mode branch from 54e6fb3 to 25f2795 Compare April 8, 2025 19:34
@GoodluckH GoodluckH merged commit e0f65f3 into main Apr 8, 2025
20 checks passed
@GoodluckH GoodluckH deleted the 1087-bugparent-unable-to-show-regex-in-plain-text-mode branch April 8, 2025 20:12
Konippi pushed a commit to Konippi/amazon-q-developer-cli that referenced this pull request Apr 10, 2025
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.

[bug][parent] Unable to show Regex in plain text mode
3 participants