diff options
| author | Joanne <zehan_ding@brown.edu> | 2025-06-22 23:12:46 -0400 |
|---|---|---|
| committer | Joanne <zehan_ding@brown.edu> | 2025-06-22 23:12:46 -0400 |
| commit | 17ec2a19b2d2dc5ba3f99c43d86c27946de2ac71 (patch) | |
| tree | efb55f2b186f0636caefc8dd8680f918d1ddbb25 /src/client/views/topbar | |
| parent | 61787b3c1cf53c0230f6142bee0df30c65971012 (diff) | |
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
Diffstat (limited to 'src/client/views/topbar')
| -rw-r--r-- | src/client/views/topbar/TopBar.tsx | 15 |
1 files changed, 6 insertions, 9 deletions
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<object> { {Doc.ActiveDashboard ? ( <IconButton onClick={this.navigateToHome} - icon={<FontAwesomeIcon icon={DocListCast(Doc.MySharedDocs.data_dashboards).some(dash => !DocListCast(Doc.MySharedDocs.viewed).includes(dash)) ? 'portrait' : 'home'} />} + icon={<FontAwesomeIcon icon={DocListCast(Doc.MySharedDocs?.data_dashboards)?.some(dash => !DocListCast(Doc.MySharedDocs?.viewed)?.includes(dash)) ? 'portrait' : 'home'} />} color={this.color} background={this.backgroundColor} /> @@ -231,9 +226,11 @@ export class TopBar extends ObservableReactComponent<object> { 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); |
