-
-
Notifications
You must be signed in to change notification settings - Fork 6
Ensure text wrapping for long sentences across UI components #473
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
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 | ||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -292,11 +292,11 @@ export const ChatPanel = forwardRef<ChatPanelRef, ChatPanelProps>(({ messages, i | |||||||||||||||||||||||||||||||||||
| </form> | ||||||||||||||||||||||||||||||||||||
| {selectedFile && ( | ||||||||||||||||||||||||||||||||||||
| <div className="w-full px-4 pb-2 mb-2"> | ||||||||||||||||||||||||||||||||||||
| <div className="flex items-center justify-between p-2 bg-muted rounded-lg"> | ||||||||||||||||||||||||||||||||||||
| <span className="text-sm text-muted-foreground truncate max-w-xs"> | ||||||||||||||||||||||||||||||||||||
| <div className="flex items-start justify-between p-2 bg-muted rounded-lg"> | ||||||||||||||||||||||||||||||||||||
| <span className="text-sm text-muted-foreground break-all mr-2"> | ||||||||||||||||||||||||||||||||||||
| {selectedFile.name} | ||||||||||||||||||||||||||||||||||||
| </span> | ||||||||||||||||||||||||||||||||||||
| <Button variant="ghost" size="icon" onClick={clearAttachment} data-testid="clear-attachment-button"> | ||||||||||||||||||||||||||||||||||||
| <Button variant="ghost" size="icon" className="shrink-0" onClick={clearAttachment} data-testid="clear-attachment-button"> | ||||||||||||||||||||||||||||||||||||
| <X size={16} /> | ||||||||||||||||||||||||||||||||||||
| </Button> | ||||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||||
|
Comment on lines
+295
to
302
Contributor
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. 🧹 Nitpick | 🔵 Trivial Consider The That said, since filenames often lack natural word boundaries (e.g., 💡 Alternative using break-words- <span className="text-sm text-muted-foreground break-all mr-2">
+ <span className="text-sm text-muted-foreground break-words mr-2">📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -41,14 +41,14 @@ export function EmptyScreen({ | |
| <Button | ||
| key={item.message} // Use a unique property as the key. | ||
| variant="link" | ||
| className="h-auto p-0 text-base flex items-center" | ||
| className="h-auto p-0 text-base flex items-start whitespace-normal text-left" | ||
| name={item.message} | ||
| onClick={async () => { | ||
| submitMessage(item.message); | ||
| }} | ||
| > | ||
| <Icon size={16} className="mr-2 text-muted-foreground" /> | ||
| {item.heading} | ||
| <Icon size={16} className="mr-2 mt-1 text-muted-foreground shrink-0" /> | ||
| <span className="flex-1">{item.heading}</span> | ||
| </Button> | ||
|
Comment on lines
41
to
52
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. The key for these items is This is not introduced by your wrapping changes, but it’s in the modified block and is easy to harden while here. SuggestionIf key={`${item.message}-${item.heading}`}(Or add an |
||
| ); | ||
| })} | ||
|
|
||
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.
break-allwill split filenames at arbitrary characters, which can noticeably hurt readability (e.g., splitting extensions or UUIDs mid-token). For filenames,break-words(oroverflow-wrap:anywherevia Tailwindbreak-words) is usually the better default, optionally combined withmin-w-0on the text container to allow flex shrinking.Given the intent is to avoid horizontal overflow, consider switching to
break-words(orbreak-allonly when needed, e.g., for extremely long unbroken strings).Suggestion
Consider swapping
break-allforbreak-wordsand ensuring the flex child can shrink:Reply with "@CharlieHelps yes please" if you'd like me to add a commit with this change.