Skip to content

Commit a9b45cf

Browse files
authored
Merge branch 'master' into fix-bottom-bar
2 parents 4dc300b + 2a5985f commit a9b45cf

File tree

18 files changed

+72
-33
lines changed

18 files changed

+72
-33
lines changed

apps/learneth/src/pages/Home/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ function HomePage(): JSX.Element {
5151
}}
5252
>
5353
{selectedRepo.entities[item.id].name}
54+
{selectedRepo.entities[item.id].metadata.data.error? <p className="text-danger">{selectedRepo.entities[item.id].metadata.data.error} in {selectedRepo.entities[item.id].metadata.file}</p> : null}
5455
</span>
5556
<Link onClick={() => (window as any)._paq.push(['trackEvent', 'learneth', 'start_workshop', selectedRepo.entities[item.id].name])} to={`/list?id=${item.id}`} className="text-decoration-none float-end">
5657
<i className="fas fa-play-circle fa-lg" />

apps/learneth/src/redux/models/workshop.ts

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,56 @@ const Model: ModelType = {
5151
const { list, detail } = yield select((state) => state.workshop)
5252

5353
const url = `${apiUrl}/clone/${encodeURIComponent(payload.name)}/${payload.branch}?${Math.random()}`
54-
const { data } = yield axios.get(url)
54+
55+
let data
56+
try {
57+
const response = yield axios.get(url)
58+
data = response.data
59+
} catch (error) {
60+
console.error('Failed to load workshop:', error)
61+
62+
// Dismiss loading toast and show error
63+
toast.dismiss()
64+
65+
// Extract detailed error message from response
66+
let errorMessage = 'Failed to load workshop'
67+
if (error.response?.data) {
68+
// If the response contains plain text error details (like in the screenshot)
69+
if (typeof error.response.data === 'string') {
70+
errorMessage = error.response.data
71+
}
72+
// If the response has a structured error message
73+
else if (error.response.data.message) {
74+
errorMessage = error.response.data.message
75+
}
76+
// If the response has error details
77+
else if (error.response.data.error) {
78+
errorMessage = error.response.data.error
79+
}
80+
}
81+
// Fallback to axios error message or generic error
82+
else if (error.message) {
83+
errorMessage = error.message
84+
} else {
85+
errorMessage = 'Network error occurred'
86+
}
87+
88+
toast.error(errorMessage)
89+
90+
// Clean up loading state
91+
yield put({
92+
type: 'loading/save',
93+
payload: {
94+
screen: false,
95+
},
96+
})
97+
98+
// Track error event
99+
;(<any>window)._paq?.push(['trackEvent', 'learneth', 'load_repo_error', `${payload.name}/${payload.branch}`])
100+
101+
return // Exit early on error
102+
}
103+
55104
const repoId = `${payload.name}-${payload.branch}`
56105

57106
for (let i = 0; i < data.ids.length; i++) {

apps/remix-ide-e2e/src/tests/circom.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ module.exports = {
5757
.click('[data-id="compute_witness_btn"]')
5858
.frameParent()
5959
.clickLaunchIcon('filePanel')
60+
.pause(5000)
6061
.openFile('circuits/.bin/simple_js/simple.wtn')
6162
.waitForElementPresent('[data-id="treeViewLitreeViewItemcircuits/.bin/simple_js/simple.wtn"]')
6263
.waitForElementVisible('[data-id="treeViewLitreeViewItemcircuits/.bin/simple_js/simple.wtn"]')

apps/remix-ide-e2e/src/tests/contract_flattener.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ module.exports = {
1919
},
2020
'Should not be able to flatten contract without imports': function (browser: NightwatchBrowser) {
2121
browser.waitForElementVisible('*[data-id="treeViewLitreeViewItemcontracts"]')
22+
.openFile('contracts')
2223
.waitForElementVisible('*[data-id="treeViewLitreeViewItemcontracts/3_Ballot.sol"]')
2324
.pause(1000)
2425
.click('*[data-id="treeViewLitreeViewItemcontracts/3_Ballot.sol"]')

apps/remix-ide-e2e/src/tests/file_explorer_multiselect.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ module.exports = {
1111
const selectedElements = []
1212
browser
1313
.openFile('contracts')
14-
.click('*[data-id="treeViewDivtreeViewItemcontracts"]')
1514
.click({ selector: '//*[@data-id="treeViewDivtreeViewItemcontracts/1_Storage.sol"]', locateStrategy: 'xpath' })
1615
.findElement({ selector: '//*[@data-id="treeViewDivtreeViewItemcontracts/2_Owner.sol"]', locateStrategy: 'xpath' }, (el) => {
1716
selectedElements.push(el)

apps/remix-ide-e2e/src/tests/pinned_contracts.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ module.exports = {
1717
browser
1818
.clickLaunchIcon('filePanel')
1919
.waitForElementVisible('*[data-id="treeViewLitreeViewItemcontracts"]')
20-
// .click('*[data-id="treeViewLitreeViewItemcontracts"]')
20+
.click('*[data-id="treeViewLitreeViewItemcontracts"]')
2121
.click('*[data-id="treeViewLitreeViewItemcontracts/1_Storage.sol"]')
2222
.waitForElementVisible('*[data-id="compile-action"]')
2323
.pause(3000)

apps/remix-ide-e2e/src/tests/script-runner.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ const tests = {
2020
browser
2121
.waitForElementVisible('*[data-id="verticalIconsKindfilePanel"]')
2222
.click('*[data-id="verticalIconsKindfilePanel"]')
23+
.openFile('scripts/deploy_with_ethers.ts')
2324
.waitForElementVisible('*[data-id="treeViewDivtreeViewItemscripts/deploy_with_ethers.ts"]')
2425
// .click('*[data-id="treeViewDivtreeViewItemscripts"]')
2526
// .pause(3000)

apps/remix-ide-e2e/src/tests/staticAnalysis.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ module.exports = {
3535
browser
3636
.clickLaunchIcon('filePanel')
3737
.waitForElementVisible('*[data-id="treeViewLitreeViewItemcontracts"]')
38+
.openFile('contracts')
3839
.click('*[data-id="treeViewLitreeViewItemcontracts/2_Owner.sol"]')
3940
.clickLaunchIcon('solidity')
4041
.click('*[id="compileBtn"]')

apps/remix-ide/src/app/components/bottom-bar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export const BottomBar = ({ plugin }: BottomBarProps) => {
6767
await plugin.call('menuicons', 'select', 'remixaiassistant')
6868
await new Promise((resolve) => setTimeout(resolve, 500))
6969
const content = await plugin.call('fileManager', 'readFile', currentFilePath)
70-
await plugin.call('remixAI', 'chatPipe', 'code_explaining', content)
70+
await plugin.call('remixAI', 'chatPipe', 'code_explaining', content + "\n\nExplain briefly the snipped above!")
7171
} catch (err) {
7272
console.error('Explain failed:', err)
7373
}

apps/remix-ide/src/app/tabs/locales/en/editor.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"editor.explainFunction2": "Explain the function \"{name}\"",
2828
"editor.explainFunctionByAI": "```\n{content}\n```\nExplain the function {currentFunction}",
2929
"editor.explainFunctionByAISol": "```\n{content}\n```\nExplain the function {currentFunction}",
30-
"editor.ExplainPipeMessage": "```\n {content}\n```\nExplain the snipped above",
30+
"editor.ExplainPipeMessage": "```\n {content}\n```\nExplain briefly the snipped above",
3131
"editor.PastedCodeSafety": "```\n {content}\n```\n\nReply in a short manner: Does this code contain major security vulnerabilities leading to a scam or loss of funds?",
3232
"editor.executeFreeFunction": "Run a free function",
3333
"editor.executeFreeFunction2": "Run the free function \"{name}\"",

0 commit comments

Comments
 (0)