From 0e0f9f3cea80996513158d13a9f209f1114a9874 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Tue, 2 Jul 2024 08:59:03 +0200 Subject: [PATCH 01/14] limit desktop to 'desktop' branches --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c8be5e0d7a..d5a065c41d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -499,7 +499,7 @@ workflows: - build-desktop: filters: branches: - only: ['master', /.*desktop.*/] + only: [/.*desktop.*/] - build-remixdesktop-mac: requires: - build-desktop From 1a1e2da8ea026e369dddeb2094647f38bf402b64 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Wed, 3 Jul 2024 08:23:44 +0200 Subject: [PATCH 02/14] fix plugin api & statusbar --- apps/remix-ide/src/app/components/status-bar.tsx | 5 +++-- libs/remix-api/src/lib/plugins/filePanel-api.ts | 12 ++++++++++++ libs/remix-api/src/lib/plugins/fileSystem-api.ts | 2 +- libs/remix-api/src/lib/plugins/settings-api.ts | 2 ++ libs/remix-api/src/lib/remix-api.ts | 3 +++ .../statusbar/src/lib/components/gitStatus.tsx | 4 ++-- .../workspace/src/lib/remix-ui-workspace.tsx | 2 +- 7 files changed, 24 insertions(+), 6 deletions(-) create mode 100644 libs/remix-api/src/lib/plugins/filePanel-api.ts diff --git a/apps/remix-ide/src/app/components/status-bar.tsx b/apps/remix-ide/src/app/components/status-bar.tsx index 088e0b4da1..c264fdd434 100644 --- a/apps/remix-ide/src/app/components/status-bar.tsx +++ b/apps/remix-ide/src/app/components/status-bar.tsx @@ -7,6 +7,7 @@ import { PluginProfile, StatusBarInterface } from '../../types' import { RemixUIStatusBar } from '@remix-ui/statusbar' import { FilePanelType } from '@remix-ui/workspace' import { VerticalIcons } from './vertical-icons' +import { CustomRemixApi } from '@remix-api' const statusBarProfile: PluginProfile = { name: 'statusBar', @@ -16,7 +17,7 @@ const statusBarProfile: PluginProfile = { version: packageJson.version, } -export class StatusBar extends Plugin implements StatusBarInterface { +export class StatusBar extends Plugin implements StatusBarInterface { htmlElement: HTMLDivElement events: EventEmitter filePanelPlugin: FilePanelType @@ -75,7 +76,7 @@ export class StatusBar extends Plugin implements StatusBarInterface { const workspaceName = localStorage.getItem('currentWorkspace') workspaceName && workspaceName.length > 0 ? this.currentWorkspaceName = workspaceName : this.currentWorkspaceName = 'error' }) - this.on('settings', 'copilotChoiceChanged', (isAiActive) => { + this.on('settings', 'copilotChoiceChanged', (isAiActive: boolean) => { this.isAiActive = isAiActive }) this.renderComponent() diff --git a/libs/remix-api/src/lib/plugins/filePanel-api.ts b/libs/remix-api/src/lib/plugins/filePanel-api.ts new file mode 100644 index 0000000000..02255c26ba --- /dev/null +++ b/libs/remix-api/src/lib/plugins/filePanel-api.ts @@ -0,0 +1,12 @@ +import { IFilePanel } from '@remixproject/plugin-api' +import { StatusEvents } from '@remixproject/plugin-utils' + +export interface IFilePanelApi { + events: IFilePanel['events'] & { + workspaceInitializationCompleted: () => void; + switchToWorkspace: (workspace: string) => Promise; + } & StatusEvents + methods: IFilePanel['methods'] & { + + } +} diff --git a/libs/remix-api/src/lib/plugins/fileSystem-api.ts b/libs/remix-api/src/lib/plugins/fileSystem-api.ts index 04d0a2a0af..cba69f007e 100644 --- a/libs/remix-api/src/lib/plugins/fileSystem-api.ts +++ b/libs/remix-api/src/lib/plugins/fileSystem-api.ts @@ -4,7 +4,7 @@ import { IFileSystem } from "@remixproject/plugin-api" // Extended interface with 'diff' method export interface IExtendedFileSystem extends IFileSystem { methods: IFileSystem['methods'] & { - /** Compare the differences between two files */ diff(change: commitChange): Promise + isGitRepo(): Promise }; } \ No newline at end of file diff --git a/libs/remix-api/src/lib/plugins/settings-api.ts b/libs/remix-api/src/lib/plugins/settings-api.ts index dd7323ac73..a9251b3f78 100644 --- a/libs/remix-api/src/lib/plugins/settings-api.ts +++ b/libs/remix-api/src/lib/plugins/settings-api.ts @@ -3,6 +3,8 @@ import { StatusEvents } from '@remixproject/plugin-utils' export interface ISettings { events: { configChanged: () => void, + copilotChoiceUpdated: (isChecked: boolean) => void, + copilotChoiceChanged: (isChecked: boolean) => void, } & StatusEvents methods: { getGithubAccessToken(): string diff --git a/libs/remix-api/src/lib/remix-api.ts b/libs/remix-api/src/lib/remix-api.ts index 8469d9e057..2dff94abdc 100644 --- a/libs/remix-api/src/lib/remix-api.ts +++ b/libs/remix-api/src/lib/remix-api.ts @@ -6,6 +6,8 @@ import { IFileDecoratorApi } from "./plugins/filedecorator-api" import { IExtendedFileSystem } from "./plugins/fileSystem-api" import { INotificationApi } from "./plugins/notification-api" import { ISettings } from "./plugins/settings-api" +import { IFilePanelApi } from "./plugins/filePanel-api" +import { Plugin } from "@remixproject/engine" export interface ICustomRemixApi extends IRemixApi { dgitApi: IGitApi @@ -14,6 +16,7 @@ export interface ICustomRemixApi extends IRemixApi { settings: ISettings fileDecorator: IFileDecoratorApi fileManager: IExtendedFileSystem + filePanel: IFilePanelApi } export declare type CustomRemixApi = Readonly \ No newline at end of file diff --git a/libs/remix-ui/statusbar/src/lib/components/gitStatus.tsx b/libs/remix-ui/statusbar/src/lib/components/gitStatus.tsx index 07c299c132..68201b7c9f 100644 --- a/libs/remix-ui/statusbar/src/lib/components/gitStatus.tsx +++ b/libs/remix-ui/statusbar/src/lib/components/gitStatus.tsx @@ -32,7 +32,7 @@ export default function GitStatus({ plugin, gitBranchName, setGitBranchName }: G setGitBranchName('Not a git repo') } }) - plugin.on('dGitProvider', 'init', async () => { + plugin.on('dgitApi', 'init', async () => { const isGit = await plugin.call('fileManager', 'isGitRepo') if (isGit) { const workspace = localStorage.getItem('currentWorkspace') @@ -52,7 +52,7 @@ export default function GitStatus({ plugin, gitBranchName, setGitBranchName }: G } const initializeNewGitRepo = async () => { - await plugin.call('dGitProvider', 'init') + await plugin.call('dgitApi', 'init') const isActive = await plugin.call('manager', 'isActive', 'dgit') if (isLocalHost === false) { if (!isActive) await plugin.call('manager', 'activatePlugin', 'dgit') diff --git a/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx b/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx index 534bd07481..03d807808a 100644 --- a/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx +++ b/libs/remix-ui/workspace/src/lib/remix-ui-workspace.tsx @@ -257,7 +257,7 @@ export function Workspace() { } } - global.plugin.on('dGitProvider', 'repositoryWithSubmodulesCloned', () => { + global.plugin.on('dgitApi', 'repositoryWithSubmodulesCloned', () => { setHighlightUpdateSubmodules(true) }) }, []) From 82b5baa420986b71535f833971599dbe7e4453b0 Mon Sep 17 00:00:00 2001 From: lianahus Date: Wed, 3 Jul 2024 10:22:48 +0200 Subject: [PATCH 03/14] updated the colors of black theme to fix the status bar colors --- apps/remix-ide/src/assets/css/themes/remix-black_undtds.css | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/remix-ide/src/assets/css/themes/remix-black_undtds.css b/apps/remix-ide/src/assets/css/themes/remix-black_undtds.css index 75d64e2ed1..990598205f 100644 --- a/apps/remix-ide/src/assets/css/themes/remix-black_undtds.css +++ b/apps/remix-ide/src/assets/css/themes/remix-black_undtds.css @@ -11,10 +11,10 @@ --green: #1ea171; --teal: #20c997; --cyan: #053c64; - --white: #d5d5d5; + --white: #ececec; --gray: #868e96; --gray-dark: #343a40; - --primary: #b5b4bc; + --primary: #717171; --secondary: #3d3e44; --success: #6bceaa; --info: #086CB5; @@ -241,7 +241,7 @@ textarea { font-size: inherit; line-height: inherit; background-color: #2b2b2b; - color: #d5d5d5d5d5d5; + color: #d5d5d5; box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 0 2px rgba(79, 86, 89, 0.25); } button, From 35af3b6431ffb420da9a5bd06b0171dc1a768189 Mon Sep 17 00:00:00 2001 From: lianahus Date: Wed, 3 Jul 2024 10:35:13 +0200 Subject: [PATCH 04/14] color fixes in status bar --- apps/remix-ide/src/assets/css/themes/remix-black_undtds.css | 4 ++-- libs/remix-ui/statusbar/src/css/statusbar.css | 2 +- libs/remix-ui/statusbar/src/lib/remixui-statusbar-panel.tsx | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/remix-ide/src/assets/css/themes/remix-black_undtds.css b/apps/remix-ide/src/assets/css/themes/remix-black_undtds.css index 990598205f..a55010caa0 100644 --- a/apps/remix-ide/src/assets/css/themes/remix-black_undtds.css +++ b/apps/remix-ide/src/assets/css/themes/remix-black_undtds.css @@ -11,10 +11,10 @@ --green: #1ea171; --teal: #20c997; --cyan: #053c64; - --white: #ececec; + --white: #d5d5d5; --gray: #868e96; --gray-dark: #343a40; - --primary: #717171; + --primary: #b5b4bc; --secondary: #3d3e44; --success: #6bceaa; --info: #086CB5; diff --git a/libs/remix-ui/statusbar/src/css/statusbar.css b/libs/remix-ui/statusbar/src/css/statusbar.css index 5d2f461026..a66bd945e1 100644 --- a/libs/remix-ui/statusbar/src/css/statusbar.css +++ b/libs/remix-ui/statusbar/src/css/statusbar.css @@ -18,7 +18,7 @@ * approximately same height with vscode statusbar **/ .remixui_statusbar_height { - height: 21px; + height: 1.6rem; } .remixui_statusbar_activelink { diff --git a/libs/remix-ui/statusbar/src/lib/remixui-statusbar-panel.tsx b/libs/remix-ui/statusbar/src/lib/remixui-statusbar-panel.tsx index 77e8f3cc50..679a5e0b65 100644 --- a/libs/remix-ui/statusbar/src/lib/remixui-statusbar-panel.tsx +++ b/libs/remix-ui/statusbar/src/lib/remixui-statusbar-panel.tsx @@ -71,7 +71,7 @@ export function RemixUIStatusBar({ statusBarPlugin }: RemixUIStatusBarProps) { )} -
+
From fff0d4d61009bbd8c117426f453acb95fee8bf39 Mon Sep 17 00:00:00 2001 From: lianahus Date: Wed, 3 Jul 2024 10:45:34 +0200 Subject: [PATCH 05/14] status bar hierarchy change --- .../assets/css/themes/remix-dark_tvx1s2.css | 2 +- .../app/src/lib/remix-app/remix-app.tsx | 76 ++++++++++--------- 2 files changed, 40 insertions(+), 38 deletions(-) diff --git a/apps/remix-ide/src/assets/css/themes/remix-dark_tvx1s2.css b/apps/remix-ide/src/assets/css/themes/remix-dark_tvx1s2.css index 84f61e9658..8db3e60b5e 100644 --- a/apps/remix-ide/src/assets/css/themes/remix-dark_tvx1s2.css +++ b/apps/remix-ide/src/assets/css/themes/remix-dark_tvx1s2.css @@ -5663,7 +5663,7 @@ button.bg-success:hover { background-color: #27926b !important; } .bg-info { - background-color: #274458 !important; + background-color: #35576e !important; } a.bg-info:focus, a.bg-info:hover, diff --git a/libs/remix-ui/app/src/lib/remix-app/remix-app.tsx b/libs/remix-ui/app/src/lib/remix-app/remix-app.tsx index aa1cc69fc6..192f8411b7 100644 --- a/libs/remix-ui/app/src/lib/remix-app/remix-app.tsx +++ b/libs/remix-ui/app/src/lib/remix-app/remix-app.tsx @@ -179,45 +179,47 @@ const RemixApp = (props: IRemixAppUi) => { setShowEnterDialog(true)}> {showEnterDialog && handleUserChosenType(type)}>}
-
- {props.app.menuicons.render()} -
-
- {props.app.sidePanel.render()} -
- -
- -
-
- {props.app.pinnedPanel.render()} -
- { - !hidePinnedPanel && +
+
+ {props.app.menuicons.render()} +
+
+ {props.app.sidePanel.render()} +
- } -
{props.app.hiddenPanel.render()}
+
+ +
+
+ {props.app.pinnedPanel.render()} +
+ { + !hidePinnedPanel && + + } +
{props.app.hiddenPanel.render()}
+
{props.app.statusBar.render()}
From 34b899c477d73a2cd29e4d510939a6756c72c9dc Mon Sep 17 00:00:00 2001 From: lianahus Date: Wed, 3 Jul 2024 11:01:24 +0200 Subject: [PATCH 06/14] fixing e2e --- libs/remix-ui/app/src/lib/remix-app/remix-app.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/remix-ui/app/src/lib/remix-app/remix-app.tsx b/libs/remix-ui/app/src/lib/remix-app/remix-app.tsx index 192f8411b7..ab0d2b951c 100644 --- a/libs/remix-ui/app/src/lib/remix-app/remix-app.tsx +++ b/libs/remix-ui/app/src/lib/remix-app/remix-app.tsx @@ -178,8 +178,8 @@ const RemixApp = (props: IRemixAppUi) => { setShowEnterDialog(true)}> {showEnterDialog && handleUserChosenType(type)}>} -
-
+
+
{props.app.menuicons.render()}
From a490079f1e50ce983b57ea8957d2aef1e5d2c9a5 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Fri, 5 Jul 2024 12:51:33 +0200 Subject: [PATCH 07/14] fix hasgitsubmodules call --- apps/remix-ide/src/app/files/fileManager.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/remix-ide/src/app/files/fileManager.ts b/apps/remix-ide/src/app/files/fileManager.ts index c9f1c1d93d..e232c2a132 100644 --- a/apps/remix-ide/src/app/files/fileManager.ts +++ b/apps/remix-ide/src/app/files/fileManager.ts @@ -25,7 +25,8 @@ const profile = { methods: ['closeAllFiles', 'closeFile', 'file', 'exists', 'open', 'writeFile', 'writeMultipleFiles', 'writeFileNoRewrite', 'readFile', 'copyFile', 'copyDir', 'rename', 'mkdir', 'readdir', 'dirList', 'fileList', 'remove', 'getCurrentFile', 'getFile', 'getFolder', 'setFile', 'switchFile', 'refresh', 'getProviderOf', 'getProviderByName', 'getPathFromUrl', 'getUrlFromPath', - 'saveCurrentFile', 'setBatchFiles', 'isGitRepo', 'isFile', 'isDirectory', 'hasGitSubmodule', 'copyFolderToJson', 'diff' + 'saveCurrentFile', 'setBatchFiles', 'isGitRepo', 'isFile', 'isDirectory', 'hasGitSubmodule', 'copyFolderToJson', 'diff', + 'hasGitSubmodules' ], kind: 'file-system' } From 2289172f6813dec341c816139c68fda863650e74 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Fri, 5 Jul 2024 08:23:50 +0200 Subject: [PATCH 08/14] add matomo plugin --- apps/remix-ide/src/app.js | 10 +++++++-- apps/remix-ide/src/app/plugins/matomo.ts | 26 ++++++++++++++++++++++++ apps/remix-ide/src/remixAppManager.js | 3 ++- 3 files changed, 36 insertions(+), 3 deletions(-) create mode 100644 apps/remix-ide/src/app/plugins/matomo.ts diff --git a/apps/remix-ide/src/app.js b/apps/remix-ide/src/app.js index b59568e70b..3e0eacdeb0 100644 --- a/apps/remix-ide/src/app.js +++ b/apps/remix-ide/src/app.js @@ -56,6 +56,7 @@ import { xtermPlugin } from './app/plugins/electron/xtermPlugin' import { ripgrepPlugin } from './app/plugins/electron/ripgrepPlugin' import { compilerLoaderPlugin, compilerLoaderPluginDesktop } from './app/plugins/electron/compilerLoaderPlugin' import { GitPlugin } from './app/plugins/git' +import { Matomo } from './app/plugins/matomo' import {SolCoder} from './app/plugins/solcoderAI' @@ -223,6 +224,9 @@ class AppComponent { //---- git const git = new GitPlugin() + //---- matomo + const matomo = new Matomo() + //---------------- Solidity UML Generator ------------------------- const solidityumlgen = new SolidityUmlGen(appManager) @@ -357,7 +361,8 @@ class AppComponent { templates, solcoder, git, - pluginStateLogger + pluginStateLogger, + matomo ]) //---- fs plugin @@ -476,7 +481,8 @@ class AppComponent { 'network', 'web3Provider', 'offsetToLineColumnConverter', - 'pluginStateLogger' + 'pluginStateLogger', + 'matomo' ]) await this.appManager.activatePlugin(['mainPanel', 'menuicons', 'tabs']) await this.appManager.activatePlugin(['statusBar']) diff --git a/apps/remix-ide/src/app/plugins/matomo.ts b/apps/remix-ide/src/app/plugins/matomo.ts new file mode 100644 index 0000000000..9495d1ddd7 --- /dev/null +++ b/apps/remix-ide/src/app/plugins/matomo.ts @@ -0,0 +1,26 @@ +'use strict' +import { Plugin } from '@remixproject/engine' + +const _paq = window._paq = window._paq || [] + +const profile = { + name: 'matomo', + description: 'send analytics to Matomo', + methods: ['track'], + events: [''], + version: '1.0.0' +} + +const allowedPlugins = ['LearnEth', 'etherscan', 'vyper', 'circuit-compiler', 'doc-gen', 'doc-viewer', 'solhint', 'walletconnect', 'scriptRunner'] + +export class Matomo extends Plugin { + + constructor() { + super(profile) + } + + async track(data: string[]) { + if (!allowedPlugins.includes(this.currentRequest.from)) return + _paq.push(data) + } +} \ No newline at end of file diff --git a/apps/remix-ide/src/remixAppManager.js b/apps/remix-ide/src/remixAppManager.js index d430d678d7..20b69d984f 100644 --- a/apps/remix-ide/src/remixAppManager.js +++ b/apps/remix-ide/src/remixAppManager.js @@ -81,7 +81,8 @@ let requiredModules = [ // services + layout views + system views 'dgit', 'pinnedPanel', 'pluginStateLogger', - 'remixGuide' + 'remixGuide', + 'matomo' ] From 57a87a83371137ef12c493c0b4079ee4ad1d3a2b Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 8 Jul 2024 14:07:10 +0200 Subject: [PATCH 09/14] matomo in learneth --- .../src/components/BackButton/index.tsx | 11 +++-- .../src/components/RepoImporter/index.tsx | 6 ++- apps/learneth/src/pages/Home/index.tsx | 2 +- apps/learneth/src/pages/StepDetail/index.tsx | 6 ++- apps/learneth/src/pages/StepList/index.tsx | 2 +- apps/learneth/src/redux/models/remixide.ts | 41 +++++++++++++------ apps/learneth/src/redux/models/workshop.ts | 4 +- 7 files changed, 49 insertions(+), 23 deletions(-) diff --git a/apps/learneth/src/components/BackButton/index.tsx b/apps/learneth/src/components/BackButton/index.tsx index 14f8112d4f..63b8c39975 100644 --- a/apps/learneth/src/components/BackButton/index.tsx +++ b/apps/learneth/src/components/BackButton/index.tsx @@ -10,6 +10,8 @@ function BackButton({entity}: any) { const isDetailPage = location.pathname === '/detail' const queryParams = new URLSearchParams(location.search) const stepId = Number(queryParams.get('stepId')) + const nextStep = entity && entity.steps[stepId + 1] + const previousStep = entity && entity.steps[stepId - 1] return (
diff --git a/apps/learneth/src/pages/StepDetail/index.tsx b/apps/learneth/src/pages/StepDetail/index.tsx index 2df3b9efe6..c689add02d 100644 --- a/apps/learneth/src/pages/StepDetail/index.tsx +++ b/apps/learneth/src/pages/StepDetail/index.tsx @@ -203,7 +203,8 @@ function StepDetailPage() {