Skip to content

Commit a7284f1

Browse files
committed
fix: Enhance component styles and configurations
- Updated `markdown.tsx` to include `break-words` class for list items to improve text wrapping. - Modified `mention-input.tsx` to configure `StarterKit` by disabling code block, blockquote, and code features. - Adjusted `message-parts.tsx` to add `max-w-full` class for better layout and `break-words` for text wrapping in user messages. - Updated keyboard shortcut in `keyboard-shortcuts.ts` to include `shift` key for toggling voice chat.
1 parent 176ff5d commit a7284f1

4 files changed

Lines changed: 9 additions & 7 deletions

File tree

src/components/markdown.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ const components: Partial<Components> = {
6060
},
6161
li: ({ node, children, ...props }) => {
6262
return (
63-
<li className="py-2" {...props}>
63+
<li className="py-2 break-words" {...props}>
6464
<WordByWordFadeIn>{children}</WordByWordFadeIn>
6565
</li>
6666
);

src/components/mention-input.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,11 @@ export default function MentionInput({
104104
() => ({
105105
immediatelyRender: false,
106106
extensions: [
107-
StarterKit,
107+
StarterKit.configure({
108+
codeBlock: false,
109+
blockquote: false,
110+
code: false,
111+
}),
108112
Mention.configure({
109113
HTMLAttributes: {
110114
class: "mention",

src/components/message-parts.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -176,12 +176,9 @@ export const UserMessagePart = ({
176176
return (
177177
<div className="flex flex-col gap-2 items-end my-2">
178178
<div
179-
onClick={() => {
180-
ref.current?.scrollIntoView({ behavior: "smooth" });
181-
}}
182179
data-testid="message-content"
183180
className={cn(
184-
"flex flex-col gap-4",
181+
"flex flex-col gap-4 max-w-full",
185182
{
186183
"bg-accent text-accent-foreground px-4 py-3 rounded-2xl":
187184
isLast || part.text.length <= PROMPT_PASTE_MAX_LENGTH,
@@ -191,7 +188,7 @@ export const UserMessagePart = ({
191188
)}
192189
>
193190
{isLast || part.text.length <= PROMPT_PASTE_MAX_LENGTH ? (
194-
<p className={cn("whitespace-pre-wrap text-sm")}>
191+
<p className={cn("whitespace-pre-wrap text-sm break-words")}>
195192
<HighlightedText text={part.text} mentions={toolMentions} />
196193
</p>
197194
) : (

src/lib/keyboard-shortcuts.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ const toggleVoiceChatShortcut: Shortcut = {
3232
shortcut: {
3333
key: "I",
3434
command: true,
35+
shift: true,
3536
},
3637
};
3738

0 commit comments

Comments
 (0)