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

feat(Smart Apply): Show Reapply for applied code blocks #6898

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions vscode/webviews/chat/ChatMessageContent/create-buttons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
CopyCodeBlockIcon,
EllipsisIcon,
InsertCodeBlockIcon,
RefreshIcon,
SaveCodeBlockIcon,
SparkleIcon,
SyncSpinIcon,
Expand Down Expand Up @@ -286,6 +287,22 @@ function createApplyButton(

break
}
case 'Applied':
case 'Finished': {
button.innerHTML = 'Reapply'

// Add Refresh Icon
const iconContainer = document.createElement('div')
iconContainer.className = styles.iconContainer
iconContainer.innerHTML = RefreshIcon
button.prepend(iconContainer)

button.addEventListener('click', () =>
smartApply.onSubmit(smartApplyId, preText, humanMessage?.text, fileName)
)

break
}
default: {
button.innerHTML = 'Apply'

Expand Down
2 changes: 2 additions & 0 deletions vscode/webviews/icons/CodeBlockActionIcons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,5 @@ export const CloseIcon =
'<svg role="img" width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M8 8.707l3.646 3.647.708-.707L8.707 8l3.647-3.646-.707-.708L8 7.293 4.354 3.646l-.707.708L7.293 8l-3.646 3.646.707.708L8 8.707z"/></svg>'

export const TerminalIcon = '<i class="codicon codicon-terminal tw-align-middle"></i>'

export const RefreshIcon = '<i class="codicon codicon-refresh tw-align-middle"></i>'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@abeatrix Do you know if these icons are automatically available in JetBrains? (I see you added the Terminal one above)

Loading