Skip to content

Commit 91b472c

Browse files
authored
Merge branch 'master' into master
2 parents d623f85 + c83b154 commit 91b472c

File tree

5 files changed

+16
-44
lines changed

5 files changed

+16
-44
lines changed

apps/remix-ide/src/app/files/workspaceFileProvider.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,13 @@ class WorkspaceFileProvider extends FileProvider {
1212

1313
try {
1414
// make sure "code-sample" has been removed
15-
window.remixFileSystem.unlink(this.workspacesPath + '/code-sample')
15+
window.remixFileSystem.exists(this.workspacesPath + '/code-sample').then((exist) => {
16+
if (exist) window.remixFileSystem.unlink(this.workspacesPath + '/code-sample').catch((e) => {
17+
console.log(e)
18+
})
19+
}).catch((e) => {
20+
console.log(e)
21+
})
1622
} catch (e) {
1723
// we don't need to log error if this throws an error
1824
}

apps/remix-ide/src/app/plugins/remixd-handle.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ export class RemixdHandle extends WebsocketPlugin {
5050
}
5151

5252
async activate() {
53-
console.trace('activate remixd')
5453
this.connectToLocalhost()
5554
return true
5655
}

apps/remix-ide/src/remixAppManager.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,9 @@ let requiredModules = [ // services + layout views + system views
7979
'openaigpt',
8080
'home',
8181
'doc-viewer',
82-
'doc-gen'
82+
'doc-gen',
83+
'copilot-suggestion',
84+
'remix-templates'
8385
]
8486

8587

libs/remix-ui/workspace/src/lib/components/flat-tree.tsx

Lines changed: 4 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,17 @@ import { fileDecoration, FileDecorationIcons } from '@remix-ui/file-decorators';
1111
export default function useOnScreen(ref: RefObject<HTMLElement>) {
1212

1313
const [isIntersecting, setIntersecting] = useState(false)
14-
1514
const observer = useMemo(() => new IntersectionObserver(
1615
([entry]) => setIntersecting(entry.isIntersecting)
1716
), [ref])
1817

19-
2018
useEffect(() => {
2119
observer.observe(ref.current)
2220
return () => observer.disconnect()
2321
}, [])
2422

2523
return isIntersecting
2624
}
27-
2825
interface FlatTreeProps {
2926
files: { [x: string]: Record<string, FileType> },
3027
flatTree: FileType[],
@@ -39,7 +36,6 @@ interface FlatTreeProps {
3936
moveFile: (dest: string, src: string) => void
4037
moveFolder: (dest: string, src: string) => void
4138
fileState: fileDecoration[]
42-
4339
}
4440

4541
let mouseTimer: any = {
@@ -63,17 +59,8 @@ export const FlatTree = (props: FlatTreeProps) => {
6359
const [dragSource, setDragSource] = useState<FileType>()
6460
const [isDragging, setIsDragging] = useState<boolean>(false)
6561
const ref = useRef(null)
66-
const [size, setSize] = useState(0)
6762
const containerRef = useRef<HTMLDivElement>(null)
6863
const virtuoso = useRef<VirtuosoHandle>(null)
69-
const isOnScreen = useOnScreen(containerRef)
70-
71-
useEffect(() => {
72-
if (isOnScreen) {
73-
setViewPortHeight()
74-
}
75-
}, [isOnScreen])
76-
7764

7865
const labelClass = (file: FileType) =>
7966
props.focusEdit.element === file.path
@@ -181,25 +168,6 @@ export const FlatTree = (props: FlatTreeProps) => {
181168
setShowMouseOverTarget(false)
182169
}
183170

184-
185-
const setViewPortHeight = () => {
186-
const boundingRect = containerRef.current.getBoundingClientRect()
187-
setSize(boundingRect.height - 40)
188-
}
189-
190-
191-
useEffect(() => {
192-
window.addEventListener('resize', setViewPortHeight)
193-
return () => {
194-
window.removeEventListener('resize', setViewPortHeight)
195-
}
196-
}, [])
197-
198-
useEffect(() => {
199-
setViewPortHeight()
200-
}, [containerRef.current])
201-
202-
203171
useEffect(() => {
204172
if (focusEdit && focusEdit.element) {
205173
const index = flatTree.findIndex((item) => item.path === focusEdit.element)
@@ -259,12 +227,12 @@ export const FlatTree = (props: FlatTreeProps) => {
259227
expandPath={expandPath}
260228
>
261229
<div data-id="treeViewUltreeViewMenu"
262-
className='d-flex h-100 w-100'
230+
className='d-flex h-100 w-100 pb-2'
263231
onClick={handleTreeClick}
264232
onMouseLeave={onMouseLeave}
265233
onMouseMove={onMouseMove}
266234
onContextMenu={handleContextMenu}>
267-
{showMouseOverTarget && mouseOverTarget && !isDragging &&
235+
{ showMouseOverTarget && mouseOverTarget && !isDragging &&
268236
<Popover id='popover-basic'
269237
placement='top'
270238
ref={ref}
@@ -277,22 +245,19 @@ export const FlatTree = (props: FlatTreeProps) => {
277245
minWidth: 'fit-content'
278246
}
279247
}>
280-
<Popover.Content
281-
className='text-wrap p-1 px-2 bg-secondary w-100'
282-
>
248+
<Popover.Content className='text-wrap p-1 px-2 bg-secondary w-100'>
283249
{mouseOverTarget && mouseOverTarget.path}
284250
</Popover.Content>
285251
</Popover>
286252
}
287253
<Virtuoso
288254
ref={virtuoso}
289-
style={{ height: `${size}px`, width: '100%' }}
255+
style={{ height: `100%`, width: '100%' }}
290256
totalCount={Object.keys(flatTree).length}
291257
itemContent={index => Row(index)}
292258
/>
293259
</div>
294260
</FlatTreeDrop>
295261
</div>
296262
</>)
297-
298263
}

libs/remix-ws-templates/src/templates/hashchecker/scripts/run_verification.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const logger = {
77
info: (...args) => console.log(...args),
88
debug: (...args) => console.log(...args),
99
error: (...args) => console.error(...args),
10-
}
10+
};
1111

1212
(async () => {
1313
try {
@@ -60,4 +60,4 @@ const logger = {
6060
} catch (e) {
6161
console.error(e.message)
6262
}
63-
})()
63+
})()

0 commit comments

Comments
 (0)