Skip to content
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

Final chat fixes #479

Merged
merged 5 commits into from
Nov 11, 2024
Merged

Final chat fixes #479

merged 5 commits into from
Nov 11, 2024

Conversation

samlhuillier
Copy link
Collaborator

No description provided.

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

This PR streamlines the chat interface by simplifying agent configurations, fixing UI layout issues, and improving component organization.

  • Simplified default agent prompt template in src/components/Chat/ChatConfigComponents/exampleAgents.ts by removing tool references and streamlining query format
  • Added dynamic font sizing in src/components/Chat/MessageComponents/UserMessage.tsx based on message length (text-lg/xl/2xl)
  • Added new chat button to window controls via onNewChat prop in src/components/ui/window-controls.tsx
  • Fixed z-index and positioning issues for hover cards in src/components/Chat/MessageComponents/ChatSources.tsx
  • Removed automatic chatbot visibility control from ContentContext, moving it to a more appropriate location

10 file(s) reviewed, 8 comment(s)
Edit PR Review Bot Settings | Greptile

@@ -64,8 +64,8 @@ const ChatSources: React.FC<ChatSourcesProps> = ({ contextItems }) => {
</CardDescription>
</Card>
</HoverCardTrigger>
<HoverCardContent className="max-h-[60vh] w-80 overflow-y-auto">
<div className="p-2">
<HoverCardContent className="z-[100] max-h-[60vh] w-80 overflow-y-auto" sideOffset={5}>
Copy link

Choose a reason for hiding this comment

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

style: z-[100] may not be high enough if other overlays or modals have higher z-indices. Consider using a z-index management system.

<HoverCardContent className="max-h-[60vh] w-80 overflow-y-auto">
<div className="p-2">
<HoverCardContent className="z-[100] max-h-[60vh] w-80 overflow-y-auto" sideOffset={5}>
<div className="">
Copy link

Choose a reason for hiding this comment

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

style: removing padding without replacement may cause content to touch edges of container

Comment on lines +17 to +19
if (messageLength > 100) return 'text-lg'
if (messageLength > 50) return 'text-xl'
return 'text-2xl'
Copy link

Choose a reason for hiding this comment

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

style: Abrupt font size transitions at 50/100 chars may cause visual jarring. Consider adding more gradual breakpoints or using a scaling formula

Comment on lines +25 to +28
<ReactMarkdown
rehypePlugins={[rehypeRaw]}
className={`max-w-[95%] break-words font-bold text-neutral-400 ${getFontSizeClass()}`}
>
Copy link

Choose a reason for hiding this comment

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

logic: ReactMarkdown with rehypeRaw enabled on user messages could pose XSS risks if message content is not properly sanitized

Comment on lines 85 to 86
{showChatbot && (
<ResizablePanel defaultSize={currentlyOpenFilePath && showEditor ? 35 : 100}>
Copy link

Choose a reason for hiding this comment

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

style: Consider adding a loading state while openNewChat is being executed to prevent multiple rapid clicks

@@ -85,7 +85,11 @@ const MainPageContent: React.FC = () => {
{showChatbot && (
<ResizablePanel defaultSize={currentlyOpenFilePath && showEditor ? 35 : 100}>
Copy link

Choose a reason for hiding this comment

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

logic: defaultSize calculation could cause layout jump if currentlyOpenFilePath or showEditor change after initial render

Comment on lines +14 to +23
{onNewChat && (
<button
type="button"
onClick={onNewChat}
className="cursor-pointer bg-transparent p-1.5 transition-colors"
title="New Chat"
>
<Plus className="size-3 text-neutral-400 hover:text-neutral-300" />
</button>
)}
Copy link

Choose a reason for hiding this comment

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

logic: The new button should have an aria-label attribute for screen reader accessibility, similar to the other window control buttons

Comment on lines 46 to 48
if (chatMetadata) {
setShowChatbot(true)
openNewChat(pathOrChatID)
} else {
Copy link

Choose a reason for hiding this comment

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

logic: Removing automatic chatbot visibility toggle here changes UX - ensure chat visibility is handled appropriately in ChatContext or the component level

@samlhuillier samlhuillier merged commit 0aa8f85 into main Nov 11, 2024
6 of 10 checks passed
@samlhuillier samlhuillier deleted the final-chat-fixes branch November 11, 2024 22:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant