This commit is contained in:
Andrew Pareles 2025-03-19 16:32:36 -07:00
parent 744d387fe1
commit acd711f93b
3 changed files with 6 additions and 4 deletions

View file

@ -158,7 +158,7 @@ export const useApplyButtonHTML = ({ codeStr, applyBoxId, uri }: { codeStr: stri
const onClickSubmit = useCallback(async () => {
if (isDisabled) return
if (getStreamState()) return
if (getStreamState() === 'streaming') return
const [newApplyingUri, _] = await editCodeService.startApplying({
from: 'ClickApply',
applyStr: codeStr,
@ -176,7 +176,7 @@ export const useApplyButtonHTML = ({ codeStr, applyBoxId, uri }: { codeStr: stri
const onInterrupt = useCallback(() => {
if (!getStreamState()) return
if (getStreamState() !== 'streaming') return
const uri = getUriBeingApplied()
if (!uri) return

View file

@ -55,6 +55,7 @@ const VoidCommandBar = ({ uri, editor }: { uri: URI | null, editor: ICodeEditor
const [currUriIdx, setUriIdx] = useState<number | null>(null)
const [currUriHasChanges, setCurrUriHasChanges] = useState(false)
useEffect(() => {
console.log('uri', uri?.fsPath, sortedCommandBarURIs)
const i = sortedCommandBarURIs.findIndex(e => e.fsPath === uri?.fsPath)
if (i !== -1) {
setUriIdx(i)

View file

@ -131,9 +131,10 @@ export class VoidCommandBarService extends Disposable implements IVoidCommandBar
// state updaters
this._register(this._editCodeService.onDidAddOrDeleteDiffZones(e => {
for (const uri of this._hooks) {
if (e.uri.fsPath !== uri.fsPath) return
if (e.uri.fsPath !== uri.fsPath) continue
// --- sortedURIs: delete if empty, add if not in state yet
const diffZones = this._getDiffZonesOnURI(uri)
console.log('addordelete diffzone', uri.fsPath, diffZones)
if (diffZones.length === 0) {
this._deleteURIEntryFromState(uri)
this._onDidChangeState.fire({ uri })
@ -323,7 +324,7 @@ export class VoidCommandBarService extends Disposable implements IVoidCommandBar
if (i === -1) return
this.sortedURIs = [
...this.sortedURIs.slice(0, i),
...this.sortedURIs.slice(i, Infinity),
...this.sortedURIs.slice(i + 1, Infinity),
]
// delete from state
delete this.stateOfURI[uri.fsPath]