Skip to content
New issue

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

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

Already on GitHub? # to your account

Markdown support #2476

Merged
merged 4 commits into from
Jun 27, 2024
Merged

Markdown support #2476

merged 4 commits into from
Jun 27, 2024

Conversation

manyoso
Copy link
Collaborator

@manyoso manyoso commented Jun 27, 2024

🚀 This description was created by Ellipsis for commit cb8a4c4

Summary:

Added markdown support in ResponseText, adjusted UI element widths, and modified divider heights and colors in various QML files.

Key points:

  • Added: replaceAndInsertMarkdown function in gpt4all-chat/responsetext.cpp to handle markdown insertion.
  • Modified: ResponseText::handleCodeBlocks in gpt4all-chat/responsetext.cpp to process non-code blocks as markdown.
  • Adjusted: Width of listView.contentItem in gpt4all-chat/qml/ChatView.qml by subtracting 15 units.
  • Reduced: Divider heights in multiple QML files (gpt4all-chat/qml/ApplicationSettings.qml, gpt4all-chat/qml/ChatDrawer.qml, gpt4all-chat/qml/ChatView.qml, gpt4all-chat/qml/CollectionsDrawer.qml, gpt4all-chat/qml/LocalDocsSettings.qml, gpt4all-chat/qml/ModelSettings.qml, gpt4all-chat/qml/MySettingsStack.qml) from 2 to 1 unit.
  • Unified: conversationDivider color in gpt4all-chat/qml/Theme.qml to use dividerColor.

Generated with ❤️ by ellipsis.dev

Signed-off-by: Adam Treat <treat.adam@gmail.com>
Signed-off-by: Adam Treat <treat.adam@gmail.com>
Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

❌ Changes requested. Reviewed everything up to 320e184 in 1 minute and 6 seconds

More details
  • Looked at 75 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 0 drafted comments based on config settings.

Workflow ID: wflow_OgMDOApf7GpFkB33


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

7 days left in your free trial, upgrade for $20/seat/month or contact us.

@@ -925,6 +926,17 @@ void ResponseText::handleTextChanged()
m_isProcessingText = false;
}

void replaceAndInsertMarkdown(int startIndex, int endIndex, QTextDocument *doc)
Copy link

Choose a reason for hiding this comment

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

The replaceAndInsertMarkdown function does not handle the case where endIndex is greater than the document's character count, which can lead to an out-of-range error. Consider adding a check to ensure endIndex does not exceed the document's character count before setting the cursor position.

int nonCodeStart = lastIndex;
int nonCodeEnd = matchesCode[index].capturedStart();
if (nonCodeEnd > nonCodeStart)
replaceAndInsertMarkdown(nonCodeStart, nonCodeEnd, doc);
Copy link

Choose a reason for hiding this comment

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

The replaceAndInsertMarkdown function is called with nonCodeEnd as the second argument, which might not include the last character of the non-code segment due to how capturedStart() is defined. It might be necessary to adjust this by adding 1 to nonCodeEnd to include the last character of the segment.

}

if (lastIndex < doc->characterCount())
replaceAndInsertMarkdown(lastIndex, doc->characterCount() - 1, doc);
Copy link

Choose a reason for hiding this comment

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

The replaceAndInsertMarkdown function is called with doc->characterCount() - 1 as the second argument, which might exclude the last character of the document. Consider using doc->characterCount() instead to include the entire document content.

Signed-off-by: Adam Treat <treat.adam@gmail.com>
Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Incremental review on 3799816 in 39 seconds

More details
  • Looked at 13 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. gpt4all-chat/qml/ChatView.qml:1004
  • Draft comment:
    The PR description mentions an adjustment to the width of listView.contentItem by subtracting 15 units, but the diff provided does not show this change. Instead, it shows a change in the text of a TextArea element. Please ensure that the intended changes are correctly committed and reflected in the PR.
  • Reason this comment was not posted:
    Confidence of 0% on close inspection, compared to threshold of 50%.

Workflow ID: wflow_sEMqASRzdEyeFGPq


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

7 days left in your free trial, upgrade for $20/seat/month or contact us.

Signed-off-by: Adam Treat <treat.adam@gmail.com>
Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Incremental review on cb8a4c4 in 1 minute and 0 seconds

More details
  • Looked at 201 lines of code in 8 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. gpt4all-chat/qml/Theme.qml:197
  • Draft comment:
    The conversationDivider property is directly returning dividerColor without considering the theme settings, which might not be consistent with the intended theme-specific customization. Consider using a switch case based on MySettings.chatTheme to return different colors for different themes, similar to other properties in this file.
  • Reason this comment was not posted:
    Confidence of 30% on close inspection, compared to threshold of 50%.

Workflow ID: wflow_wNZF5IgvGlVhm2Zd


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

7 days left in your free trial, upgrade for $20/seat/month or contact us.

@manyoso manyoso merged commit a1ec6f2 into main Jun 27, 2024
8 of 13 checks passed
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant