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

fix NonEmptyFirstMessage storybook #6492

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Meta, StoryObj } from '@storybook/react'

import { PromptString, ps } from '@sourcegraph/cody-shared'
import { FIXTURE_MODEL, PromptString, ps } from '@sourcegraph/cody-shared'
import { ExtensionAPIProviderForTestsOnly, MOCK_API } from '@sourcegraph/prompt-editor'
import { Observable } from 'observable-fns'
import { URI } from 'vscode-uri'
Expand Down Expand Up @@ -63,7 +63,7 @@ export const WithInitialContext: StoryObj<typeof meta> = {
<ExtensionAPIProviderForTestsOnly
value={{
...MOCK_API,
chatModels: () => Observable.of([]),
chatModels: () => Observable.of([FIXTURE_MODEL]),
defaultContext: () =>
Observable.of({
initialContext: [
Expand Down Expand Up @@ -95,7 +95,7 @@ export const WithInitialContextFileTooLarge: StoryObj<typeof meta> = {
<ExtensionAPIProviderForTestsOnly
value={{
...MOCK_API,
chatModels: () => Observable.of([]),
chatModels: () => Observable.of([FIXTURE_MODEL]),
defaultContext: () =>
Observable.of({
initialContext: [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {
type ChatMessage,
FAST_CHAT_INPUT_TOKEN_BUDGET,
FIXTURE_MODEL,

Check failure on line 4 in vscode/webviews/chat/cells/messageCell/human/editor/HumanMessageEditor.tsx

View workflow job for this annotation

GitHub Actions / JetBrains tests

'FIXTURE_MODEL' is declared but its value is never read.

Check failure on line 4 in vscode/webviews/chat/cells/messageCell/human/editor/HumanMessageEditor.tsx

View workflow job for this annotation

GitHub Actions / build

This import is unused.

Check failure on line 4 in vscode/webviews/chat/cells/messageCell/human/editor/HumanMessageEditor.tsx

View workflow job for this annotation

GitHub Actions / test-unit (ubuntu, 20)

'FIXTURE_MODEL' is declared but its value is never read.

Check failure on line 4 in vscode/webviews/chat/cells/messageCell/human/editor/HumanMessageEditor.tsx

View workflow job for this annotation

GitHub Actions / test-unit (windows, 20)

'FIXTURE_MODEL' is declared but its value is never read.

Check failure on line 4 in vscode/webviews/chat/cells/messageCell/human/editor/HumanMessageEditor.tsx

View workflow job for this annotation

GitHub Actions / test-unit (ubuntu, 18)

'FIXTURE_MODEL' is declared but its value is never read.
FeatureFlag,
type Model,
ModelTag,
Expand Down Expand Up @@ -87,7 +88,6 @@
onChange,
onSubmit: parentOnSubmit,
onStop,
isFirstInteraction,
isLastInteraction,
isEditorInitiallyFocused,
className,
Expand Down Expand Up @@ -390,7 +390,7 @@
)
)

const currentChatModel = useMemo(() => models[0], [models[0]])
const currentChatModel = useMemo(() => (models ? models[0] : undefined), [models, models?.[0]])

const defaultContext = useDefaultContextForChat()
useEffect(() => {
Expand Down
Loading