Skip to content

Commit 9e007de

Browse files
STetsingci-bot
authored andcommitted
fixed .deps unfolded when AI generation is done or when resolving a contract's imports
1 parent e12ead8 commit 9e007de

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

apps/remix-ide/src/app/plugins/remixAIPlugin.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,6 @@ export class RemixAIPlugin extends Plugin {
187187
params.stream_result = false // enforce no stream result
188188
params.threadId = newThreadID
189189
params.provider = this.assistantProvider
190-
userPrompt = userPrompt + " while specifying the library github tag in the imports"
191190
_paq.push(['trackEvent', 'ai', 'remixAI', 'GenerateNewAIWorkspace'])
192191

193192
if (useRag) {

libs/remix-ui/workspace/src/lib/reducers/workspace.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -337,8 +337,8 @@ export const browserReducer = (state = browserInitialState, action: Actions) =>
337337

338338
const check = checkCurrentParentPathInView(payload, state.mode === 'browser' ? state.browser.expandPath : state.localhost.expandPath)
339339
const fd = fileAdded(state, payload)
340-
const browserExpandPath = state.mode === 'browser' && !isElectron() && check.inView ? [...new Set([...state.browser.expandPath, payload])] : state.browser.expandPath
341-
const localhostExpandPath = state.mode === 'localhost' && check.inView ? [...new Set([...state.localhost.expandPath, payload])] : state.localhost.expandPath
340+
const browserExpandPath = state.mode === 'browser' && !isElectron() && check.inView && !payload.includes('.deps') ? [...new Set([...state.browser.expandPath, payload])] : state.browser.expandPath
341+
const localhostExpandPath = state.mode === 'localhost' && check.inView && !payload.includes('.deps') ? [...new Set([...state.localhost.expandPath, payload])] : state.localhost.expandPath
342342
const flatTree = flattenTree(fd, state.mode === 'browser'? browserExpandPath : localhostExpandPath)
343343
return {
344344
...state,
@@ -373,8 +373,8 @@ export const browserReducer = (state = browserInitialState, action: Actions) =>
373373
const inView = check.inView || check.rootViewToAdd
374374
payload.folderPath = check.inView ? payload.folderPath : check.rootViewToAdd ? check.rootFolder : ''
375375

376-
const browserExpandPath = state.mode === 'browser' && !isElectron() && inView ? [...new Set([...state.browser.expandPath, payload.folderPath])] : state.browser.expandPath
377-
const localhostExpandPath = state.mode === 'localhost' && inView ? [...new Set([...state.localhost.expandPath, payload.folderPath])] : state.localhost.expandPath
376+
const browserExpandPath = state.mode === 'browser' && !isElectron() && inView && !payload.folderPath.includes('.deps') ? [...new Set([...state.browser.expandPath, payload.folderPath])] : state.browser.expandPath
377+
const localhostExpandPath = state.mode === 'localhost' && inView && !payload.folderPath.includes('.deps') ? [...new Set([...state.localhost.expandPath, payload.folderPath])] : state.localhost.expandPath
378378
const flatTree = flattenTree(fd, state.mode === 'browser'? browserExpandPath : localhostExpandPath)
379379
return {
380380
...state,

libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -659,15 +659,15 @@ export function Workspace() {
659659

660660
const uploadFile = (target) => {
661661
const parentFolder = getFocusedFolder()
662-
const expandPath = [...new Set([...global.fs.browser.expandPath, parentFolder])]
662+
const expandPath = [...new Set([...global.fs.browser.expandPath, parentFolder].filter(path => !path.includes('.deps')))]
663663

664664
global.dispatchHandleExpandPath(expandPath)
665665
global.dispatchUploadFile(target, parentFolder)
666666
}
667667

668668
const uploadFolder = (target) => {
669669
const parentFolder = getFocusedFolder()
670-
const expandPath = [...new Set([...global.fs.browser.expandPath, parentFolder])]
670+
const expandPath = [...new Set([...global.fs.browser.expandPath, parentFolder].filter(path => !path.includes('.deps')))]
671671

672672
global.dispatchHandleExpandPath(expandPath)
673673
global.dispatchUploadFolder(target, parentFolder)
@@ -810,7 +810,7 @@ export function Workspace() {
810810

811811
const handleNewFileInput = async (parentFolder?: string) => {
812812
if (!parentFolder) parentFolder = getFocusedFolder()
813-
const expandPath = [...new Set([...global.fs.browser.expandPath, parentFolder])]
813+
const expandPath = [...new Set([...global.fs.browser.expandPath, parentFolder].filter(path => !path.includes('.deps')))]
814814

815815
await global.dispatchAddInputField(parentFolder, 'file')
816816
global.dispatchHandleExpandPath(expandPath)
@@ -820,7 +820,7 @@ export function Workspace() {
820820
const handleNewFolderInput = async (parentFolder?: string) => {
821821
if (!parentFolder) parentFolder = getFocusedFolder()
822822
else if (parentFolder.indexOf('.sol') !== -1 || parentFolder.indexOf('.js') !== -1) parentFolder = extractParentFromKey(parentFolder)
823-
const expandPath = [...new Set([...global.fs.browser.expandPath, parentFolder])]
823+
const expandPath = [...new Set([...global.fs.browser.expandPath, parentFolder].filter(path => !path.includes('.deps')))]
824824

825825
await global.dispatchAddInputField(parentFolder, 'folder')
826826
global.dispatchHandleExpandPath(expandPath)

0 commit comments

Comments
 (0)