From 17ec2a19b2d2dc5ba3f99c43d86c27946de2ac71 Mon Sep 17 00:00:00 2001 From: Joanne Date: Sun, 22 Jun 2025 23:12:46 -0400 Subject: successfully merged documentationtext functionality with new version of agent, however still minor issues with the agent not selecting the proper tool for documentation generation without the additional context from the topbar --- src/client/views/topbar/TopBar.tsx | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'src/client/views/topbar') diff --git a/src/client/views/topbar/TopBar.tsx b/src/client/views/topbar/TopBar.tsx index 5d8583873..9b24219cf 100644 --- a/src/client/views/topbar/TopBar.tsx +++ b/src/client/views/topbar/TopBar.tsx @@ -3,10 +3,9 @@ import { Button, Dropdown, DropdownType, IconButton, isDark, Size, Type } from ' import { action, computed, makeObservable, observable, reaction } from 'mobx'; import { observer } from 'mobx-react'; import * as React from 'react'; -import { Flip } from 'react-awesome-reveal'; import { FaBug } from 'react-icons/fa'; -import { returnEmptyFilter, returnFalse, returnTrue } from '../../../ClientUtils'; -import { Doc, DocListCast, Opt, returnEmptyDoclist } from '../../../fields/Doc'; +import { ClientUtils, returnEmptyFilter, returnFalse, returnTrue } from '../../../ClientUtils'; +import { Doc, DocListCast, returnEmptyDoclist } from '../../../fields/Doc'; import { AclAdmin, DashVersion } from '../../../fields/DocSymbols'; import { StrCast } from '../../../fields/Types'; import { GetEffectiveAcl } from '../../../fields/util'; @@ -28,10 +27,6 @@ import { ObservableReactComponent } from '../ObservableReactComponent'; import { DefaultStyleProvider, returnEmptyDocViewList } from '../StyleProvider'; import './TopBar.scss'; import { OpenWhere } from '../nodes/OpenWhere'; -import { ChatBox } from '../nodes/chatbot/chatboxcomponents/ChatBox'; -import { FieldViewProps } from '../nodes/FieldView'; -import { FocusViewOptions } from '../nodes/FocusViewOptions'; -import { PinProps } from '../PinFuncs'; import { Docs } from '../../documents/Documents'; /** @@ -90,7 +85,7 @@ export class TopBar extends ObservableReactComponent { {Doc.ActiveDashboard ? ( !DocListCast(Doc.MySharedDocs.viewed).includes(dash)) ? 'portrait' : 'home'} />} + icon={ !DocListCast(Doc.MySharedDocs?.viewed)?.includes(dash)) ? 'portrait' : 'home'} />} color={this.color} background={this.backgroundColor} /> @@ -231,9 +226,11 @@ export class TopBar extends ObservableReactComponent { val: 'tutorialagent', text: 'Ask AI!', onClick: () => { + const userEmail = ClientUtils.CurrentUserEmail(); + const userName = userEmail.split('@')[0]; const doc = Docs.Create.ChatDocument({ chat: 'Welcome to your help assistant for Dash. Ask any Dash-related questions to get started.', - title: 'Dash Documentation Assistant', + title: `${userName}'s Dash Help Assistant`, is_dash_doc_assistant: 'true', }); DocumentViewInternal.addDocTabFunc(doc, OpenWhere.addRight); -- cgit v1.2.3-70-g09d2