Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
32 changes: 0 additions & 32 deletions apps/remix-ide-e2e/src/tests/generalSettings.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,38 +83,6 @@ module.exports = {
// .checkElementStyle(':root', '--danger', remixIdeThemes.light.danger)
// },



'Should load zh locale ': function (browser) {
browser.waitForElementVisible('*[data-id="settings-sidebar-general"]')
.click('*[data-id="settings-sidebar-general"]')
.pause(100)
.scrollAndClick('*[data-id="settingsTabDropdownTogglelocale"]')
.waitForElementVisible('[data-id="custom-dropdown-items"]')
.waitForElementVisible('[data-id="settingsTabDropdownItemzh"]')
.click('[data-id="settingsTabDropdownItemzh"]')
.pause(2000)
.assert.containsText('[data-id="settings-sidebar-header"] h2', '设置')
.assert.containsText('*[data-id="listenNetworkCheckInput"]', '监听所有交易')
.assert.containsText('*[data-id="settingsTabgenerate-contract-metadataLabel"]', '生成合约元数据')
.assert.containsText('*[data-id="settingsTabauto-completionLabel"]', '在编辑器中启用代码自动补全')
.assert.containsText('*[data-id="settingsTabshow-gasLabel"]', '在编辑器中展示 gas 预算')
.assert.containsText('*[data-id="settingsTabdisplay-errorsLabel"]', '编辑代码时展示错误提示')
},

'Should load en locale ': function (browser) {
browser.scrollAndClick('*[data-id="settingsTabDropdownTogglelocale"]')
.waitForElementVisible('[data-id="custom-dropdown-items"]')
.waitForElementVisible('[data-id="settingsTabDropdownItemen"]')
.click('[data-id="settingsTabDropdownItemen"]')
.pause(2000)
.assert.containsText('[data-id="settings-sidebar-header"] h2', 'Settings')
.assert.containsText('*[data-id="listenNetworkCheckInput"]', 'Listen on all transactions')
.assert.containsText('*[data-id="settingsTabgenerate-contract-metadataLabel"]', 'Generate contract metadata')
.assert.containsText('*[data-id="settingsTabauto-completionLabel"]', 'Enable code completion in editor')
.assert.containsText('*[data-id="settingsTabshow-gasLabel"]', 'Display gas estimates in editor')
.assert.containsText('*[data-id="settingsTabdisplay-errorsLabel"]', 'Display errors in editor while typing')
}
}

const remixIdeThemes = {
Expand Down
10 changes: 5 additions & 5 deletions apps/remix-ide/src/app/tabs/locales/en/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,15 @@
"settings.services": "Connected Services",
"settings.generalSettingsDescription": "Manage code editor settings, UI theme, language and analytics permissions.",
"settings.analyticsDescription": "Control how Remix uses AI and analytics to improve your experience.",
"settings.aiDescription": "The Remix AI Assistant enhances your coding experience with smart suggestions and automated insights. Manage how AI interacts with your code and data.",
"settings.aiDescription": "The RemixAI Assistant enhances your coding experience with smart suggestions and automated insights. Manage how RemixAI interacts with your code and data.",
"settings.servicesDescription": "Configure the settings for connected services, including Github, IPFS, Swarm, Sindri and Etherscan.",
"settings.matomoAnalyticsNoCookies": "Matomo Analytics (necessary, no cookies)",
"settings.matomoAnalyticsNoCookiesDescription": "Help improve Remix with anonymous usage data.",
"settings.matomoAnalyticsWithCookies": "Matomo Performance Analytics (with cookies)",
"settings.matomoAnalyticsWithCookiesDescription": "Enable tracking with cookies for more detailed insights.",
"settings.aiCopilot": "AI Copilot",
"settings.aiCopilotDescription": "AI Copilot assists with code suggestions and improvements.",
"settings.aiPrivacyPolicy": "AI Privacy & Data Usage",
"settings.aiCopilot": "RemixAI Copilot",
"settings.aiCopilotDescription": "RemixAI Copilot assists with code suggestions and improvements.",
"settings.aiPrivacyPolicy": "RemixAI Privacy & Data Usage",
"settings.viewPrivacyPolicy": "View Privacy Policy",
"settings.aiPrivacyPolicyDescription": "Understand how AI processes your data."
"settings.aiPrivacyPolicyDescription": "Understand how RemixAI processes your data."
}
4 changes: 1 addition & 3 deletions apps/remix-ide/src/app/tabs/settings-tab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ export default class SettingsTab extends ViewPlugin {
editor: any
private _deps: {
themeModule: any
localeModule: any
}
element: HTMLDivElement
public useMatomoAnalytics: any
Expand All @@ -48,7 +47,6 @@ export default class SettingsTab extends ViewPlugin {
this.editor = editor
this._deps = {
themeModule: Registry.getInstance().get('themeModule').api,
localeModule: Registry.getInstance().get('localeModule').api
}
this.element = document.createElement('div')
this.element.setAttribute('id', 'settingsTab')
Expand Down Expand Up @@ -82,7 +80,6 @@ export default class SettingsTab extends ViewPlugin {
useMatomoPerfAnalytics={state.useMatomoPerfAnalytics}
useCopilot={state.useCopilot}
themeModule={state._deps.themeModule}
localeModule={state._deps.localeModule}
/>
)
}
Expand Down Expand Up @@ -129,6 +126,7 @@ export default class SettingsTab extends ViewPlugin {
// set timestamp to local storage to track when the user has given consent
localStorage.setItem('matomo-analytics-consent', Date.now().toString())
this.useMatomoPerfAnalytics = isChecked
this.emit('matomoPerfAnalyticsChoiceUpdated', isChecked)
if (!isChecked) {
// revoke tracking consent for performance data
_paq.push(['disableCookies'])
Expand Down
2 changes: 1 addition & 1 deletion libs/remix-ai-core/src/agents/contractAgent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { workspaceAgent } from "./workspaceAgent";
import { CompilationResult } from "../types/types";
import { compilecontracts, compilationParams } from "../helpers/compile";
import { OllamaInferencer } from "../inferencers/local/ollamaInferencer"
const COMPILATION_WARNING_MESSAGE = '⚠️**Warning**: The compilation failed. Please check the compilation errors in the Solidity compiler plugin. Enter `/continue` or `/c` if you want Remix AI to try again until a compilable solution is generated?'
const COMPILATION_WARNING_MESSAGE = '⚠️**Warning**: The compilation failed. Please check the compilation errors in the Solidity compiler plugin. Enter `/continue` or `/c` if you want RemixAI to try again until a compilable solution is generated?'

export class ContractAgent {
plugin: any;
Expand Down
14 changes: 4 additions & 10 deletions libs/remix-ui/settings/src/lib/remix-ui-settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { EtherscanConfigDescription, GitHubCredentialsDescription, SindriCredent
import { initialState, settingReducer } from './settingsReducer'
import {Toaster} from '@remix-ui/toaster' // eslint-disable-line
import { ThemeModule } from '@remix-ui/theme-module'
import { LocaleModule } from '@remix-ui/locale-module'
import { ThemeContext, themes } from '@remix-ui/home-tab'
import { FormattedMessage } from 'react-intl'
import { Registry } from '@remix-project/remix-lib'
Expand All @@ -23,7 +22,6 @@ export interface RemixUiSettingsProps {
useMatomoPerfAnalytics: boolean
useCopilot: boolean
themeModule: ThemeModule
localeModule: LocaleModule
}

const _paq = (window._paq = window._paq || [])
Expand Down Expand Up @@ -73,14 +71,6 @@ const settingsSections: SettingsSection[] = [
{
title: 'Appearance',
options: [{
name: 'locale',
label: 'settings.locales',
type: 'select',
selectOptions: settingsConfig.locales.map((locale) => ({
label: locale.name.toLocaleUpperCase() + '-' + locale.localeName,
value: locale.code
}))
}, {
name: 'theme',
label: 'settings.theme',
type: 'select',
Expand Down Expand Up @@ -244,6 +234,10 @@ export const RemixUiSettings = (props: RemixUiSettingsProps) => {
dispatch({ type: 'SET_VALUE', payload: { name: 'copilot/suggest/activate', value: isChecked } })
})

props.plugin.on('settings', 'matomoPerfAnalyticsChoiceUpdated', (isChecked) => {
dispatch({ type: 'SET_VALUE', payload: { name: 'matomo-perf-analytics', value: isChecked } })
})

}, [])

useEffect(() => {
Expand Down
10 changes: 0 additions & 10 deletions libs/remix-ui/settings/src/lib/select-dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,6 @@ const SelectDropdown = ({ value, options, name, dispatch }: SelectDropdownProps)
} else {
console.error('Theme not found: ', value)
}
} else if (name === 'locale') {
const localeModule = Registry.getInstance().get('localeModule').api
const locale = localeModule.getLocales().find((locale) => locale.code === value)

if (locale) {
localeModule.switchLocale(locale.code)
dispatch({ type: 'SET_VALUE', payload: { name: name, value: locale.localeName } })
} else {
console.error('Locale not found: ', value)
}
} else {
dispatch({ type: 'SET_VALUE', payload: { name: name, value: value } })
}
Expand Down
7 changes: 1 addition & 6 deletions libs/remix-ui/settings/src/lib/settingsReducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { SettingsActions, SettingsState } from '../types'
const config = Registry.getInstance().get('config').api
const settingsConfig = Registry.getInstance().get('settingsConfig').api
const defaultTheme = config.get('settings/theme') ? settingsConfig.themes.find((theme) => theme.name.toLowerCase() === config.get('settings/theme').toLowerCase()) : settingsConfig.themes[0]
const defaultLocale = config.get('settings/locale') ? settingsConfig.locales.find((locale) => (locale.code === config.get('settings/locale')) || locale.localeName.toLowerCase() === config.get('settings/locale').toLowerCase()) : settingsConfig.locales.find((locale) => locale.code === 'en')
const gistAccessToken = config.get('settings/gist-access-token') || ''
const githubUserName = config.get('settings/github-user-name') || ''
const githubEmail = config.get('settings/github-email') || ''
Expand Down Expand Up @@ -88,7 +87,7 @@ export const initialState: SettingsState = {
isLoading: false
},
'matomo-analytics': {
value: config.get('settings/matomo-analytics') || false,
value: config.get('settings/matomo-analytics') || true,
isLoading: false
},
'auto-completion': {
Expand All @@ -115,10 +114,6 @@ export const initialState: SettingsState = {
value: defaultTheme ? defaultTheme.name : "Dark",
isLoading: false
},
'locale': {
value: defaultLocale ? defaultLocale.localeName : "English",
isLoading: false
},
'github-config': {
value: githubConfig,
isLoading: false
Expand Down
1 change: 0 additions & 1 deletion libs/remix-ui/settings/src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ export interface SettingsState {
'copilot/suggest/activate': ConfigState
'save-evm-state': ConfigState,
'theme': ConfigState,
'locale': ConfigState,
'github-config': ConfigState,
'ipfs-config': ConfigState,
'swarm-config': ConfigState,
Expand Down