Skip to content

Commit

Permalink
update actions button appearance
Browse files Browse the repository at this point in the history
  • Loading branch information
beyang committed Nov 13, 2024
1 parent b2b5bb7 commit e8aed40
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
5 changes: 1 addition & 4 deletions vscode/webviews/chat/Transcript.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -456,10 +456,7 @@ const TranscriptInteraction: FC<TranscriptInteractionProps> = memo(props => {
{(humanMessage.contextFiles || assistantMessage || isContextLoading) && (
<ContextCell
resubmitWithRepoContext={
corpusContextItems.length > 0 &&
!mentionsContainRepository &&
assistantMessage &&
!assistantMessage.isLoading
corpusContextItems.length > 0 && !mentionsContainRepository && assistantMessage
? resubmitWithRepoContext
: undefined
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@
.context-suggested-actions {
display: flex;
flex-wrap: wrap;
gap: 0.25rem;
}
21 changes: 12 additions & 9 deletions vscode/webviews/chat/cells/contextCell/ContextCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { ContextItem, Model } from '@sourcegraph/cody-shared'
import { pluralize } from '@sourcegraph/cody-shared'
import type { RankedContext } from '@sourcegraph/cody-shared/src/chat/transcript/messages'
import { clsx } from 'clsx'
import { ArrowBigUp, AtSign, BrainIcon, MessagesSquareIcon } from 'lucide-react'
import { BrainIcon, FilePenLine, MessagesSquareIcon } from 'lucide-react'
import {
type FunctionComponent,
createContext,
Expand Down Expand Up @@ -212,7 +212,7 @@ export const ContextCell: FunctionComponent<{
) : (
<>
<AccordionContent overflow={showSnippets}>
<div>
<div className={styles.contextSuggestedActions}>
{contextItems && contextItems.length > 0 && (
<Button
size="sm"
Expand All @@ -227,7 +227,12 @@ export const ContextCell: FunctionComponent<{
</Button>
)}
{resubmitWithRepoContext && (
<Button onClick={resubmitWithRepoContext} type="button">
<Button
size="sm"
variant="outline"
onClick={resubmitWithRepoContext}
type="button"
>
Resend with current repository context
</Button>
)}
Expand Down Expand Up @@ -418,16 +423,14 @@ const ExcludedContextWarning: React.FC<{ message: string }> = ({ message }) => (

export const EditContextButtonSearch = (
<>
<ArrowBigUp className="-tw-mr-6 tw-py-0" />
<AtSign className="-tw-mr-2 tw-py-2" />
<div>Edit results as mentions</div>
<FilePenLine size={'1em'} />
<div>Edit results</div>
</>
)

export const EditContextButtonChat = (
<>
<ArrowBigUp className="-tw-mr-6 tw-py-0" />
<AtSign className="-tw-mr-2 tw-py-2" />
<div>Copy and edit as mentions</div>
<FilePenLine size={'1em'} />
<div>Edit context</div>
</>
)

0 comments on commit e8aed40

Please sign in to comment.