Skip to content

Commit

Permalink
AI Chat storybook menu open responsiveness matches webui
Browse files Browse the repository at this point in the history
  • Loading branch information
petemill committed Dec 13, 2024
1 parent 2c5f29d commit 1e12113
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { getKeysForMojomEnum } from '$web-common/mojomUtils'
import { InferControlsFromArgs } from '../../../../../.storybook/utils'
import * as Mojom from '../../common/mojom'
import { ActiveChatContext, SelectedChatDetails } from '../state/active_chat_context'
import { AIChatContext, AIChatReactContext } from '../state/ai_chat_context'
import { AIChatContext, AIChatReactContext, useIsSmall } from '../state/ai_chat_context'
import { ConversationContext, ConversationReactContext } from '../state/conversation_context'
import FeedbackForm from '../components/feedback_form'
import FullPage from '../components/full_page'
Expand Down Expand Up @@ -474,6 +474,7 @@ const preview: Meta<CustomArgs> = {
decorators: [
(Story, options) => {
const [, setArgs] = useArgs()
const isSmall = useIsSmall()

const siteInfo = options.args.hasSiteInfo ? SITE_INFO : new Mojom.SiteInfo()
const suggestedQuestions = options.args.hasSuggestedQuestions
Expand All @@ -495,7 +496,8 @@ const preview: Meta<CustomArgs> = {
setArgs({ inputText })
}

const [showSidebar, setShowSidebar] = useState(false)
const [showSidebar, setShowSidebar] = useState(isSmall)

const aiChatContext: AIChatContext = {
conversationEntriesComponent: StorybookConversationEntries,
initialized: options.args.initialized,
Expand Down

0 comments on commit 1e12113

Please sign in to comment.