-
Notifications
You must be signed in to change notification settings - Fork 28
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 #504 : honor the indentation in the MetadataFilter formatting #510
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -205,11 +205,17 @@ def on_click_chat_info_wrapper(self, event): | |
# `MetadataFilter`s provided as dict | ||
title = "Metadata Filters" | ||
|
||
metadata_filters_readable = str( | ||
MetadataFilter.from_primitive(self.current_chat["metadata"]["input"]) | ||
).replace("\n", "<br>") | ||
metadata_filters_readable = ( | ||
str( | ||
MetadataFilter.from_primitive( | ||
self.current_chat["metadata"]["input"] | ||
) | ||
) | ||
.replace("\n", "<br>") | ||
.replace(" ", " ") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you explain that? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Try removing these lines to see how it behaves. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So do we even need the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
) | ||
|
||
details = f"<div class='details details_block' style='display:block;'>{metadata_filters_readable}</div><br />\n\n" | ||
details = f"<div class='details details_block' style='display:block;'><pre>{metadata_filters_readable}</pre></div><br />\n\n" | ||
grid_height = 1 | ||
|
||
elif self.current_chat["metadata"]["input"] is None: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we able to remove this given that
<pre>
should honor line breaks?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's indeed the first thing I have tried, but no.
<pre>
does not natively honor line breaks. It can be done with CSS but then the line breaks at the first opportunity, and it doesn't result in a hierarchical result anymore.