Merge branch 'master' into contract-gen

pull/4801/head
STetsing 6 months ago committed by GitHub
commit 9c5383d44a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 5
      apps/remix-ide/src/app/plugins/solcoderAI.tsx
  2. 8
      apps/remix-ide/src/app/tabs/settings-tab.tsx
  3. 12
      libs/remix-ui/run-tab/src/lib/components/environment.tsx
  4. 3
      libs/remix-ui/settings/src/lib/remix-ui-settings.tsx
  5. 13
      libs/remix-ui/tabs/src/lib/remix-ui-tabs.tsx
  6. 10
      releaseDetails.json

@ -28,8 +28,8 @@ enum BackendOPModel{
}
const PromptBuilder = (inst, answr, modelop) => {
if (modelop === BackendOPModel.CodeLLama) return "\n### INSTRUCTION:\n" + inst + "\n### RESPONSE:\n" + answr
if (modelop === BackendOPModel.DeepSeek) return ""
if (modelop === BackendOPModel.CodeLLama) return ""
if (modelop === BackendOPModel.DeepSeek) return "\n### INSTRUCTION:\n" + inst + "\n### RESPONSE:\n" + answr
if (modelop === BackendOPModel.Mistral) return ""
}
@ -81,7 +81,6 @@ export class SolCoder extends Plugin {
let result
try {
const main_prompt = this._build_solgpt_promt(prompt)
console.log(main_prompt.length)
result = await(
await fetch(this.api_url, {
method: 'POST',

@ -15,7 +15,7 @@ const _paq = (window._paq = window._paq || [])
const profile = {
name: 'settings',
displayName: 'Settings',
methods: ['get', 'updateCopilotChoice'],
methods: ['get', 'updateCopilotChoice', 'getCopilotSetting'],
events: [],
icon: 'assets/img/settings.webp',
description: 'Remix-IDE settings',
@ -52,7 +52,7 @@ module.exports = class SettingsTab extends ViewPlugin {
this.element = document.createElement('div')
this.element.setAttribute('id', 'settingsTab')
this.useMatomoAnalytics = null
this.useCopilot = false
this.useCopilot = this.get('settings/copilot/suggest/activate')
}
setDispatch(dispatch: React.Dispatch<any>) {
@ -102,6 +102,10 @@ module.exports = class SettingsTab extends ViewPlugin {
})
}
getCopilotSetting(){
return this.useCopilot
}
updateMatomoAnalyticsChoice(isChecked) {
this.config.set('settings/matomo-analytics', isChecked)
this.useMatomoAnalytics = isChecked

@ -15,10 +15,10 @@ export function EnvironmentUI(props: EnvironmentProps) {
const currentProvider = props.providers.providerList.find((exEnv) => exEnv.name === props.selectedEnv)
const bridges = {
'L2 - Optimism': 'https://app.optimism.io/bridge/deposit',
'L2 - Arbitrum One': 'https://bridge.arbitrum.io/'
'L2 - Arbitrum': 'https://bridge.arbitrum.io/'
}
const isL2 = (providerDisplayName: string) => providerDisplayName === 'Optimism Provider' || providerDisplayName === 'Arbitrum One Provider'
const isL2 = (providerDisplayName: string) => providerDisplayName === 'L2 - Optimism' || providerDisplayName === 'L2 - Arbitrum'
return (
<div className="udapp_crow">
<label id="selectExEnv" className="udapp_settingsLabel">
@ -38,16 +38,16 @@ export function EnvironmentUI(props: EnvironmentProps) {
<div className="udapp_environment">
<Dropdown id="selectExEnvOptions" data-id="settingsSelectEnvOptions" className="udapp_selectExEnvOptions">
<Dropdown.Toggle as={CustomToggle} id="dropdown-custom-components" className="btn btn-light btn-block w-100 d-inline-block border border-dark form-control" icon={null}>
{isL2(currentProvider && currentProvider.displayName) && 'L2 - '}
{isL2(currentProvider && currentProvider.displayName)}
{currentProvider && currentProvider.displayName}
{currentProvider && bridges[currentProvider.name] && (
{currentProvider && bridges[currentProvider.displayName] && (
<CustomTooltip placement={'right'} tooltipClasses="text-nowrap" tooltipId="info-recorder" tooltipText={<FormattedMessage id="udapp.tooltipText3" />}>
<i
style={{ fontSize: 'medium' }}
className={'ml-2 fa fa-rocket-launch'}
aria-hidden="true"
onClick={() => {
window.open(bridges[currentProvider.name], '_blank')
window.open(bridges[currentProvider.displayName], '_blank')
}}
></i>
</CustomTooltip>
@ -63,7 +63,7 @@ export function EnvironmentUI(props: EnvironmentProps) {
data-id={`dropdown-item-${name}`}
>
<span className="">
{isL2(displayName) && 'L2 - '}
{isL2(displayName)}
{displayName}
</span>
</Dropdown.Item>

@ -58,7 +58,6 @@ export const RemixUiSettings = (props: RemixUiSettingsProps) => {
const [ipfsProtocol, setipfsProtocol] = useState('')
const [ipfsProjectId, setipfsProjectId] = useState('')
const [ipfsProjectSecret, setipfsProjectSecret] = useState('')
const copilotDownload = useRef(null)
const intl = useIntl()
const initValue = () => {
@ -145,7 +144,7 @@ export const RemixUiSettings = (props: RemixUiSettingsProps) => {
}
const startCopilot = async () => {
copilotActivate(props.config, true, dispatch)
copilotActivate(props.config, props.useCopilot, dispatch)
props.plugin.call('terminal', 'log', { type: 'typewriterlog', value: `Solidity copilot activated!` })
}

@ -5,6 +5,7 @@ import React, {useState, useRef, useEffect, useReducer} from 'react' // eslint-d
import { FormattedMessage } from 'react-intl'
import { Tab, Tabs, TabList, TabPanel } from 'react-tabs'
import './remix-ui-tabs.css'
import { values } from 'lodash'
const _paq = (window._paq = window._paq || [])
/* eslint-disable-next-line */
@ -64,7 +65,6 @@ export const TabsUI = (props: TabsUIProps) => {
const tabsRef = useRef({})
const tabsElement = useRef(null)
const [ai_switch, setAI_switch] = useState<boolean>(false)
const tabs = useRef(props.tabs)
tabs.current = props.tabs // we do this to pass the tabs list to the onReady callbacks
@ -77,6 +77,14 @@ export const TabsUI = (props: TabsUIProps) => {
}
}, [tabsState.selectedIndex])
const getAI = async() => {
try {
return await props.plugin.call('settings', 'getCopilotSetting')
} catch (e){
return false
}
}
const getFileDecorationClasses = (tab: any) => {
const fileDecoration = tabsState.fileDecorations.find((fileDecoration: fileDecoration) => {
if (`${fileDecoration.workspace.name}/${fileDecoration.path}` === tab.name) return true
@ -92,7 +100,6 @@ export const TabsUI = (props: TabsUIProps) => {
const classNameImg = 'my-1 mr-1 text-dark ' + tab.iconClass
const classNameTab = 'nav-item nav-link d-flex justify-content-center align-items-center px-2 py-1 tab' + (index === currentIndexRef.current ? ' active' : '')
const invert = props.themeQuality === 'dark' ? 'invert(1)' : 'invert(0)'
return (
<CustomTooltip tooltipId="tabsActive" tooltipText={tab.tooltip} placement="bottom-start">
<div
@ -133,6 +140,7 @@ export const TabsUI = (props: TabsUIProps) => {
}
const setFileDecorations = (fileStates: fileDecoration[]) => {
getAI().then(value => setAI_switch(value)).catch(error => console.log(error))
dispatch({ type: 'SET_FILE_DECORATIONS', payload: fileStates })
}
@ -208,6 +216,7 @@ export const TabsUI = (props: TabsUIProps) => {
<i className="fas fa-play"></i>
</button>
</CustomTooltip>
<div className= "d-flex border-left ml-2 align-items-center" style={{ height: "3em" }}>
<CustomTooltip
placement="bottom"

@ -1,10 +1,10 @@
{
"version": "v0.48.0",
"version": "v0.49.0",
"title": "RELEASE HIGHLIGHTS",
"highlight1": "EIP6963 supported",
"highlight2": "PLONK scripts added for ZKP templates",
"highlight3": "Solidity scripts added to use CREATE2 for contract deployment",
"highlight1": "Syntax highlighting for .toml files added",
"highlight2": "'Deploy & Run Transactions' plugin's UI improved",
"highlight3": "Remix AI model improved",
"highlight4": "",
"more": "Read More",
"moreLink": "https://medium.com/remix-ide/remix-release-v0-48-0-0f256b049ff6?source=friends_link&sk=31785d048aa0293ea7e952004ff7e3e4"
"moreLink": "https://medium.com/remix-ide/remix-release-v0-49-0-b396ab7fff2b?source=friends_link&sk=2e3c6063841bbfa398e3e60d59d4fd48"
}

Loading…
Cancel
Save