Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: tidy up Agentic Chat and Context accordions and behaviour #6735

Open
wants to merge 39 commits into
base: main
Choose a base branch
from

Conversation

taiyab
Copy link
Contributor

@taiyab taiyab commented Jan 22, 2025

This PR merges the multiple accordions we currently have into one UX.

Before

CleanShot.2025-01-27.at.13.32.08.mp4

After

CleanShot.2025-01-27.at.13.34.40.mp4
Agentic Chat Selected Agentic Chat Not Selected
Agent Accordion Standard Accordion

Test plan

This was tested locally, manually, in the following ways (where possible):

Accordion Behavior Tests

  • Verify single accordion expands/collapses correctly
  • Confirm only one accordion section can be open at a time
  • Test that accordion state persists between chat sessions
  • Validate that accordion transitions are smooth without visual glitches

Context Panel Tests

  • Verify context information displays correctly when expanded
  • Check that context updates properly when switching between different files/references
  • Confirm context panel maintains scroll position when toggling
  • Test context panel resize behavior

Agentic Chat Integration

  • Verify chat interface remains functional with new accordion structure
  • Test chat history visibility when expanding/collapsing accordions
  • Confirm chat input remains accessible regardless of accordion state
  • Validate that chat notifications/indicators work with new layout

Cross-browser Testing

  • Test across multiple themes in VSCode and Jetbrains
  • Verify responsive behavior on different window sizes

Edge Cases

  • Test with very long context content
  • Verify behavior with multiple rapid accordion toggles
  • Check keyboard navigation and accessibility
  • Test with empty context/chat states

@taiyab taiyab changed the title Tr/search results vu 3 fix: tidy up Agentic Chat and Context accordions and behaviour Jan 27, 2025
@taiyab taiyab force-pushed the tr/search-results-vu-3 branch from 73f72a8 to 4903df6 Compare January 27, 2025 12:20
@taiyab taiyab marked this pull request as ready for review January 27, 2025 16:33
web/package.json Outdated Show resolved Hide resolved
vscode/webviews/components/FileLink.module.css Outdated Show resolved Hide resolved
Comment on lines +54 to +58
<div className="tw-flex tw-flex-col tw-gap-2 tw-my-2 tw-border-t tw-border-t-muted tw-pt-4">
<div className="tw-text-sm tw-font-medium tw-text-foreground tw-flex tw-items-center tw-gap-3">
<DatabaseIcon size={14} strokeWidth={1.75} className="tw-text-muted-foreground" />
Context used
</div>
<ul className="tw-list-none tw-flex tw-flex-col tw-gap-1">
{contextItems?.map((item, i) => (
Copy link
Member

Choose a reason for hiding this comment

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

This looks fully duplicated a few lines below. Can we clean that up?

Copy link
Member

@camdencheek camdencheek Feb 3, 2025

Choose a reason for hiding this comment

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

This doesn't look resolved to me. I think this is really worth cleaning up since these can easily get out of sync if someone goes to make a change and only tests agentic or non-agentic chat.

@taiyab taiyab force-pushed the tr/search-results-vu-3 branch from 9f57125 to ccbb8c0 Compare February 3, 2025 10:16
@taiyab
Copy link
Contributor Author

taiyab commented Feb 3, 2025

@abeatrix Can I get a review?

@taiyab taiyab requested a review from thenamankumar February 3, 2025 12:09
@taiyab taiyab requested a review from camdencheek February 3, 2025 14:45
Comment on lines +338 to +342
const { boostedResults, nonBoostedResults } = useMemo(() => {
if (!boostedRepo) {
return {
boostedResults: resultsToShow,
nonBoostedResults: [],
Copy link
Member

@camdencheek camdencheek Feb 3, 2025

Choose a reason for hiding this comment

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

Can we move this logic out of the templating language? It's quite surprising to me to see variable definitions + functions inside the template language, and I think it's actually a bug to call react hooks (like useMemo) conditionally.

@camdencheek
Copy link
Member

I'm seeing some inconsistent rendering locally that might be related to these changes. We seemingly sometimes fail to render a separator line.

CleanShot 2025-02-03 at 11 12 09@2x

@camdencheek
Copy link
Member

Can we make it a bit more obvious that the "context used" section is a sub-section? My initial reaction when testing this locally was to try to collapse the context used only to find it not collapsible and struggle to find that I need to click "Agentic chat" to collapse the (now very large) header

CleanShot 2025-02-03 at 11 29 46@2x

@camdencheek
Copy link
Member

camdencheek commented Feb 3, 2025

This looks really nice! The animations are ✨

I'll leave it to @abeatrix to hit approve since she's more familiar with the agentic chat domain

Copy link
Contributor

@abeatrix abeatrix left a comment

Choose a reason for hiding this comment

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

Started the build locally and Agentic Chat seems to work as expected, really like the animation on toggle:

image

The font color for the failed command makes it a bit hard to read though:

image

Do we need to update the storybook for the updated components? Specifically for AgenticContextCell as the ContextList now lives in it.

Also it's a bit hard to test the PR because it involves changes beyond the Agentic Chat
and context according (e.g. RepositorySelector, SearchResults, Welcome Footer etc). Is it possible to split them into separated PRs so that it'd be easier to test and review? 🙇‍♀️

vscode/src/chat/agentic/DeepCody.ts Outdated Show resolved Hide resolved
Comment on lines +79 to +83
steps => {
// Only pass steps that should appear in the accordion
const accordionSteps = steps.filter(step => step.type !== 'confirmation')
statusUpdateCallback(accordionSteps)
},
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
steps => {
// Only pass steps that should appear in the accordion
const accordionSteps = steps.filter(step => step.type !== 'confirmation')
statusUpdateCallback(accordionSteps)
},
steps => statusUpdateCallback(steps),

Do we need this? If yes, it might be better if we do the filtering in ProcessManager instead of the top-level?

vscode/webviews/chat/Transcript.tsx Outdated Show resolved Hide resolved
isContextLoading={isContextLoading}
processes={humanMessage?.processes ?? undefined}
/>
{humanMessage.agent && (
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
{humanMessage.agent && (
{!isSearchIntent && humanMessage.agent && (

I think @thenamankumar added the !isSearchIntent condition because of a feedback where Agentic Context is showing when we are displaying the Search result and the omnibox team doesn't want that

Copy link
Contributor Author

@taiyab taiyab Feb 4, 2025

Choose a reason for hiding this comment

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

The single component is also used to show you're in a search (and be able to swap back and forth).

Comment on lines +728 to +731
{!isSearchIntent &&
humanMessage.agent &&
isContextLoading &&
assistantMessage?.isLoading && <ApprovalCell vscodeAPI={vscodeAPI} />}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
{!isSearchIntent &&
humanMessage.agent &&
isContextLoading &&
assistantMessage?.isLoading && <ApprovalCell vscodeAPI={vscodeAPI} />}
{isContextLoading &&
assistantMessage?.isLoading && <ApprovalCell vscodeAPI={vscodeAPI} />}

Since we are nesting this component and we check for the humanMessage.agent at the top level already, we won't need this I assume?

However, we originally set the ApprovalCell component as an independent component instead of tying it to the AgenticContext to make the ApprovalCell reusable by other agents / non-agent processes. Is there any reason we want to tie it to Agentic Context?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants