Skip to content

Assist - port WebUI changes#25930

Merged
jakule merged 6 commits intomasterfrom
jakule/ai-web-ui-port
May 11, 2023
Merged

Assist - port WebUI changes#25930
jakule merged 6 commits intomasterfrom
jakule/ai-web-ui-port

Conversation

@jakule
Copy link
Copy Markdown
Contributor

@jakule jakule commented May 9, 2023

This PR ports all WebUI changes used by Teleport Assist.

Note: The backend changes are not included in this branch, so UI won't show up if run directly on this branch.

This PR port all WebUI changes used by Teleport Assist.
@public-teleport-github-review-bot
Copy link
Copy Markdown

@jakule - this PR will require admin approval to merge due to its size. Consider breaking it up into a series smaller changes.

Remove console.log
@jakule jakule requested review from kimlisa, r0mant and zmb3 May 9, 2023 18:57
break;

case MessageTypeEnum.RAW:
const data = JSON.parse(msg.payload) as RawPayload;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we be catching SyntaxErrors here? I noticed you did so in the useLocalStorage hook, but not here.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could maybe start to make use of zod in the web UI in the near future. We use it in Connect to validate and cast to specific types, could be useful here (not a blocker for this now, just rambling)

Comment thread web/packages/design/src/assets/images/icons/openai.svg
Comment thread web/packages/teleport/src/Assist/Sidebar/logo.png Outdated
Comment thread web/packages/teleport/src/Navigation/teleport-icon.png Outdated
Copy link
Copy Markdown
Contributor

@avatus avatus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general, we've defined all the styled component stuff at the bottom of the file instead of the top. It might be a bit of a large task to migrate them all to the bottom but consistency would be good. Maybe a PR in the future?

I wasn't able to test locally without an API key so this was a glance at this PR (and the original PRs to dev-ai) and seems good enough, but admittedly, the size got me lost in the sauce.

:shipit:

@@ -0,0 +1,46 @@
/*
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this avatar distinct to chat only or can it be moved to its own component in design

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's distinct to chat

break;

case MessageTypeEnum.RAW:
const data = JSON.parse(msg.payload) as RawPayload;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could maybe start to make use of zod in the web UI in the near future. We use it in Connect to validate and cast to specific types, could be useful here (not a blocker for this now, just rambling)

Copy link
Copy Markdown
Contributor

@kimlisa kimlisa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

most of my comments are not blockers (they can be dealt with later), the only thing i'll express concern though is inconsistent error handling. there are a few places where we don't check for error (api calls, awaits) so i'm guessing outcome is either breakage or nothing happens for the user

Comment thread web/packages/design/src/SVGIcon/index.ts
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we defined this in our SVGIcon/*? i created this directory (assets/images/icons/*) not realizing we had the svg directory. unless there was a specific reason we should put them here? (i created a svg container for the integration list recently here)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@justinas deferring to you as this is icon is for the integrations page, which uses svg files instead of SVGIcon

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO it's fine as-is for this PR, I can try and move all the integration icons to SVGIcon as a follow up.

Comment thread web/packages/teleport/src/services/ping/makePing.ts Outdated
Comment thread web/packages/teleport/src/features.tsx
Comment thread web/packages/teleport/src/Navigation/NavigationSwitcher.tsx
Comment thread web/packages/teleport/src/Assist/Chat/ChatItem/Action/Action.tsx Outdated
Comment thread web/packages/teleport/src/Assist/Chat/ChatItem/Action/Action.tsx
Comment thread web/packages/teleport/src/Assist/Chat/Timestamp.tsx
Comment thread web/packages/teleport/src/Assist/Chat/ChatItem/Action/RunAction.tsx Outdated
Comment thread web/packages/teleport/src/Assist/Chat/ChatItem/Action/RunAction.tsx Outdated
@jakule jakule requested review from kimlisa and zmb3 May 11, 2023 13:59
Copy link
Copy Markdown
Contributor

@kimlisa kimlisa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for changes, just some other small stuff and looks good

Comment thread web/packages/teleport/src/Assist/Chat/Chat.tsx Outdated
Comment thread web/packages/teleport/src/Assist/Chat/ChatItem/Action/Action.tsx
Comment thread web/packages/teleport/src/Assist/Chat/ChatItem/Action/RunAction.tsx Outdated
Comment thread web/packages/teleport/src/Assist/Sidebar/Sidebar.tsx Outdated
Comment thread web/packages/teleport/src/Assist/contexts/conversations.tsx
Comment thread web/packages/teleport/src/Navigation/NavigationSwitcher.tsx Outdated
Comment thread web/packages/teleport/src/Navigation/NavigationSwitcher.tsx Outdated
Comment thread web/packages/teleport/src/Navigation/NavigationSwitcher.tsx Outdated
Copy link
Copy Markdown
Collaborator

@r0mant r0mant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bot.

@public-teleport-github-review-bot public-teleport-github-review-bot Bot removed the request for review from ravicious May 11, 2023 17:39
@jakule jakule added this pull request to the merge queue May 11, 2023
Merged via the queue into master with commit efd49b3 May 11, 2023
@jakule jakule deleted the jakule/ai-web-ui-port branch May 11, 2023 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants