Skip to content

[Assist] New UI & rewrite#27629

Merged
ryanclark merged 18 commits intomasterfrom
ryan/new-assist-ui
Jun 13, 2023
Merged

[Assist] New UI & rewrite#27629
ryanclark merged 18 commits intomasterfrom
ryan/new-assist-ui

Conversation

@ryanclark
Copy link
Copy Markdown
Member

This rewrites the data logic behind assist to be easier to test and clearer as to what is doing what.

The state is moved into a context which uses a reducer for all state operations. This means we have pure functions for manipulating state that can be tested.

New UI:
Collapsed -
image

Expanded -
image

Docked to sidebar -
image

TODO:
Resolve node ids to the hostname when displaying a conversation that previously had commands ran in it

@ryanclark ryanclark force-pushed the ryan/new-assist-ui branch from ba5c0e7 to 142271f Compare June 8, 2023 17:36
@justinas
Copy link
Copy Markdown
Contributor

justinas commented Jun 9, 2023

Some general UX observations:

Empty output / failed executions

Looks like some of the improvements in #27010 got reverted.

Loading an existing conversation where execution failed with an exit code just shows empty output:

Screenshot 2023-06-09 at 16 05 36

The Empty output. message on successful execution that did not produce output has been replaced by an empty block. Might be fine/intentional?

Screenshot 2023-06-09 at 16 20 18

"Connecting to nodes..." thought

The ellipsis sort of signals that the process is still ongoing, but the checkmark indicates that the process succeeded.

Screenshot 2023-06-09 at 15 42 32

Permalinks

We do not utilize history to be able to navigate / link to individual conversations anymore. Not sure that it would make sense to do so in a docked mode, but perhaps in the expanded mode, we could still "navigate" to conversation URLs?

Copy link
Copy Markdown
Contributor

@justinas justinas left a comment

Choose a reason for hiding this comment

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

Some nits

Comment thread web/packages/teleport/src/Assist/MessageBox/MessageBox.tsx Outdated
Comment thread web/packages/teleport/src/Assist/Conversation/CommandResultEntry.tsx Outdated
Comment thread web/packages/teleport/src/Assist/Conversation/EntryContainer.tsx Outdated
Comment thread web/packages/teleport/src/Assist/Conversation/Message.tsx Outdated
Comment thread web/packages/teleport/src/Assist/ConversationHistory/ConversationHistory.tsx Outdated
Comment thread web/packages/teleport/src/Assist/MessageBox/MessageBox.tsx Outdated
Comment thread web/packages/teleport/src/Assist/context/AssistContext.tsx Outdated
@ryanclark ryanclark marked this pull request as ready for review June 9, 2023 14:03
@ryanclark ryanclark requested a review from kimlisa June 9, 2023 14:03
@github-actions github-actions Bot requested review from avatus and ravicious June 9, 2023 14:03
@ryanclark ryanclark force-pushed the ryan/new-assist-ui branch from 867faeb to b10beef Compare June 9, 2023 14:30
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.

nothing too major stood out to me, overall great stuff

i did not test with a working assist or with MFA, i just tested whatever i could access without setting up open ai token.

if you want some help with testing with working assist, let me know (or do you have a cluster maybe?)

Comment thread web/packages/teleport/src/Assist/Conversation/ExecuteRemoteCommandEntry.tsx Outdated
Comment thread web/packages/teleport/src/Assist/Conversation/ExecuteRemoteCommandEntry.tsx Outdated
Comment thread web/packages/teleport/src/Assist/ConversationHistory/ConversationHistory.tsx Outdated
Comment thread web/packages/teleport/src/Assist/service.ts Outdated
Comment thread web/packages/teleport/src/Assist/service.ts Outdated
Comment thread web/packages/teleport/src/Assist/ConversationHistory/ConversationHistory.tsx Outdated
Comment thread web/packages/teleport/src/Assist/Conversation/ExecuteRemoteCommandEntry.tsx Outdated
Comment thread web/packages/teleport/src/Assist/LandingPage/LandingPage.tsx Outdated
Comment thread web/packages/teleport/src/Assist/ConversationHistory/DeleteConversationDialog.tsx Outdated
Comment thread web/packages/teleport/src/TopBar/TopBar.tsx Outdated
@ryanclark ryanclark force-pushed the ryan/new-assist-ui branch from c649be6 to 7c050b6 Compare June 12, 2023 13:16
@public-teleport-github-review-bot
Copy link
Copy Markdown

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

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.

LGTM, one other note is, i can click on the links now, but it unexpectedly closes the assist

@ryanclark
Copy link
Copy Markdown
Member Author

LGTM, one other note is, i can click on the links now, but it unexpectedly closes the assist

Cheers, fixed

@ryanclark ryanclark force-pushed the ryan/new-assist-ui branch from 080e980 to 522541f Compare June 12, 2023 16:11
@ryanclark ryanclark force-pushed the ryan/new-assist-ui branch from 1663c4c to b949dd5 Compare June 12, 2023 20:03
@ryanclark ryanclark added this pull request to the merge queue Jun 12, 2023
@ryanclark ryanclark removed this pull request from the merge queue due to a manual request Jun 12, 2023
@ryanclark ryanclark added this pull request to the merge queue Jun 13, 2023
Merged via the queue into master with commit 0c75d71 Jun 13, 2023
@ryanclark ryanclark deleted the ryan/new-assist-ui branch June 13, 2023 09:50
@public-teleport-github-review-bot
Copy link
Copy Markdown

@ryanclark See the table below for backport results.

Branch Result
branch/v13 Failed

ryanclark added a commit that referenced this pull request Jun 13, 2023
* Rewrite Assist & implement a new UI

* Use the node name from the API

* Code review comments

* Address UI code review comments

* Add some tests for the service

* Rename "MiniAssit" to "Assist"

* Impose a max height for the floating assist for small windows

* Add missing license header

* Update web/packages/teleport/src/Assist/Conversation/ExecuteRemoteCommandEntry.tsx

Co-authored-by: Lisa Kim <lisa@goteleport.com>

* Code review improvements

* Only use stopPropagation so links still work and assist does not close

* Make errors only show when error message isn't null

* Add websocket refresh to avoid session expirations

* Mark the conversation as not streaming when assist returns a full message

* Improvements to error handling and icon spacing

* Use encodeChallengeResponse to match the MFA backend changes

* Run prettier

* Usability improvements

---------

Co-authored-by: Lisa Kim <lisa@goteleport.com>
ryanclark added a commit that referenced this pull request Jun 15, 2023
* [Assist] New UI & rewrite (#27629)

* Rewrite Assist & implement a new UI

* Use the node name from the API

* Code review comments

* Address UI code review comments

* Add some tests for the service

* Rename "MiniAssit" to "Assist"

* Impose a max height for the floating assist for small windows

* Add missing license header

* Update web/packages/teleport/src/Assist/Conversation/ExecuteRemoteCommandEntry.tsx

Co-authored-by: Lisa Kim <lisa@goteleport.com>

* Code review improvements

* Only use stopPropagation so links still work and assist does not close

* Make errors only show when error message isn't null

* Add websocket refresh to avoid session expirations

* Mark the conversation as not streaming when assist returns a full message

* Improvements to error handling and icon spacing

* Use encodeChallengeResponse to match the MFA backend changes

* Run prettier

* Usability improvements

---------

Co-authored-by: Lisa Kim <lisa@goteleport.com>

* Update the proto encoding for MFA

---------

Co-authored-by: Lisa Kim <lisa@goteleport.com>
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.

4 participants