This commit is contained in:
Andrew Pareles 2025-03-17 22:51:23 -07:00
parent a1c7b254d3
commit 5d0a4c8157
2 changed files with 9 additions and 1 deletions

View file

@ -1733,6 +1733,7 @@ class EditCodeService extends Disposable implements IEditCodeService {
const originalBounds = findTextInCode(block.orig, originalFileCode)
// if error
if (typeof originalBounds === 'string') {
console.log('Error finding text in code:')
console.log('fullText', { fullText })
console.log('error:', originalBounds)
console.log('block.orig:', block.orig)
@ -1820,6 +1821,8 @@ class EditCodeService extends Disposable implements IEditCodeService {
onFinalMessage: async (params) => {
const { fullText } = params
console.log('DONE!', fullText)
// 1. wait 500ms and fix lint errors - call lint error workflow
// (update react state to say "Fixing errors")
const blocks = extractSearchReplaceBlocks(fullText)

View file

@ -666,6 +666,7 @@ type ToolHeaderParams = {
isError?: boolean;
isRejected?: boolean;
numResults?: number;
hasNextPage?: boolean;
children?: React.ReactNode;
onClick?: () => void;
isOpen?: boolean,
@ -677,6 +678,7 @@ const ToolHeaderWrapper = ({
desc1,
desc2,
numResults,
hasNextPage,
children,
isError,
onClick,
@ -719,7 +721,7 @@ const ToolHeaderWrapper = ({
</span>}
{numResults !== undefined && (
<span className="text-void-fg-4 text-xs ml-auto mr-1">
{`(`}{numResults}{` result`}{numResults !== 1 ? 's' : ''}{`)`}
{`(${numResults}${hasNextPage ? '+' : ''} result${numResults !== 1 ? 's' : ''})`}
</span>
)}
{isError && <AlertTriangle className='text-void-warning opacity-90 flex-shrink-0' size={14} />}
@ -1295,6 +1297,7 @@ const toolNameToComponent: { [T in ToolName]: {
if (toolMessage.result.type === 'success') {
const { value, params } = toolMessage.result
componentParams.numResults = value.children?.length
componentParams.hasNextPage = value.hasNextPage
componentParams.children = !value.children || (value.children.length ?? 0) === 0 ? undefined
: <ToolContentsWrapper>
{value.children.map((child, i) => (<ListableToolItem key={i}
@ -1337,6 +1340,7 @@ const toolNameToComponent: { [T in ToolName]: {
if (toolMessage.result.type === 'success') {
const { value, params } = toolMessage.result
componentParams.numResults = value.uris.length
componentParams.hasNextPage = value.hasNextPage
componentParams.children = value.uris.length === 0 ? undefined
: <ToolContentsWrapper>
{value.uris.map((uri, i) => (<ListableToolItem key={i}
@ -1376,6 +1380,7 @@ const toolNameToComponent: { [T in ToolName]: {
if (toolMessage.result.type === 'success') {
const { value, params } = toolMessage.result
componentParams.numResults = value.uris.length
componentParams.hasNextPage = value.hasNextPage
componentParams.children = value.uris.length === 0 ? undefined
: <ToolContentsWrapper>
{value.uris.map((uri, i) => (<ListableToolItem key={i}