Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Panels #1857

Merged
merged 100 commits into from
Jan 6, 2022
Merged

Panels #1857

Show file tree
Hide file tree
Changes from 93 commits
Commits
Show all changes
100 commits
Select commit Hold shift + click to select a range
3f29281
generating Abstract Panel
davidzagi Nov 22, 2021
d301cc7
update package-lock.json
davidzagi Nov 24, 2021
76441fb
working on mainPanel
davidzagi Nov 25, 2021
6d1d082
resolved build error
davidzagi Nov 27, 2021
b6399b4
updated main panel
davidzagi Nov 27, 2021
ab2da51
update to abstract panel
davidzagi Nov 30, 2021
6a16d5f
refactoring abstract panel
davidzagi Dec 1, 2021
a8bae5c
adding side-panel
davidzagi Dec 6, 2021
41162b0
added iframe height
davidzagi Dec 6, 2021
f3de8c7
panel update
davidzagi Dec 10, 2021
beee7b5
update abstract and side panels
tizah Dec 14, 2021
97c0603
updated sidePanel addView
tizah Dec 17, 2021
68cb1f8
fix_using_abstract_panel
yann300 Dec 20, 2021
7796641
refactor
bunsenstraat Dec 23, 2021
31349c9
fixing panels
bunsenstraat Dec 23, 2021
4c5036d
move stuff
bunsenstraat Dec 23, 2021
775d146
fix keys
bunsenstraat Dec 23, 2021
7687128
single panel
bunsenstraat Dec 23, 2021
7c5aab0
mv & rename
bunsenstraat Dec 25, 2021
f093473
rm main panel
bunsenstraat Dec 25, 2021
27e652d
mv some ids
bunsenstraat Dec 25, 2021
453d449
lint fix
bunsenstraat Dec 25, 2021
3b0f422
Merge branch 'master' of https://github.com/ethereum/remix-project in…
bunsenstraat Dec 25, 2021
1136219
fix lint
bunsenstraat Dec 25, 2021
ef47c24
lint fix
bunsenstraat Dec 25, 2021
b6b88b0
lint
bunsenstraat Dec 25, 2021
18a849c
lint
bunsenstraat Dec 25, 2021
b3aa659
panel
bunsenstraat Dec 25, 2021
01894ab
workspace
bunsenstraat Dec 25, 2021
16efcd3
linting
bunsenstraat Dec 25, 2021
2e81fcd
lint
bunsenstraat Dec 25, 2021
ad0f0b4
layout
bunsenstraat Dec 25, 2021
7bda090
call panel
bunsenstraat Dec 25, 2021
822db21
hidden view
bunsenstraat Dec 25, 2021
9aa5a1a
iframe react
bunsenstraat Dec 26, 2021
2cb8dd8
start main
bunsenstraat Dec 27, 2021
db72867
Merge branch 'master' of https://github.com/ethereum/remix-project in…
bunsenstraat Dec 27, 2021
42c5332
start mainview
bunsenstraat Dec 27, 2021
28cbb9c
rm dep mainview from runtab
bunsenstraat Dec 27, 2021
0ce3a5a
start main
bunsenstraat Dec 28, 2021
0e93d23
Merge branch 'master' of https://github.com/ethereum/remix-project in…
bunsenstraat Dec 28, 2021
c33c528
main view
bunsenstraat Dec 29, 2021
c3efe0b
Merge branch 'master' of https://github.com/ethereum/remix-project in…
bunsenstraat Dec 29, 2021
3ed205d
Merge branch 'master' of https://github.com/ethereum/remix-project in…
bunsenstraat Dec 30, 2021
39fe9bd
fix tabs view
bunsenstraat Dec 30, 2021
e1a5eca
activate filepanel
bunsenstraat Dec 30, 2021
c0a7c9b
filepanel activate
bunsenstraat Dec 30, 2021
88c085d
add dragbar
bunsenstraat Dec 30, 2021
350fac6
add dragbar
bunsenstraat Dec 30, 2021
24ef3e9
show terminal
bunsenstraat Dec 30, 2021
beb7bfb
fake layout fix
bunsenstraat Dec 30, 2021
598bde1
lint
bunsenstraat Dec 30, 2021
f616f99
lint
bunsenstraat Dec 30, 2021
53333ef
linting
bunsenstraat Dec 30, 2021
fb74c09
fix editor test
bunsenstraat Dec 30, 2021
1f17101
smaller terminal
bunsenstraat Dec 30, 2021
ea9adcb
resize terminal
bunsenstraat Dec 30, 2021
641326d
editor fix
bunsenstraat Dec 30, 2021
a4275c8
trying to fix sizes
bunsenstraat Jan 3, 2022
d598bdc
panel resize
bunsenstraat Jan 3, 2022
73149e9
panel resize
bunsenstraat Jan 3, 2022
6f9a6d9
bug fix
bunsenstraat Jan 3, 2022
194a47d
cleanup
bunsenstraat Jan 3, 2022
ce8af16
Merge branch 'master' of https://github.com/ethereum/remix-project in…
bunsenstraat Jan 3, 2022
37bc726
ff size
bunsenstraat Jan 3, 2022
9597891
merge
bunsenstraat Jan 3, 2022
d4bdca5
maximize browser e2e
yann300 Jan 3, 2022
9f2e37e
minimize terminal
bunsenstraat Jan 3, 2022
badeda0
Merge branch 'panels' of https://github.com/ethereum/remix-project in…
bunsenstraat Jan 3, 2022
de07999
rm console
bunsenstraat Jan 3, 2022
819ec99
Merge branch 'master' into panels
bunsenstraat Jan 3, 2022
9b56fc5
fix firefox options
yann300 Jan 3, 2022
e589c17
remove uneeded param
yann300 Jan 3, 2022
7f48128
fix typo
yann300 Jan 3, 2022
4e6363a
Update nightwatch.ts
bunsenstraat Jan 3, 2022
84ac83a
react to minimize
bunsenstraat Jan 3, 2022
37490fa
Merge branch 'panels' of https://github.com/ethereum/remix-project in…
bunsenstraat Jan 3, 2022
4497052
termin height
bunsenstraat Jan 4, 2022
4b2a115
rm iframereact
bunsenstraat Jan 4, 2022
5768be0
no ff headless
bunsenstraat Jan 4, 2022
13bffe1
ff headless
bunsenstraat Jan 4, 2022
812728c
rm logs
bunsenstraat Jan 4, 2022
824b97b
add event
bunsenstraat Jan 4, 2022
6466352
Delete main-view.js
bunsenstraat Jan 4, 2022
ffa7f11
Update app.js
bunsenstraat Jan 4, 2022
93a3a41
Update app.js
bunsenstraat Jan 4, 2022
66a2a38
minin sidepanel embed
bunsenstraat Jan 4, 2022
4d8a599
Merge branch 'master' of https://github.com/ethereum/remix-project in…
bunsenstraat Jan 4, 2022
334f70f
merging
bunsenstraat Jan 4, 2022
b76e2aa
fix keys
bunsenstraat Jan 4, 2022
671a70c
add key
bunsenstraat Jan 4, 2022
4dba176
listen on network
bunsenstraat Jan 4, 2022
f6ba78f
rm comment
bunsenstraat Jan 4, 2022
6a1ebeb
Update layout.ts
bunsenstraat Jan 5, 2022
75faf2e
Merge branch 'master' into panels
bunsenstraat Jan 5, 2022
bc7aa54
Merge branch 'master' into panels
bunsenstraat Jan 6, 2022
cd0a26d
Merge branch 'master' into panels
bunsenstraat Jan 6, 2022
577eab0
Merge branch 'master' into panels
bunsenstraat Jan 6, 2022
01c3c7d
Merge branch 'master' of https://github.com/ethereum/remix-project in…
bunsenstraat Jan 6, 2022
8afff38
lint
bunsenstraat Jan 6, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions apps/remix-ide-e2e/nightwatch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,13 @@ module.exports = {
desiredCapabilities: {
browserName: 'firefox',
javascriptEnabled: true,
acceptSslCerts: true
acceptSslCerts: true,
'moz:firefoxOptions': {
args: [
'-width=2560',
'-height=1440'
]
}
}
},

Expand All @@ -78,7 +84,11 @@ module.exports = {
javascriptEnabled: true,
acceptSslCerts: true,
'moz:firefoxOptions': {
args: ['-headless']
args: [
'-headless',
'-width=2560',
'-height=1440'
]
}
}
}
Expand Down
1 change: 1 addition & 0 deletions apps/remix-ide-e2e/src/helpers/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export default function (browser: NightwatchBrowser, callback: VoidFunction, url
.switchBrowserTab(0)
.waitForElementVisible('[id="remixTourSkipbtn"]')
.click('[id="remixTourSkipbtn"]')
.maximizeWindow()
.fullscreenWindow(() => {
if (preloadPlugins) {
initModules(browser, () => {
Expand Down
193 changes: 129 additions & 64 deletions apps/remix-ide/src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import { RunTab, makeUdapp } from './app/udapp'
import { RemixEngine } from './remixEngine'
import { RemixAppManager } from './remixAppManager'
import { MainView } from './app/panels/main-view'
import { ThemeModule } from './app/tabs/theme-module'
import { NetworkModule } from './app/tabs/network-module'
import { Web3ProviderModule } from './app/tabs/web3-provider'
Expand All @@ -11,16 +10,22 @@ import { HiddenPanel } from './app/components/hidden-panel'
import { VerticalIcons } from './app/components/vertical-icons'
import { LandingPage } from './app/ui/landing-page/landing-page'
import { MainPanel } from './app/components/main-panel'
import { FramingService } from './framingService'
import { ModalPluginTester } from './app/plugins/test'

import { WalkthroughService } from './walkthroughService'

import { OffsetToLineColumnConverter, CompilerMetadata, CompilerArtefacts, FetchAndCompile, CompilerImports, EditorContextListener } from '@remix-project/core-plugin'
import {
OffsetToLineColumnConverter,
CompilerMetadata,
CompilerArtefacts,
FetchAndCompile,
CompilerImports,
EditorContextListener
} from '@remix-project/core-plugin'

import migrateFileSystem from './migrateFileSystem'
import Registry from './app/state/registry'
import { ConfigPlugin } from './app/plugins/config'
import { Layout } from './app/panels/layout'
import { ModalPlugin } from './app/plugins/modal'

const isElectron = require('is-electron')
Expand Down Expand Up @@ -51,6 +56,7 @@ const TestTab = require('./app/tabs/test-tab')
const FilePanel = require('./app/panels/file-panel')
const Editor = require('./app/editor/editor')
const Terminal = require('./app/panels/terminal')
const { TabProxy } = require('./app/panels/tab-proxy.js')

class AppComponent {
constructor () {
Expand All @@ -68,13 +74,27 @@ class AppComponent {
// load file system
self._components.filesProviders = {}
self._components.filesProviders.browser = new FileProvider('browser')
Registry.getInstance().put({ api: self._components.filesProviders.browser, name: 'fileproviders/browser' })
self._components.filesProviders.localhost = new RemixDProvider(self.appManager)
Registry.getInstance().put({ api: self._components.filesProviders.localhost, name: 'fileproviders/localhost' })
Registry.getInstance().put({
api: self._components.filesProviders.browser,
name: 'fileproviders/browser'
})
self._components.filesProviders.localhost = new RemixDProvider(
self.appManager
)
Registry.getInstance().put({
api: self._components.filesProviders.localhost,
name: 'fileproviders/localhost'
})
self._components.filesProviders.workspace = new WorkspaceFileProvider()
Registry.getInstance().put({ api: self._components.filesProviders.workspace, name: 'fileproviders/workspace' })
Registry.getInstance().put({
api: self._components.filesProviders.workspace,
name: 'fileproviders/workspace'
})

Registry.getInstance().put({ api: self._components.filesProviders, name: 'fileproviders' })
Registry.getInstance().put({
api: self._components.filesProviders,
name: 'fileproviders'
})

migrateFileSystem(self._components.filesProviders.browser)
}
Expand All @@ -84,6 +104,7 @@ class AppComponent {
// APP_MANAGER
const appManager = self.appManager
const pluginLoader = self.appManager.pluginLoader
self.panels = {}
self.workspace = pluginLoader.get()
self.engine = new RemixEngine()
self.engine.register(appManager)
Expand All @@ -93,8 +114,15 @@ class AppComponent {
'remix-beta.ethereum.org': 25,
'remix.ethereum.org': 23
}
self.showMatamo = (matomoDomains[window.location.hostname] && !Registry.getInstance().get('config').api.exists('settings/matomo-analytics'))
self.walkthroughService = new WalkthroughService(appManager, self.showMatamo)
self.showMatamo =
matomoDomains[window.location.hostname] &&
!Registry.getInstance()
.get('config')
.api.exists('settings/matomo-analytics')
self.walkthroughService = new WalkthroughService(
appManager,
self.showMatamo
)

const hosts = ['127.0.0.1:8080', '192.168.0.101:8080', 'localhost:8080']
// workaround for Electron support
Expand All @@ -113,7 +141,9 @@ class AppComponent {
// ----------------- editor service ----------------------------
const editor = new Editor() // wrapper around ace editor
Registry.getInstance().put({ api: editor, name: 'editor' })
editor.event.register('requiringToSaveCurrentfile', () => fileManager.saveCurrentFile())
editor.event.register('requiringToSaveCurrentfile', () =>
fileManager.saveCurrentFile()
)

// ----------------- fileManager service ----------------------------
const fileManager = new FileManager(editor, appManager)
Expand All @@ -130,7 +160,10 @@ class AppComponent {
const compilerMetadataGenerator = new CompilerMetadata()
// ----------------- compilation result service (can keep track of compilation results) ----------------------------
const compilersArtefacts = new CompilerArtefacts() // store all the compilation results (key represent a compiler name)
Registry.getInstance().put({ api: compilersArtefacts, name: 'compilersartefacts' })
Registry.getInstance().put({
api: compilersArtefacts,
name: 'compilersartefacts'
})

// service which fetch contract artifacts from sourve-verify, put artifacts in remix and compile it
const fetchAndCompile = new FetchAndCompile()
Expand All @@ -141,19 +174,22 @@ class AppComponent {
const hardhatProvider = new HardhatProvider(blockchain)
// ----------------- convert offset to line/column service -----------
const offsetToLineColumnConverter = new OffsetToLineColumnConverter()
Registry.getInstance().put({ api: offsetToLineColumnConverter, name: 'offsettolinecolumnconverter' })
Registry.getInstance().put({
api: offsetToLineColumnConverter,
name: 'offsettolinecolumnconverter'
})

// -------------------Terminal----------------------------------------
makeUdapp(blockchain, compilersArtefacts, (domEl) => terminal.logHtml(domEl))
makeUdapp(blockchain, compilersArtefacts, domEl => terminal.logHtml(domEl))
const terminal = new Terminal(
{ appManager, blockchain },
{
getPosition: (event) => {
getPosition: event => {
const limitUp = 36
const limitDown = 20
const height = window.innerHeight
let newpos = (event.pageY < limitUp) ? limitUp : event.pageY
newpos = (newpos < height - limitDown) ? newpos : height - limitDown
let newpos = event.pageY < limitUp ? limitUp : event.pageY
newpos = newpos < height - limitDown ? newpos : height - limitDown
return height - newpos
}
}
Expand All @@ -163,8 +199,10 @@ class AppComponent {
self.modal = new ModalPlugin()

const configPlugin = new ConfigPlugin()
self.layout = new Layout()

self.engine.register([
self.layout,
self.modal,
configPlugin,
blockchain,
Expand All @@ -187,22 +225,27 @@ class AppComponent {

// LAYOUT & SYSTEM VIEWS
const appPanel = new MainPanel()
self.mainview = new MainView(contextualListener, editor, appPanel, fileManager, appManager, terminal)
Registry.getInstance().put({ api: self.mainview, name: 'mainview' })
bunsenstraat marked this conversation as resolved.
Show resolved Hide resolved

self.engine.register([
appPanel,
self.mainview.tabProxy
])
const tabProxy = new TabProxy(fileManager, editor)
self.engine.register([appPanel, tabProxy])

// those views depend on app_manager
self.menuicons = new VerticalIcons(appManager)
self.sidePanel = new SidePanel(appManager, self.menuicons)
self.hiddenPanel = new HiddenPanel()

const pluginManagerComponent = new PluginManagerComponent(appManager, self.engine)
const pluginManagerComponent = new PluginManagerComponent(
appManager,
self.engine
)
const filePanel = new FilePanel(appManager)
const landingPage = new LandingPage(appManager, self.menuicons, fileManager, filePanel, contentImport)
const landingPage = new LandingPage(
appManager,
self.menuicons,
fileManager,
filePanel,
contentImport
)
self.settings = new SettingsTab(
Registry.getInstance().get('config').api,
editor,
Expand All @@ -220,7 +263,10 @@ class AppComponent {
])

// CONTENT VIEWS & DEFAULT PLUGINS
const compileTab = new CompileTab(Registry.getInstance().get('config').api, Registry.getInstance().get('filemanager').api)
const compileTab = new CompileTab(
Registry.getInstance().get('config').api,
Registry.getInstance().get('filemanager').api
)
const run = new RunTab(
blockchain,
Registry.getInstance().get('config').api,
Expand All @@ -229,7 +275,6 @@ class AppComponent {
filePanel,
Registry.getInstance().get('compilersartefacts').api,
networkModule,
self.mainview,
Registry.getInstance().get('fileproviders/browser').api
)
const analysis = new AnalysisTab()
Expand All @@ -243,9 +288,7 @@ class AppComponent {
contentImport
)

const testplugin = new ModalPluginTester()
self.engine.register([
testplugin,
compileTab,
run,
debug,
Expand All @@ -256,6 +299,13 @@ class AppComponent {
filePanel.hardhatHandle,
filePanel.slitherHandle
])

self.layout.panels = {
tabs: { plugin: tabProxy, active: true },
editor: { plugin: editor, active: true },
main: { plugin: appPanel, active: false },
terminal: { plugin: terminal, active: true, minimized: false }
}
}

async activate () {
Expand All @@ -270,63 +320,78 @@ class AppComponent {
try {
self.engine.register(await self.appManager.registeredPlugins())
} catch (e) {
console.log('couldn\'t register iframe plugins', e.message)
console.log("couldn't register iframe plugins", e.message)
}

await self.appManager.activatePlugin(['layout'])
await self.appManager.activatePlugin(['modal'])
await self.appManager.activatePlugin(['editor'])
await self.appManager.activatePlugin(['theme', 'fileManager', 'compilerMetadata', 'compilerArtefacts', 'network', 'web3Provider', 'offsetToLineColumnConverter'])
await self.appManager.activatePlugin(['mainPanel', 'menuicons', 'tabs'])
bunsenstraat marked this conversation as resolved.
Show resolved Hide resolved
await self.appManager.activatePlugin(['sidePanel']) // activating host plugin separately
await self.appManager.activatePlugin(['home'])
await self.appManager.activatePlugin(['settings', 'config'])
await self.appManager.activatePlugin(['hiddenPanel', 'pluginManager', 'contextualListener', 'terminal', 'blockchain', 'fetchAndCompile', 'contentImport'])
await self.appManager.activatePlugin([
'hiddenPanel',
'pluginManager',
'contextualListener',
'terminal',
'blockchain',
'fetchAndCompile',
'contentImport'
])
await self.appManager.activatePlugin(['settings'])
await self.appManager.activatePlugin(['walkthrough'])
await self.appManager.activatePlugin(['testerplugin'])

self.appManager.on('filePanel', 'workspaceInitializationCompleted', async () => {
await self.appManager.registerContextMenuItems()
})
self.appManager.on(
'filePanel',
'workspaceInitializationCompleted',
async () => {
await self.appManager.registerContextMenuItems()
}
)

await self.appManager.activatePlugin(['filePanel'])
// Set workspace after initial activation
self.appManager.on('editor', 'editorMounted', () => {
if (Array.isArray(self.workspace)) {
self.appManager.activatePlugin(self.workspace).then(async () => {
try {
if (params.deactivate) {
await self.appManager.deactivatePlugin(params.deactivate.split(','))
self.appManager
.activatePlugin(self.workspace)
.then(async () => {
try {
if (params.deactivate) {
await self.appManager.deactivatePlugin(
params.deactivate.split(',')
)
}
} catch (e) {
console.log(e)
}
if (params.code) {
// if code is given in url we focus on solidity plugin
self.menuicons.select('solidity')
} else {
// If plugins are loaded from the URL params, we focus on the last one.
if (
self.appManager.pluginLoader.current === 'queryParams' &&
self.workspace.length > 0
) { self.menuicons.select(self.workspace[self.workspace.length - 1]) }
}
} catch (e) {
console.log(e)
}
if (params.code) {
// if code is given in url we focus on solidity plugin
self.menuicons.select('solidity')
} else {
// If plugins are loaded from the URL params, we focus on the last one.
if (self.appManager.pluginLoader.current === 'queryParams' && self.workspace.length > 0) self.menuicons.select(self.workspace[self.workspace.length - 1])
}

if (params.call) {
const callDetails = params.call.split('//')
if (callDetails.length > 1) {
toolTip(`initiating ${callDetails[0]} ...`)
// @todo(remove the timeout when activatePlugin is on 0.3.0)
self.appManager.call(...callDetails).catch(console.error)

if (params.call) {
const callDetails = params.call.split('//')
if (callDetails.length > 1) {
toolTip(`initiating ${callDetails[0]} ...`)
// @todo(remove the timeout when activatePlugin is on 0.3.0)
self.appManager.call(...callDetails).catch(console.error)
}
}
}
}).catch(console.error)
})
.catch(console.error)
}
})
// activate solidity plugin
self.appManager.activatePlugin(['solidity', 'udapp'])
// Load and start the service who manager layout and frame
const framingService = new FramingService(self.sidePanel, self.menuicons, self.mainview, null)

if (params.embed) framingService.embed()
framingService.start(params)
}
}

Expand Down
Loading