Skip to content

Commit 7d1e738

Browse files
authored
Merge branch 'master' into ai_setting
2 parents 4c6838f + bdca4d6 commit 7d1e738

File tree

9 files changed

+152
-161
lines changed

9 files changed

+152
-161
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,10 @@ export class VerticalIcons extends Plugin {
7373
Object.keys(this.icons).map((o) => {
7474
this.icons[o].active = false
7575
})
76-
this.icons[name].active = true
76+
77+
if (this.icons[name]) {
78+
this.icons[name].active = true
79+
}
7780
this.renderComponent()
7881
})
7982
}
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
{
22
"remixUiTabs.tooltipText1": "Run script (CTRL + SHIFT + S)",
33
"remixUiTabs.tooltipText2": "Compile CTRL + S",
4-
"remixUiTabs.tooltipText3": "Select .sol or .yul file to compile or a .ts or .js file and run it",
5-
"remixUiTabs.tooltipText4": "Select .sol file to use AI tools [BETA]",
4+
"remixUiTabs.tooltipText3": "Select .sol or .yul file to compile OR a .ts or .js file to run",
5+
"remixUiTabs.tooltipText4": "To explain a contract, choose a .sol file",
66
"remixUiTabs.tooltipText5": "Explain the contract(s) in current file [BETA]",
77
"remixUiTabs.tooltipText6": "Enable Remix AI Copilot [BETA]",
88
"remixUiTabs.tooltipText7": "Disable Remix AI Copilot [BETA]",
9-
"remixUiTabs.tooltipText8": "Remix AI Tools Documentation [BETA]",
9+
"remixUiTabs.tooltipText8": "Remix AI Tools Documentation",
10+
"remixUiTabs.tooltipTextDisabledCopilot": "To use Remix AI Copilot, choose a .sol file",
1011
"remixUiTabs.zoomOut": "Zoom out",
1112
"remixUiTabs.zoomIn": "Zoom in"
1213
}

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
"udapp._comment_value.tsx": "libs/remix-ui/run-tab/src/lib/components/value.tsx",
1111
"udapp.value": "Value",
12-
"udapp.tooltipText5": "Enter an amount and choose its unit",
12+
"udapp.tooltipText5": "Enter an amount to be sent with transaction and choose its unit",
1313

1414
"udapp._comment_contractDropdownUI.tsx": "libs/remix-ui/run-tab/src/lib/components/contractDropdownUI.tsx",
1515
"udapp.contract": "Contract",
@@ -50,15 +50,15 @@
5050
"udapp.hash": "hash",
5151
"udapp.signature": "signature",
5252
"udapp.injectedTitle": "Unfortunately it's not possible to create an account using injected provider. Please create the account directly from your provider (i.e metamask or other of the same type).",
53-
"udapp.createNewAccount": "Create a new account",
53+
"udapp.createNewAccount": "Create new account",
5454
"udapp.web3Title": "Creating an account is possible only in Personal mode. Please go to Settings to enable it.",
5555
"udapp.defaultTitle": "Unfortunately it's not possible to create an account using an external wallet ({selectExEnv}).",
5656
"udapp.text1": "Please provide a Passphrase for the account creation",
5757
"udapp.tooltipText1": "Account list is empty, please make sure the current provider is properly connected to remix",
5858
"udapp.modalTitle1": "Passphrase to sign a message",
5959
"udapp.modalMessage1": "Enter your passphrase for this account to sign the message",
60-
"udapp.copyAccount": "Copy account to clipboard",
61-
"udapp.signMsgUsingAccount": "Sign a message using this account",
60+
"udapp.copyAccount": "Copy account",
61+
"udapp.signMsgUsingAccount": "Sign using this account",
6262

6363
"udapp._comment_environment.tsx": "libs/remix-ui/run-tab/src/lib/components/environment.tsx",
6464
"udapp.environment": "Environment",

libs/remix-ui/run-tab/src/lib/components/account.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -200,11 +200,17 @@ export function AccountUI(props: AccountProps) {
200200
<div className="udapp_crow">
201201
<label className="udapp_settingsLabel">
202202
<FormattedMessage id="udapp.account" />
203-
<CustomTooltip placement={'top-start'} tooltipClasses="text-wrap" tooltipId="remixPlusWrapperTooltip" tooltipText={plusOpt.title}>
203+
<CustomTooltip placement={'top'} tooltipClasses="text-wrap" tooltipId="remixPlusWrapperTooltip" tooltipText={plusOpt.title}>
204204
<span id="remixRunPlusWraper">
205-
<i id="remixRunPlus" className={`fas fa-plus-circle udapp_icon ${plusOpt.classList}`} aria-hidden="true" onClick={newAccount}></i>
205+
<i id="remixRunPlus" className={`ml-2 fas fa-plus-circle udapp_icon ${plusOpt.classList}`} aria-hidden="true" onClick={newAccount}></i>
206206
</span>
207207
</CustomTooltip>
208+
<CustomTooltip placement={'top'} tooltipClasses="text-nowrap" tooltipId="remixSignMsgTooltip" tooltipText={<FormattedMessage id="udapp.signMsgUsingAccount" />}>
209+
<i id="remixRunSignMsg" data-id="settingsRemixRunSignMsg" className="ml-2 fas fa-edit udapp_icon" aria-hidden="true" onClick={signMessage}></i>
210+
</CustomTooltip>
211+
<span >
212+
<CopyToClipboard className="fas fa-copy ml-2 p-0" tip={intl.formatMessage({ id: 'udapp.copyAccount' })} content={selectedAccount} direction="top" />
213+
</span>
208214
{props.accounts.isRequesting && <i className="fa fa-spinner fa-pulse ml-2" aria-hidden="true"></i>}
209215
</label>
210216
<div className="udapp_account">
@@ -224,12 +230,6 @@ export function AccountUI(props: AccountProps) {
224230
</option>
225231
))}
226232
</select>
227-
<div style={{ marginLeft: -5 }}>
228-
<CopyToClipboard tip={intl.formatMessage({ id: 'udapp.copyAccount' })} content={selectedAccount} direction="top" />
229-
</div>
230-
<CustomTooltip placement={'top-start'} tooltipClasses="text-nowrap" tooltipId="remixSignMsgTooltip" tooltipText={<FormattedMessage id="udapp.signMsgUsingAccount" />}>
231-
<i id="remixRunSignMsg" data-id="settingsRemixRunSignMsg" className="mx-1 fas fa-edit udapp_icon" aria-hidden="true" onClick={signMessage}></i>
232-
</CustomTooltip>
233233
</div>
234234
</div>
235235
)

libs/remix-ui/run-tab/src/lib/components/environment.tsx

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,12 @@ export function EnvironmentUI(props: EnvironmentProps) {
2626

2727
<CustomTooltip placement={'right'} tooltipClasses="text-nowrap" tooltipId="info-recorder" tooltipText={<FormattedMessage id="udapp.tooltipText2" />}>
2828
<a href="https://chainlist.org/" target="_blank">
29-
<i style={{ fontSize: 'medium' }} className={'ml-2 fad fa-plug'} aria-hidden="true"></i>
29+
<i className={'ml-2 fas fa-plug'} aria-hidden="true"></i>
30+
</a>
31+
</CustomTooltip>
32+
<CustomTooltip placement={'right'} tooltipClasses="text-wrap" tooltipId="runAndDeployAddresstooltip" tooltipText={<FormattedMessage id="udapp.environmentDocs" />}>
33+
<a href="https://remix-ide.readthedocs.io/en/latest/run.html#environment" target="_blank" rel="noreferrer">
34+
<i className="udapp_infoDeployAction ml-2 fas fa-info-circle"></i>
3035
</a>
3136
</CustomTooltip>
3237
</label>
@@ -65,12 +70,6 @@ export function EnvironmentUI(props: EnvironmentProps) {
6570
))}
6671
</Dropdown.Menu>
6772
</Dropdown>
68-
69-
<CustomTooltip placement={'right-start'} tooltipClasses="text-wrap" tooltipId="runAndDeployAddresstooltip" tooltipText={<FormattedMessage id="udapp.environmentDocs" />}>
70-
<a href="https://remix-ide.readthedocs.io/en/latest/run.html#environment" target="_blank" rel="noreferrer">
71-
<i className="udapp_infoDeployAction ml-2 fas fa-info"></i>
72-
</a>
73-
</CustomTooltip>
7473
</div>
7574
</div>
7675
)

libs/remix-ui/run-tab/src/lib/components/gasLimit.tsx

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export function GasLimitUI(props: GasPriceProps) {
5151
<FormattedMessage id="udapp.gasLimitAuto" />
5252
</label>
5353
</div>
54-
<div className="d-flex pb-1 custom-control custom-radio">
54+
<div className="d-flex custom-control custom-radio align-items-baseline">
5555
<input
5656
className="custom-control-input"
5757
type="radio"
@@ -61,20 +61,20 @@ export function GasLimitUI(props: GasPriceProps) {
6161
checked={!gasLimitAuto}
6262
id="glManualConfig"
6363
/>
64-
<label className="mb-1 w-100 form-check-label custom-control-label" htmlFor="glManualConfig" data-id="glManualConfiguration">
64+
<label className="mb-1 w-50 form-check-label custom-control-label" htmlFor="glManualConfig" data-id="glManualConfiguration">
6565
<FormattedMessage id="udapp.gasLimitManual" />
66-
<CustomTooltip placement={'right'} tooltipClasses="text-nowrap" tooltipId="remixGasPriceTooltip" tooltipText={<FormattedMessage id="udapp.tooltipText4" />}>
67-
<input
68-
type="number"
69-
ref={inputComponent}
70-
disabled={gasLimitAuto}
71-
className="mt-2 form-control"
72-
id="gasLimit"
73-
value={props.gasLimit === 0 ? currentGasLimit.current : props.gasLimit}
74-
onChange={handleGasLimit}
75-
/>
76-
</CustomTooltip>
7766
</label>
67+
<CustomTooltip placement={'right'} tooltipClasses="text-nowrap" tooltipId="remixGasPriceTooltip" tooltipText={<FormattedMessage id="udapp.tooltipText4" />}>
68+
<input
69+
type="number"
70+
ref={inputComponent}
71+
disabled={gasLimitAuto}
72+
className="form-control w-100 float-right"
73+
id="gasLimit"
74+
value={props.gasLimit === 0 ? currentGasLimit.current : props.gasLimit}
75+
onChange={handleGasLimit}
76+
/>
77+
</CustomTooltip>
7878
</div>
7979
</div>
8080
</div>

libs/remix-ui/run-tab/src/lib/components/value.tsx

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -49,44 +49,45 @@ export function ValueUI(props: ValueProps) {
4949
<label className="udapp_settingsLabel" data-id="remixDRValueLabel">
5050
<FormattedMessage id="udapp.value" />
5151
</label>
52-
<div className="udapp_gasValueContainer">
52+
<div className="input-group udapp_gasValueContainer">
5353
<CustomTooltip placement={'top-start'} tooltipClasses="text-nowrap" tooltipId="remixValueTooltip" tooltipText={<FormattedMessage id="udapp.tooltipText5" />}>
5454
<input
5555
ref={inputValue}
5656
type="number"
5757
min="0"
5858
pattern="^[0-9]"
5959
step="1"
60-
className="form-control udapp_gasNval udapp_col2"
60+
className="form-control"
6161
id="value"
6262
data-id="dandrValue"
6363
onChange={validateValue}
6464
value={props.sendValue}
6565
/>
6666
</CustomTooltip>
67-
68-
<select
69-
name="unit"
70-
value={props.sendUnit}
71-
className="form-control p-1 udapp_gasNvalUnit udapp_col2_2 custom-select"
72-
id="unit"
73-
onChange={(e) => {
74-
props.setUnit(e.target.value as 'ether' | 'finney' | 'gwei' | 'wei')
75-
}}
76-
>
77-
<option data-unit="wei" value="wei">
78-
Wei
79-
</option>
80-
<option data-unit="gwei" value="gwei">
81-
Gwei
82-
</option>
83-
<option data-unit="finney" value="finney">
84-
Finney
85-
</option>
86-
<option data-unit="ether" value="ether">
87-
Ether
88-
</option>
89-
</select>
67+
<div className="input-group-append">
68+
<select
69+
name="unit"
70+
value={props.sendUnit}
71+
className="custom-select"
72+
id="unit"
73+
onChange={(e) => {
74+
props.setUnit(e.target.value as 'ether' | 'finney' | 'gwei' | 'wei')
75+
}}
76+
>
77+
<option data-unit="wei" value="wei">
78+
Wei
79+
</option>
80+
<option data-unit="gwei" value="gwei">
81+
Gwei
82+
</option>
83+
<option data-unit="finney" value="finney">
84+
Finney
85+
</option>
86+
<option data-unit="ether" value="ether">
87+
Ether
88+
</option>
89+
</select>
90+
</div>
9091
</div>
9192
</div>
9293
)

libs/remix-ui/settings/src/lib/remix-ui-settings.tsx

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import { ViewPlugin } from '@remixproject/engine-web'
22
import React, {useState, useRef, useReducer, useEffect, useCallback} from 'react' // eslint-disable-line
3+
import { CustomTooltip } from '@remix-ui/helper'
4+
const _paq = (window._paq = window._paq || [])
35

46
import { AppModal, AlertModal, ModalTypes } from '@remix-ui/app'
57
import { labels, textDark, textSecondary } from './constants'
@@ -449,9 +451,23 @@ export const RemixUiSettings = (props: RemixUiSettingsProps) => {
449451
const copilotSettings = () => (
450452
<div className="border-top">
451453
<div className="card-body pt-3 pb-2">
452-
<h6 className="card-title">
454+
<h6 className="card-title d-inline">
453455
<FormattedMessage id="settings.copilot" />
454456
</h6>
457+
<CustomTooltip placement="bottom" tooltipId="overlay-tooltip-aiDocumentation" tooltipText={<FormattedMessage id="remixUiTabs.tooltipText8" />}>
458+
<span
459+
data-id="remix_ai_docs"
460+
id="remix_ai_docs"
461+
className="btn pl-2 pr-0 py-0 d-inline ai-docs"
462+
role='link'
463+
onClick={()=>{
464+
window.open("https://remix-ide.readthedocs.io/en/latest/ai.html")
465+
_paq.push(['trackEvent', 'ai', 'solcoder', 'documentation'])
466+
}}
467+
>
468+
<i aria-hidden="true" className="fas fa-book"></i>
469+
</span>
470+
</CustomTooltip>
455471

456472
<div className="pt-2 mb-0">
457473
<div className="text-secondary mb-0 h6">

0 commit comments

Comments
 (0)