Skip to content

Commit 08eedc6

Browse files
authored
Merge pull request #6140 from ethereum/hometab
New HomeTab Design
2 parents 57b0705 + 84e6717 commit 08eedc6

25 files changed

+778
-1198
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ module.exports = {
99

1010
'Should display settings menu ': function (browser: NightwatchBrowser) {
1111
browser.waitForElementVisible('*[data-id="remixIdeIconPanel"]', 10000)
12-
.click('*[data-id="landingPageStartSolidity"]')
13-
.waitForElementVisible('*[data-id="verticalIconsKindsettings"]', 5000)
12+
.waitForElementVisible('*[data-id="verticalIconsKindsettings"]')
1413
.click('*[data-id="verticalIconsKindsettings"]')
1514
.waitForElementContainsText('h6[data-id="sidePanelSwapitTitle"]', 'SETTINGS')
1615
},

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ module.exports = {
6969
*/
7070
},
7171

72-
'Load Gist Modal #group1': function (browser: NightwatchBrowser) {
72+
'Load Gist Modal #group1': '' + function (browser: NightwatchBrowser) {
7373
browser.clickLaunchIcon('home')
7474
.waitForElementVisible('*[data-id="remixIdeIconPanel"]', 10000)
7575
.clickLaunchIcon('filePanel')
@@ -85,7 +85,7 @@ module.exports = {
8585
.modalFooterCancelClick('gisthandler')
8686
},
8787

88-
'Display Error Message For Invalid Gist ID #group1': function (browser: NightwatchBrowser) {
88+
'Display Error Message For Invalid Gist ID #group1': '' + function (browser: NightwatchBrowser) {
8989
browser
9090
.pause(1000)
9191
.waitForElementVisible('*[data-id="remixIdeIconPanel"]', 10000)
@@ -126,7 +126,7 @@ module.exports = {
126126
.click('[data-id="fileSystemModalDialogModalFooter-react"] .modal-ok')
127127
},
128128

129-
'Import From Gist For Valid Gist ID #group2': function (browser: NightwatchBrowser) {
129+
'Import From Gist For Valid Gist ID #group2': '' + function (browser: NightwatchBrowser) {
130130
browser
131131
.waitForElementVisible('*[data-id="remixIdeIconPanel"]', 15000)
132132
.clickLaunchIcon('settings')

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module.exports = {
88
init(browser, done)
99
},
1010

11-
'Should start coding #group1': function (browser: NightwatchBrowser) {
11+
'Should start coding #group1': '' + function (browser: NightwatchBrowser) {
1212
browser
1313
.waitForElementVisible('*[data-id="homeTabGetStartedremixDefault"]')
1414
.click('*[data-id="homeTabGetStartedremixDefault"]')
@@ -25,7 +25,7 @@ module.exports = {
2525
})
2626
},
2727

28-
'Should start with ERC20 workspace #group1': function (browser: NightwatchBrowser) {
28+
'Should start with ERC20 workspace #group1': '' + function (browser: NightwatchBrowser) {
2929
browser
3030
.click('*[data-path="home"')
3131
.waitForElementVisible('*[data-id="homeTabGetStartedozerc20"]')

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ module.exports = {
1919
.waitForElementVisible('*[data-id="remixIdeIconPanel"]', 10000)
2020
.clickLaunchIcon('filePanel')
2121
.click('div[data-id="verticalIconsHomeIcon"]')
22-
.waitForElementVisible('button[data-id="landingPageImportFromGitHubButton"]')
2322
.pause(1000)
24-
.click('button[data-id="landingPageImportFromGitHubButton"]')
23+
.click('*[data-id="workspacesMenuDropdown"]')
24+
.click('*[data-id="workspaceclone"]')
2525
.waitForElementVisible('*[data-id="fileSystemModalDialogModalTitle-react"]')
2626
.assert.containsText('*[data-id="fileSystemModalDialogModalTitle-react"]', 'Clone Git Repository')
2727
.waitForElementVisible('*[data-id="fileSystemModalDialogModalBody-react"]')
@@ -45,8 +45,9 @@ module.exports = {
4545
.waitForElementVisible('*[data-id="remixIdeIconPanel"]', 10000)
4646
.clickLaunchIcon('filePanel')
4747
.click('div[data-id="verticalIconsHomeIcon"]')
48-
.waitForElementVisible('button[data-id="landingPageImportFromGitHubButton"]').pause(1000)
49-
.click('button[data-id="landingPageImportFromGitHubButton"]')
48+
.pause(1000)
49+
.click('*[data-id="workspacesMenuDropdown"]')
50+
.click('*[data-id="workspaceclone"]')
5051
.waitForElementVisible('input[data-id="modalDialogCustomPromptTextClone"]')
5152
.execute(() => {
5253
(document.querySelector('input[data-id="modalDialogCustomPromptTextClone"]') as any).focus()

apps/remix-ide/src/app/components/vertical-icons.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ const profile = {
1212
displayName: 'Vertical Icons',
1313
description: 'Remix IDE vertical icons',
1414
version: packageJson.version,
15-
methods: ['select', 'unlinkContent', 'linkContent'],
15+
methods: ['select', 'unlinkContent', 'linkContent', 'activateAndSelect'],
1616
events: ['toggleContent', 'showContent']
1717
}
1818

@@ -128,6 +128,15 @@ export class VerticalIcons extends Plugin {
128128
this.events.emit('showContent', name)
129129
}
130130

131+
async activateAndSelect(name: string) {
132+
const isActive = await this.call('manager', 'isActive', name)
133+
134+
if (!isActive) {
135+
await this.call('manager', 'activatePlugin', name)
136+
}
137+
this.select(name)
138+
}
139+
131140
/**
132141
* Toggles the side panel for plugin
133142
* @param {string} name Name of profile of the module to activate

apps/remix-ide/src/app/panels/file-panel.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -213,15 +213,13 @@ export default class Filepanel extends ViewPlugin {
213213
saveRecent(workspaceName) {
214214
if (workspaceName === 'code-sample') return
215215
if (!localStorage.getItem('recentWorkspaces')) {
216-
localStorage.setItem('recentWorkspaces', JSON.stringify([ workspaceName ]))
216+
localStorage.setItem('recentWorkspaces', JSON.stringify([ { name: workspaceName, timestamp: Date.now() } ]))
217217
} else {
218218
let recents = JSON.parse(localStorage.getItem('recentWorkspaces'))
219219
// checking if we have a duplication
220-
if (!recents.find((el) => {
221-
return el === workspaceName
222-
})) {
223-
recents = ([workspaceName, ...recents])
224-
recents = recents.filter((el) => { return el != "" })
220+
if (!recents.find((el) => typeof el === 'string' ? el === workspaceName : el.name === workspaceName)) {
221+
recents = ([{ name: workspaceName, timestamp: Date.now() }, ...recents])
222+
recents = recents.filter((el) => typeof el === 'string' ? el !== '' : el.name !== '')
225223
localStorage.setItem('recentWorkspaces', JSON.stringify(recents))
226224
}
227225
}

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@
3030
"home.dgitPluginDesc": "Add source control to your projects.",
3131
"home.oneClickDappDesc": "Quickly generate smart contract interfaces",
3232
"home.getStarted": "Get Started",
33-
"home.projectTemplates": "Explore. Prototype. Create.",
33+
"home.projectTemplates": "Learn. Explore.",
34+
"home.projectTemplates2": "Create.",
3435
"home.blankTemplateDesc": "Create an empty workspace.",
3536
"home.remixDefaultTemplateDesc": "Create a workspace with sample files.",
3637
"home.ozerc20TemplateDesc": "Create an ERC20 token by importing OpenZeppelin library.",
@@ -68,9 +69,12 @@
6869
"home.resources": "Resources",
6970
"home.connectToLocalhost": "Connect to Localhost",
7071
"home.seeAllTutorials": "See all tutorials",
71-
"home.maintainedByRemix": "Maintained by Remix",
72+
"home.maintainedBy": "Maintained by",
7273
"home.gitCloneTooltip": "Clone a Github repo to a new workspace",
7374
"home.gistTooltip": "Open Gist repo",
74-
"home.newFileTooltip": "Add a new file to a workspace"
75+
"home.newFileTooltip": "Add a new file to a workspace",
76+
"home.createNewWorkspace": "Create a new workspace",
77+
"home.startLearning": "Start Learning",
78+
"home.exploreAllPlugins": "Explore all plugins"
7579
}
7680

apps/remix-ide/src/assets/css/themes/remix-unicorn.css

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9529,9 +9529,6 @@ a.text-dark:focus {
95299529
border-image-slice: 1;
95309530
border-image-outset: 2px;
95319531
}
9532-
.custom_home_bg {
9533-
background: linear-gradient(45deg, #ff00004d, #fca80f3b, #ffff004a, #00800033, #0000ff29, #4b00822e, #ee82ee4a, #ff000057);
9534-
}
95359532

95369533
.plugins-list-header {
95379534
background: transparent !important;

0 commit comments

Comments
 (0)