🧠 feat: Prompt caching switch, prompt query params; refactor: static cache, prompt/markdown styling, trim copied code, switch new chat to convo URL (#3784)

* refactor: Update staticCache to use oneDayInSeconds for sMaxAge and maxAge

* refactor: role updates

* style: first pass cursor

* style: Update nested list styles in style.css

* feat: setIsSubmitting to true in message handler to prevent edge case where submitting turns false during message stream

* feat: Add logic to redirect to conversation page after creating a new conversation

* refactor: Trim code string before copying in CodeBlock component

* feat: configSchema bookmarks and presets defaults

* feat: Update loadDefaultInterface to handle undefined config

* refactor: use  for compression check

* feat: first pass, query params

* fix: styling issues for prompt cards

* feat: anthropic prompt caching UI switch

* chore: Update static file cache control defaults/comments in .env.example

* ci: fix tests

* ci: fix tests

* chore:  use "submitting" class server error connection suspense fallback
This commit is contained in:
Danny Avila 2024-08-26 15:34:46 -04:00 committed by GitHub
parent bd701c197e
commit 5694ad4e55
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
31 changed files with 519 additions and 112 deletions

View file

@ -61,7 +61,7 @@ export default function DashGroupItem({
};
const saveRename = () => {
updateGroup.mutate({ payload: { name: nameInputField }, id: group._id || '' });
updateGroup.mutate({ payload: { name: nameInputField }, id: group._id ?? '' });
};
const handleBlur = () => {
@ -77,13 +77,13 @@ export default function DashGroupItem({
}
};
const handleRename = (e: React.MouseEvent | React.KeyboardEvent) => {
const handleRename = (e: Event) => {
e.stopPropagation();
setNameEditFlag(true);
};
const handleDelete = () => {
deletePromptGroupMutation.mutate({ id: group._id || '' });
deletePromptGroupMutation.mutate({ id: group._id ?? '' });
};
return (
@ -156,7 +156,7 @@ export default function DashGroupItem({
</h3>
</div>
<div className="flex flex-row items-center gap-1">
{groupIsGlobal && (
{groupIsGlobal === true && (
<EarthIcon
className="icon-md text-green-400"
aria-label={localize('com_ui_global_group')}
@ -230,7 +230,7 @@ export default function DashGroupItem({
</div>
</div>
<div className="ellipsis text-balance text-sm text-gray-600 dark:text-gray-400">
{group.oneliner ? group.oneliner : group.productionPrompt?.prompt ?? ''}
{group.oneliner ?? '' ? group.oneliner : group.productionPrompt?.prompt ?? ''}
</div>
</>
)}

View file

@ -39,7 +39,7 @@ export default function List({
</div>
)}
<div className="flex-grow overflow-y-auto">
<div className="overflow-y-auto">
<div className="overflow-y-auto overflow-x-hidden">
{isLoading && isChatRoute && (
<Skeleton className="my-2 flex h-[84px] w-full rounded-2xl border-0 px-3 pb-4 pt-3" />
)}

View file

@ -28,7 +28,9 @@ export default function ListCard({
</div>
<div>{children}</div>
</div>
<div className="ellipsis select-none text-balance text-sm text-text-secondary">{snippet}</div>
<div className="ellipsis max-w-full select-none text-balance text-sm text-text-secondary">
{snippet}
</div>
</button>
);
}