Skip to content

Commit 5daa9ee

Browse files
committed
🤖 fix(site/src): address compaction review feedback
1 parent a9c924e commit 5daa9ee

4 files changed

Lines changed: 16 additions & 13 deletions

File tree

‎site/src/api/queries/chats.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2159,7 +2159,7 @@ export const updateUserChatPersonalModelOverride = (
21592159
},
21602160
});
21612161

2162-
const userCompactionThresholdsKey = [
2162+
export const userCompactionThresholdsKey = [
21632163
...chatConfigKey,
21642164
"compaction-thresholds",
21652165
"me",

‎site/src/pages/AgentsPage/AgentChatPage.stories.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import {
2020
organizationChatModelsKey,
2121
toChatListParams,
2222
userChatProviderConfigsKey,
23-
userCompactionThresholds,
23+
userCompactionThresholdsKey,
2424
} from "#/api/queries/chats";
2525
import { preferenceSettings } from "#/api/queries/users";
2626
import { workspaceByIdKey } from "#/api/queries/workspaces";
@@ -389,7 +389,7 @@ const buildQueries = (
389389
data: MockUserPreferenceSettings,
390390
},
391391
{
392-
key: userCompactionThresholds().queryKey,
392+
key: userCompactionThresholdsKey,
393393
data: MockUserChatCompactionThresholds,
394394
},
395395
];

‎site/src/pages/AgentsPage/AgentChatPageView.stories.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
} from "storybook/test";
1414
import { reactRouterParameters } from "storybook-addon-remix-react-router";
1515
import { API } from "#/api/api";
16-
import { userCompactionThresholds } from "#/api/queries/chats";
16+
import { userCompactionThresholdsKey } from "#/api/queries/chats";
1717
import { preferenceSettings } from "#/api/queries/users";
1818
import type * as TypesGen from "#/api/typesGenerated";
1919
import type { ChatDiffStatus, ChatMessagePart } from "#/api/typesGenerated";
@@ -237,7 +237,7 @@ const meta: Meta<typeof AgentChatPageView> = {
237237
data: MockUserPreferenceSettings,
238238
},
239239
{
240-
key: userCompactionThresholds().queryKey,
240+
key: userCompactionThresholdsKey,
241241
data: MockUserChatCompactionThresholds,
242242
},
243243
],

‎site/src/pages/AgentsPage/components/ChatPageContent.stories.tsx‎

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@ import { MessageScroller } from "@shadcn/react/message-scroller";
22
import type { Meta, StoryObj } from "@storybook/react-vite";
33
import type { FC } from "react";
44
import { expect, fn, userEvent, waitFor, within } from "storybook/test";
5-
import { chatPromptsKey, userCompactionThresholds } from "#/api/queries/chats";
5+
import {
6+
chatPromptsKey,
7+
userCompactionThresholdsKey,
8+
} from "#/api/queries/chats";
69
import { preferenceSettings } from "#/api/queries/users";
710
import type * as TypesGen from "#/api/typesGenerated";
811
import { MockChat, MockChatQueuedMessage } from "#/testHelpers/chatEntities";
@@ -43,7 +46,7 @@ const meta = {
4346
data: MockUserPreferenceSettings,
4447
},
4548
{
46-
key: userCompactionThresholds().queryKey,
49+
key: userCompactionThresholdsKey,
4750
data: MockUserChatCompactionThresholds,
4851
},
4952
],
@@ -55,7 +58,7 @@ type Story = StoryObj<typeof meta>;
5558

5659
const CHAT_ID = "chat-page-content-stories";
5760

58-
const MockUserChatCompactionThresholdsWithOverride: TypesGen.UserChatCompactionThresholds =
61+
const mockUserChatCompactionThresholdsWithOverride: TypesGen.UserChatCompactionThresholds =
5962
{
6063
...MockUserChatCompactionThresholds,
6164
thresholds: [
@@ -66,7 +69,7 @@ const MockUserChatCompactionThresholdsWithOverride: TypesGen.UserChatCompactionT
6669
],
6770
};
6871

69-
const compactionModels: readonly TypesGen.ChatModel[] = [
72+
const mockCompactionModels: readonly TypesGen.ChatModel[] = [
7073
{
7174
...MockChatModel,
7275
id: MockChat.last_model_config_id,
@@ -391,7 +394,7 @@ const CompactionChatPageInput: FC = () => {
391394
<ChatPageInput
392395
chat={MockChat}
393396
store={store}
394-
models={compactionModels}
397+
models={mockCompactionModels}
395398
onSend={fn()}
396399
onDeleteQueuedMessage={fn()}
397400
onPromoteQueuedMessage={fn()}
@@ -429,8 +432,8 @@ export const CompactsAtUserOverride: Story = {
429432
data: MockUserPreferenceSettings,
430433
},
431434
{
432-
key: userCompactionThresholds().queryKey,
433-
data: MockUserChatCompactionThresholdsWithOverride,
435+
key: userCompactionThresholdsKey,
436+
data: mockUserChatCompactionThresholdsWithOverride,
434437
},
435438
{
436439
key: chatPromptsKey(MockChat.id),
@@ -456,7 +459,7 @@ export const CompactsAtHistoricalModelDefault: Story = {
456459
data: MockUserPreferenceSettings,
457460
},
458461
{
459-
key: userCompactionThresholds().queryKey,
462+
key: userCompactionThresholdsKey,
460463
data: MockUserChatCompactionThresholds,
461464
},
462465
{

0 commit comments

Comments
 (0)