From 66ba2a4ff52397f493367eb165c70b74343fa565 Mon Sep 17 00:00:00 2001 From: Kevin Wang Date: Wed, 18 Oct 2023 16:03:38 -0400 Subject: [PATCH] Developer AI VQA Cont. (#2186) * leave comment on `.arrowdown` * replace `mdxA` with `InlineLink` * add TODOs on a11y * update welcome text - same as https://github.com/hashicorp/dev-portal/pull/2181/commits/6e70cc116e631144622c400383e8e02ed387cc28 * show finished element * add TODOs * lazyload `Finished` component * remove button overrides * update placeholder * Update src/components/chatbox/welcome-message.tsx * remove welcome message body text * update back button styles * fix: don't lazy import finished component * adjust button size * feat: adds ai feedback button to command bar header (#2203) * feat: adds command bar right header slot * update feedback form url * update buttons * adjut to arrow 16 * adds ai link * open in new tab --------- Co-authored-by: Kendall Strautman Co-authored-by: Kendall Strautman Swarthout <36613477+kendallstrautman@users.noreply.github.com> --- src/components/chatbox/Markdown.tsx | 4 +- src/components/chatbox/chatbox.module.css | 12 +-- src/components/chatbox/chatbox.tsx | 12 ++- src/components/chatbox/message.module.css | 4 +- src/components/chatbox/message.tsx | 86 ++++++++-------- src/components/chatbox/welcome-message.tsx | 97 +++++++------------ .../command-bar/commands/chat/chat.module.css | 10 +- .../command-bar/commands/chat/index.tsx | 29 +++++- .../dialog/command-bar-dialog.module.css | 2 +- .../command-bar/components/dialog/header.tsx | 38 ++++---- src/components/command-bar/types.ts | 1 + src/constants/ai-feedback-form.ts | 2 + 12 files changed, 154 insertions(+), 143 deletions(-) create mode 100644 src/constants/ai-feedback-form.ts diff --git a/src/components/chatbox/Markdown.tsx b/src/components/chatbox/Markdown.tsx index ddac282e8d..198ea550ba 100644 --- a/src/components/chatbox/Markdown.tsx +++ b/src/components/chatbox/Markdown.tsx @@ -10,7 +10,7 @@ import { rehypeCodePlugins } from 'lib/rehype-code-plugins' import { MdxPre } from 'components/dev-dot-content/mdx-components/mdx-code-blocks' import Text from 'components/text' -import { MdxA } from 'components/dev-dot-content/mdx-components' +import InlineLink from 'components/inline-link' interface MarkdownProps { markdown: string @@ -27,7 +27,7 @@ export default function Markdown({ markdown, className }: MarkdownProps) { ), // @ts-expect-error - ignore type mismatch - a: MdxA, + a: InlineLink, }} remarkPlugins={[remarkGfm]} // @ts-expect-error - ignore type mismatch diff --git a/src/components/chatbox/chatbox.module.css b/src/components/chatbox/chatbox.module.css index cbe5f7b6a3..67f649d825 100644 --- a/src/components/chatbox/chatbox.module.css +++ b/src/components/chatbox/chatbox.module.css @@ -21,13 +21,6 @@ } .arrowdown { - /* button overrides - start */ - height: 28px; - width: 28px; - padding: unset; - - /* button overrides - end */ - position: absolute; top: -52px; right: 20px; @@ -117,3 +110,8 @@ display: block; padding: 8px 0 0 10px; } + +.externalLink { + composes: root from '/src/components/inline-link/inline-link.module.css'; + composes: primary from '/src/components/inline-link/inline-link.module.css'; +} diff --git a/src/components/chatbox/chatbox.tsx b/src/components/chatbox/chatbox.tsx index 72052536ff..7407d80c4c 100644 --- a/src/components/chatbox/chatbox.tsx +++ b/src/components/chatbox/chatbox.tsx @@ -360,7 +360,7 @@ const ChatBox = () => {
{textContentScrollBarIsVisible && !isLoading ? (
diff --git a/src/components/chatbox/message.module.css b/src/components/chatbox/message.module.css index 2780d9499c..da159c97d9 100644 --- a/src/components/chatbox/message.module.css +++ b/src/components/chatbox/message.module.css @@ -74,7 +74,7 @@ .assistantMessageFooter { width: 100%; - padding: 24px 0 0; + padding: 24px 0; } .assistantMessageFooterHidden { @@ -85,7 +85,7 @@ display: block; width: 100%; border-bottom: 1px solid var(--token-color-palette-neutral-300); - margin-bottom: 24px; + margin-bottom: 40px; } .actionButtons { diff --git a/src/components/chatbox/message.tsx b/src/components/chatbox/message.tsx index 9b26408c5c..e50b9f6bf7 100644 --- a/src/components/chatbox/message.tsx +++ b/src/components/chatbox/message.tsx @@ -15,6 +15,7 @@ import { IconThumbsUp24 } from '@hashicorp/flight-icons/svg-react/thumbs-up-24' import { IconWand24 } from '@hashicorp/flight-icons/svg-react/wand-24' import { IconAlertDiamondFill24 } from '@hashicorp/flight-icons/svg-react/alert-diamond-fill-24' +import { Finished } from 'components/feedback-form/components/finished' import Button from 'components/button' import Text from 'components/text' import IconTile from 'components/icon-tile' @@ -138,46 +139,55 @@ const AssistantMessage = ({ })} > -
-
+