Skip to content

Commit

Permalink
Merge branch 'fix_gpt_terminal_output' of https://github.com/ethereum…
Browse files Browse the repository at this point in the history
…/remix-project into fix_gpt_terminal_output
  • Loading branch information
bunsenstraat committed Nov 6, 2024
2 parents 8c5603d + a21ef0a commit b639102
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions apps/remix-ide/src/app/plugins/remixAIPlugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ export class RemixAIPlugin extends ViewPlugin {
result = await this.remoteInferencer.solidity_answer(newPrompt)
}
if (result && params.terminal_output) this.call('terminal', 'log', { type: 'aitypewriterwarning', value: result })

if (prompt.trimStart().startsWith('gpt') || prompt.trimStart().startsWith('sol-gpt')) params.terminal_output = false
return result
}

Expand Down
2 changes: 1 addition & 1 deletion apps/remix-ide/src/app/tabs/locales/en/remixUiTabs.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"remixUiTabs.tooltipText1": "Run script (CTRL + SHIFT + S)",
"remixUiTabs.tooltipText2": "Compile CTRL + S",
"remixUiTabs.tooltipText3": "Select .sol or .yul file to compile OR a .ts or .js file to run",
"remixUiTabs.tooltipText4": "To explain a contract, choose a .sol file",
"remixUiTabs.tooltipText4": "To explain a contract, choose a .sol, .vy or .circom file",
"remixUiTabs.tooltipText5": "Explain the contract(s) in current file [BETA]",
"remixUiTabs.tooltipText6": "Enable RemixAI Copilot [BETA]",
"remixUiTabs.tooltipText7": "Disable RemixAI Copilot [BETA]",
Expand Down
6 changes: 3 additions & 3 deletions libs/remix-ui/tabs/src/lib/remix-ui-tabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ export const TabsUI = (props: TabsUIProps) => {
tooltipId="overlay-tooltip-explaination"
tooltipText={
<span>
{tabsState.currentExt === 'sol' ? (
{((tabsState.currentExt === 'sol') || (tabsState.currentExt === 'vy') || (tabsState.currentExt === 'circom')) ? (
<FormattedMessage id="remixUiTabs.tooltipText5" />
) : (
<FormattedMessage id="remixUiTabs.tooltipText4" />
Expand All @@ -262,11 +262,11 @@ export const TabsUI = (props: TabsUIProps) => {
data-id="explain-editor"
id='explain_btn'
className='btn text-ai pl-2 pr-0 py-0'
disabled={!(tabsState.currentExt === 'sol') || explaining}
disabled={!((tabsState.currentExt === 'sol') || (tabsState.currentExt === 'vy') || (tabsState.currentExt === 'circom')) || explaining}
onClick={async () => {
const path = active().substr(active().indexOf('/') + 1, active().length)
const content = await props.plugin.call('fileManager', 'readFile', path)
if (tabsState.currentExt === 'sol') {
if ((tabsState.currentExt === 'sol') || (tabsState.currentExt === 'vy') || (tabsState.currentExt === 'circom')) {
setExplaining(true)
// if plugin is pinned,
await props.plugin.call('popupPanel', 'showPopupPanel', true)
Expand Down

0 comments on commit b639102

Please sign in to comment.