Unlimited height on the share page (#160)

This commit is contained in:
Matt Rubens 2025-06-30 15:46:29 -04:00 committed by GitHub
parent fb3df3a976
commit 362d9b2b2c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 10 additions and 3 deletions

View file

@ -8,6 +8,7 @@ import { useAutoScroll } from '@/hooks/useAutoScroll';
type MessagesProps = {
messages: Message[];
maxHeight?: string;
};
type SuggestionItem = string | { answer: string };
@ -34,7 +35,7 @@ const parseQuestionData = (text: string): QuestionData | null => {
return null;
};
export const Messages = ({ messages }: MessagesProps) => {
export const Messages = ({ messages, maxHeight }: MessagesProps) => {
const { containerRef, scrollToBottom, autoScrollToBottom, userHasScrolled } =
useAutoScroll<HTMLDivElement>({
enabled: true,
@ -73,7 +74,7 @@ export const Messages = ({ messages }: MessagesProps) => {
{/* Scrollable messages container */}
<div
ref={containerRef}
className="max-h-[600px] overflow-y-auto space-y-6 pr-2"
className={`space-y-6 pr-2 overflow-y-auto ${maxHeight || ''}`}
style={{
scrollbarWidth: 'thin',
scrollbarColor: 'hsl(var(--border)) transparent',

View file

@ -51,6 +51,7 @@ export const SharedTaskView = ({
sharedBy={sharedBy}
sharedAt={sharedAt}
showSharedInfo={true}
limitMessagesHeight={false}
/>
);
};

View file

@ -22,6 +22,7 @@ type TaskDetailsProps = {
sharedAt?: Date;
showSharedInfo?: boolean;
headerActions?: React.ReactNode;
limitMessagesHeight?: boolean;
};
export const TaskDetails = ({
@ -31,6 +32,7 @@ export const TaskDetails = ({
sharedAt,
showSharedInfo = false,
headerActions,
limitMessagesHeight = true,
}: TaskDetailsProps) => {
const taskTitle = task.title || generateFallbackTitle(task);
@ -152,7 +154,10 @@ export const TaskDetails = ({
<CardTitle>Conversation</CardTitle>
</CardHeader>
<CardContent>
<Messages messages={messages} />
<Messages
messages={messages}
maxHeight={limitMessagesHeight ? 'max-h-[600px]' : undefined}
/>
</CardContent>
</Card>
) : (