diff --git a/engine-shared/elm/Shared/Data/BootstrapConfig.elm b/engine-shared/elm/Shared/Data/BootstrapConfig.elm index ad8f62fcb..5d413be35 100644 --- a/engine-shared/elm/Shared/Data/BootstrapConfig.elm +++ b/engine-shared/elm/Shared/Data/BootstrapConfig.elm @@ -6,6 +6,7 @@ module Shared.Data.BootstrapConfig exposing import Json.Decode as D exposing (Decoder) import Json.Decode.Pipeline as D +import Shared.Data.BootstrapConfig.AIAssistantConfig as AIAssistantConfig exposing (AIAssistantConfig) import Shared.Data.BootstrapConfig.Admin as AdminConfig exposing (Admin) import Shared.Data.BootstrapConfig.AppSwitcherItem as AppSwitcherItem exposing (AppSwitcherItem) import Shared.Data.BootstrapConfig.AuthenticationConfig as AuthenticationConfig exposing (AuthenticationConfig) @@ -25,6 +26,7 @@ import Shared.Data.UserInfo as UserInfo exposing (UserInfo) type alias BootstrapConfig = { admin : Admin + , aiAssistant : AIAssistantConfig , authentication : AuthenticationConfig , dashboardAndLoginScreen : DashboardAndLoginScreenConfig , registry : RegistryConfig @@ -45,6 +47,7 @@ type alias BootstrapConfig = default : BootstrapConfig default = { admin = AdminConfig.default + , aiAssistant = AIAssistantConfig.default , authentication = AuthenticationConfig.default , dashboardAndLoginScreen = DashboardAndLoginScreenConfig.default , registry = RegistryConfig.default @@ -66,6 +69,7 @@ decoder : Decoder BootstrapConfig decoder = D.succeed BootstrapConfig |> D.required "admin" AdminConfig.decoder + |> D.required "aiAssistant" AIAssistantConfig.decoder |> D.required "authentication" AuthenticationConfig.decoder |> D.required "dashboardAndLoginScreen" DashboardAndLoginScreenConfig.decoder |> D.required "registry" RegistryConfig.decoder diff --git a/engine-shared/elm/Shared/Data/BootstrapConfig/AIAssistantConfig.elm b/engine-shared/elm/Shared/Data/BootstrapConfig/AIAssistantConfig.elm new file mode 100644 index 000000000..e466d9d3d --- /dev/null +++ b/engine-shared/elm/Shared/Data/BootstrapConfig/AIAssistantConfig.elm @@ -0,0 +1,24 @@ +module Shared.Data.BootstrapConfig.AIAssistantConfig exposing + ( AIAssistantConfig + , decoder + , default + ) + +import Json.Decode as D exposing (Decoder) +import Json.Decode.Pipeline as D + + +type alias AIAssistantConfig = + { enabled : Bool + } + + +default : AIAssistantConfig +default = + { enabled = False } + + +decoder : Decoder AIAssistantConfig +decoder = + D.succeed AIAssistantConfig + |> D.required "enabled" D.bool diff --git a/engine-wizard/elm/Wizard/Common/Components/AIAssistant.elm b/engine-wizard/elm/Wizard/Common/Components/AIAssistant.elm index 4896b5606..9bfe0b65c 100644 --- a/engine-wizard/elm/Wizard/Common/Components/AIAssistant.elm +++ b/engine-wizard/elm/Wizard/Common/Components/AIAssistant.elm @@ -245,8 +245,9 @@ viewNewConversation cfg = in div [ class "flex-grow-1 px-3 py-3 overflow-auto" ] ([ h5 [] [ text "👋 Hello!" ] - , p [] [ text "I'm AI Assistant, here to help you navigate and make the most of FAIR Wizard." ] - , p [] [ text "Ask me anything about FAIR Wizard’s features, capabilities, or best practices, or choose a sample question below to start a conversation." ] + , p [] [ text "I'm the AI Assistant, here to help you understand and get the most out of FAIR Wizard." ] + , p [] [ text "I don’t have access to your data but can assist you using information from official guides and web resources." ] + , p [] [ text "Feel free to ask me anything about FAIR Wizard’s features, capabilities, or best practices, or choose a sample question below to get started." ] ] ++ List.map viewSampleMessage sampleMessages ) diff --git a/engine-wizard/elm/Wizard/Common/Menu/View.elm b/engine-wizard/elm/Wizard/Common/Menu/View.elm index 87b88525e..47a7c4872 100644 --- a/engine-wizard/elm/Wizard/Common/Menu/View.elm +++ b/engine-wizard/elm/Wizard/Common/Menu/View.elm @@ -227,7 +227,7 @@ view : Model -> Html Wizard.Msgs.Msg view model = let viewAiAssistant = - if Admin.isEnabled model.appState.config.admin then + if model.appState.config.aiAssistant.enabled then div [] [ a [ class "sidebar-ai-assistant" diff --git a/engine-wizard/elm/Wizard/Common/View/Layout.elm b/engine-wizard/elm/Wizard/Common/View/Layout.elm index 25c459829..b7d388d80 100644 --- a/engine-wizard/elm/Wizard/Common/View/Layout.elm +++ b/engine-wizard/elm/Wizard/Common/View/Layout.elm @@ -140,8 +140,11 @@ publicHeader fluidFull model = app : Model -> Html Msg -> Document Msg app model content = let + rightPanelVisible = + not model.appState.session.rightPanelCollapsed && model.appState.config.aiAssistant.enabled + rightPanel = - if not model.appState.session.rightPanelCollapsed then + if rightPanelVisible then div [ class "right-panel" ] [ div [ class "right-panel-content" ] [ AIAssistant.view @@ -162,7 +165,7 @@ app model content = , classList [ ( "side-navigation-collapsed", model.appState.session.sidebarCollapsed ) , ( "app-fullscreen", AppState.isFullscreen model.appState ) - , ( "app-right-panel", not model.appState.session.rightPanelCollapsed ) + , ( "app-right-panel", rightPanelVisible ) ] ] [ Menu.view model diff --git a/package-lock.json b/package-lock.json index 672f4636a..183b31c5b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "engine-frontend", - "version": "4.11.1", + "version": "4.11.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "engine-frontend", - "version": "4.11.1", + "version": "4.11.2", "license": "Apache-2.0", "dependencies": { "@codemirror/commands": "^6.6.2", diff --git a/package.json b/package.json index 335f6dced..70369a4db 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "engine-frontend", - "version": "4.11.1", + "version": "4.11.2", "repository": "https://github.com/ds-wizard/engine-frontend", "license": "Apache-2.0", "scripts": {