-
Notifications
You must be signed in to change notification settings - Fork 818
UI fixes & improvments #76
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
base: master
Are you sure you want to change the base?
Conversation
* fix: don't break words * fix: don't break words as much as possible, but when the width is not enough, will still break --------- Co-authored-by: josc146 <josStorer@outlook.com>
…e result window remains fixed (ChatGPTBox-dev#40)
thanks, i will make a test later |
no thank youuuu bro for accepting contributions from us . I will keep helping there is many stuff in my mind to improve the plugin since I use it every day now . |
I have conducted some tests and noticed that numerous styles and functions appear to be compromised. It might be beneficial for you to perform your own build tests to ensure everything is working as intended. There are subtle differences between the icons in @primer/octicons-react and react-bootstrap-icons. In my opinion, the download button in @primer/octicons-react seems to be more visually appealing. Please note that the icons in @primer/octicons-react do not support onClick. As a result, I utilized a span to achieve the desired functionality. It is essential not to remove this part, or the functionality will be lost. The gpt-util-icon style is solely for changing the cursor to indicate that the element is clickable. This style is being used in many places, and adding extra styles to it has inadvertently caused disruptions in the appearance of other buttons. |
I will try to build and check whats broken and fix it . |
da53d37
to
62a093f
Compare
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.
Pull Request Overview
This PR enhances UI behavior and text rendering, expands configuration to support more models (including a custom API), and updates build assets and dependencies.
- Extend configuration (
defaultConfig
, model keys, andgetUserConfig
) to cover GPT-4 variants and a custom API endpoint - Improve Markdown rendering by adding
remark-breaks
and settingdir="auto"
for proper line breaks and text direction - Refactor UI components (FloatingToolbar, ConversationItem, ConversationCard, InputBox) with new CSS classes, pin/drag support, mobile selection handling, and responsive sizing
- Add custom API streaming handler and adjust background scripts to route requests to the new endpoint
- Update build pipeline (optional tiktoken stripping) and bump several dependencies
Reviewed Changes
Copilot reviewed 45 out of 45 changed files in this pull request and generated 4 comments.
Show a summary per file
File | Description |
---|---|
src/config/index.mjs | Added new model variants and custom API keys, reorganized config fields, and version compatibility |
src/components/MarkdownRender/markdown.jsx | Wrapped renderer in <div dir="auto"> and included remark-breaks for line-break support |
src/components/FloatingToolbar/index.jsx | Added mobile selection listener, responsive width, drag/dock/pin logic, and CSS class updates |
src/components/ConversationCard/index.jsx | Integrated window-size hook, pin/close controls, port passing, and updated icon components |
build.mjs | Enhanced webpack to optionally strip tiktoken usage and expanded asset inline rules |
Comments suppressed due to low confidence (2)
src/background/apis/custom-api.mjs:1
- The new
generateAnswersWithCustomApi
module adds significant logic paths that lack automated tests; consider adding unit or integration tests to cover successful streams, errors, and abort scenarios.
// custom api version
src/components/ConversationItem/index.jsx:17
- You introduced
.gpt-header-icons
and.gpt-header-items
classes to replace inline flex and gap styling; ensure corresponding CSS rules (e.g.display: flex; gap: 15px;
) are present or add them to preserve the intended layout.
<div className="gpt-header-icons">
/>, | ||
toolbarContainer, | ||
) | ||
}} | ||
/> | ||
)} | ||
<span | ||
<Download |
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.
[nitpick] The Download icon is rendered without a size or margin styling, which may cause inconsistent spacing; consider adding size={16}
and a className or inline style to match other toolbar icons.
<Download | |
<Download | |
size={16} | |
className="gpt-util-icon" |
Copilot uses AI. Check for mistakes.
await new Promise((r) => setTimeout(r, 5000)) | ||
await runWebpack( | ||
true, | ||
true, | ||
generateWebpackCallback(() => finishOutput('-without-katex-and-tiktoken')), | ||
) | ||
await new Promise((r) => setTimeout(r, 5000)) |
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.
[nitpick] Relying on fixed timeouts to sequence multiple webpack runs can lead to nondeterministic build behavior; consider chaining the runs using webpack's compiler hooks or Promises rather than setTimeout
.
await new Promise((r) => setTimeout(r, 5000)) | |
await runWebpack( | |
true, | |
true, | |
generateWebpackCallback(() => finishOutput('-without-katex-and-tiktoken')), | |
) | |
await new Promise((r) => setTimeout(r, 5000)) | |
await runWebpack( | |
true, | |
true, | |
generateWebpackCallback(() => finishOutput('-without-katex-and-tiktoken')), | |
) |
Copilot uses AI. Check for mistakes.
for (const index in defaultConfig.selectionTools) { | ||
const key = defaultConfig.selectionTools[index] |
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.
[nitpick] Using for...in
over an array iterates numeric keys; consider for (const key of defaultConfig.selectionTools)
for clearer intent and to avoid inherited properties.
for (const index in defaultConfig.selectionTools) { | |
const key = defaultConfig.selectionTools[index] | |
for (const [index, key] of defaultConfig.selectionTools.entries()) { |
Copilot uses AI. Check for mistakes.
* @param {string} apiKey | ||
* @param {string} modelName | ||
*/ | ||
export async function generateAnswersWithCustomApi(port, question, session, apiKey, modelName) { |
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.
[nitpick] This function lacks JSDoc comments for its parameters and return behavior; adding documentation will help future maintainers understand the expected port
usage, streaming lifecycle, and error cases.
Copilot uses AI. Check for mistakes.
/review |
Qodo Merge was enabled for this repository. To continue using it, please link your Git account with your Qodo account here. PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
/improve |
Qodo Merge was enabled for this repository. To continue using it, please link your Git account with your Qodo account here. PR Code Suggestions ✨
|
No description provided.