debugger redesign improvements

pull/5370/head
lianahus 2 years ago committed by Aniket
parent 1d73b0aac5
commit 866d050845
  1. 1
      apps/remix-ide-e2e/src/tests/solidityUnittests.test.ts
  2. 5
      libs/remix-ui/debugger-ui/src/lib/vm-debugger/assembly-items.tsx
  3. 2
      libs/remix-ui/debugger-ui/src/lib/vm-debugger/calldata-panel.tsx
  4. 4
      libs/remix-ui/debugger-ui/src/lib/vm-debugger/code-list-view.tsx
  5. 4
      libs/remix-ui/debugger-ui/src/lib/vm-debugger/dropdown-panel.tsx
  6. 4
      libs/remix-ui/debugger-ui/src/lib/vm-debugger/full-storages-changes.tsx
  7. 4
      libs/remix-ui/debugger-ui/src/lib/vm-debugger/solidity-locals.tsx
  8. 4
      libs/remix-ui/debugger-ui/src/lib/vm-debugger/step-detail.tsx
  9. 10
      libs/remix-ui/debugger-ui/src/lib/vm-debugger/vm-debugger-head.tsx
  10. 20
      libs/remix-ui/debugger-ui/src/lib/vm-debugger/vm-debugger.tsx
  11. 1
      libs/remix-ui/debugger-ui/src/types/index.ts

@ -287,7 +287,6 @@ module.exports = {
.waitForElementContainsText('*[data-id="sidePanelSwapitTitle"]', 'DEBUGGER', 60000) .waitForElementContainsText('*[data-id="sidePanelSwapitTitle"]', 'DEBUGGER', 60000)
.waitForElementContainsText('*[data-id="functionPanel"]', 'checkWinningProposalFailed()', 60000) .waitForElementContainsText('*[data-id="functionPanel"]', 'checkWinningProposalFailed()', 60000)
.waitForElementVisible('*[data-id="dropdownPanelSolidityLocals"]').pause(1000) .waitForElementVisible('*[data-id="dropdownPanelSolidityLocals"]').pause(1000)
.click('*[data-id="dropdownPanelSolidityLocals"]')
.waitForElementContainsText('*[data-id="solidityLocals"]', 'no locals', 60000) .waitForElementContainsText('*[data-id="solidityLocals"]', 'no locals', 60000)
.goToVMTraceStep(316) .goToVMTraceStep(316)
.waitForElementContainsText('*[data-id="functionPanel"]', 'checkWinningProposalFailed()', 60000) .waitForElementContainsText('*[data-id="functionPanel"]', 'checkWinningProposalFailed()', 60000)

@ -122,9 +122,10 @@ export const AssemblyItems = ({ registerEvent }) => {
} }
return ( return (
<div className="border rounded px-1 mt-1 bg-light"> <div className="h-100 border rounded px-1 mt-1 bg-light">
<div className='dropdownpanel'> <div className='dropdownpanel'>
<div className='dropdowncontent'> <div className='dropdowncontent pb-2'>
{ assemblyItems.display.length == 0 && <div>No data available</div> }
<div className="pl-2 my-1 small instructions" data-id="asmitems" id='asmitems' ref={asmItemsRef}> <div className="pl-2 my-1 small instructions" data-id="asmitems" id='asmitems' ref={asmItemsRef}>
{ {
assemblyItems.display.map((item, i) => { assemblyItems.display.map((item, i) => {

@ -1,7 +1,7 @@
import React from 'react' // eslint-disable-line import React from 'react' // eslint-disable-line
import DropdownPanel from './dropdown-panel' // eslint-disable-line import DropdownPanel from './dropdown-panel' // eslint-disable-line
export const CalldataPanel = ({ calldata, className }) => { export const CalldataPanel = ({ calldata, className = "" }) => {
return ( return (
<div id='calldatapanel' className={className}> <div id='calldatapanel' className={className}>
<DropdownPanel dropdownName='Call Data' calldata={calldata || {}} /> <DropdownPanel dropdownName='Call Data' calldata={calldata || {}} />

@ -1,9 +1,9 @@
import React, { useState, useEffect } from 'react' // eslint-disable-line import React, { useState, useEffect } from 'react' // eslint-disable-line
import AssemblyItems from './assembly-items' // eslint-disable-line import AssemblyItems from './assembly-items' // eslint-disable-line
export const CodeListView = ({ registerEvent }) => { export const CodeListView = ({ registerEvent, className = ""}) => {
return ( return (
<div id='asmcodes'> <div className={className} id='asmcodes'>
<AssemblyItems registerEvent={registerEvent} /> <AssemblyItems registerEvent={registerEvent} />
</div> </div>
) )

@ -194,7 +194,7 @@ export const DropdownPanel = (props: DropdownPanelProps) => {
const uniquePanelName = dropdownName.split(' ').join('') const uniquePanelName = dropdownName.split(' ').join('')
return ( return (
<div className="border rounded px-1 mt-1 bg-light"> <div className={props.className + " border rounded px-1 mt-1 bg-light"}>
<div className="py-0 px-1 title" style={headStyle}> <div className="py-0 px-1 title" style={headStyle}>
<div className={state.toggleDropdown ? 'icon fas fa-caret-down' : 'icon fas fa-caret-right'} onClick={handleToggle}></div> <div className={state.toggleDropdown ? 'icon fas fa-caret-down' : 'icon fas fa-caret-right'} onClick={handleToggle}></div>
<div className="name" data-id={`dropdownPanel${uniquePanelName}`} onClick={handleToggle}>{dropdownName}</div><span className="nameDetail" onClick={handleToggle}>{header}</span> <div className="name" data-id={`dropdownPanel${uniquePanelName}`} onClick={handleToggle}>{dropdownName}</div><span className="nameDetail" onClick={handleToggle}>{header}</span>
@ -202,7 +202,7 @@ export const DropdownPanel = (props: DropdownPanelProps) => {
</div> </div>
<div className='dropdownpanel' style={{ display: state.toggleDropdown ? 'block' : 'none' }}> <div className='dropdownpanel' style={{ display: state.toggleDropdown ? 'block' : 'none' }}>
<i className="refresh fas fa-sync" style={{ display: state.updating ? 'inline-block' : 'none' }} aria-hidden="true"></i> <i className="refresh fas fa-sync" style={{ display: state.updating ? 'inline-block' : 'none' }} aria-hidden="true"></i>
<div className='dropdowncontent' style={{ display: state.dropdownContent.display, ...bodyStyle }}> <div className='dropdowncontent pb-2' style={{ display: state.dropdownContent.display, ...bodyStyle }}>
{ {
state.data && state.data &&
<TreeView id="treeView"> <TreeView id="treeView">

@ -1,9 +1,9 @@
import React from 'react' // eslint-disable-line import React from 'react' // eslint-disable-line
import { DropdownPanel } from './dropdown-panel' // eslint-disable-line import { DropdownPanel } from './dropdown-panel' // eslint-disable-line
export const FullStoragesChanges = ({ calldata }) => { export const FullStoragesChanges = ({ calldata, className = "" }) => {
return ( return (
<div id='fullstorageschangespanel'> <div className={className} id='fullstorageschangespanel'>
<DropdownPanel dropdownName='Full Storage Changes' calldata={ calldata || {}} /> <DropdownPanel dropdownName='Full Storage Changes' calldata={ calldata || {}} />
</div> </div>
) )

@ -3,7 +3,7 @@ import DropdownPanel from './dropdown-panel' // eslint-disable-line
import { extractData } from '../../utils/solidityTypeFormatter' // eslint-disable-line import { extractData } from '../../utils/solidityTypeFormatter' // eslint-disable-line
import { ExtractData } from '../../types' // eslint-disable-line import { ExtractData } from '../../types' // eslint-disable-line
export const SolidityLocals = ({ data, message, registerEvent, triggerEvent, className }) => { export const SolidityLocals = ({ data, message, registerEvent, triggerEvent, className = "" }) => {
const [calldata, setCalldata] = useState(null) const [calldata, setCalldata] = useState(null)
useEffect(() => { useEffect(() => {
@ -43,7 +43,7 @@ export const SolidityLocals = ({ data, message, registerEvent, triggerEvent, cla
} }
return ( return (
<div id='soliditylocals' data-id="solidityLocals"> <div className={className} id='soliditylocals' data-id="solidityLocals">
<DropdownPanel <DropdownPanel
dropdownName='Solidity Locals' dropdownName='Solidity Locals'
dropdownMessage={message} dropdownMessage={message}

@ -1,9 +1,9 @@
import React from 'react' // eslint-disable-line import React from 'react' // eslint-disable-line
import DropdownPanel from './dropdown-panel' // eslint-disable-line import DropdownPanel from './dropdown-panel' // eslint-disable-line
export const StepDetail = ({ stepDetail }) => { export const StepDetail = ({ stepDetail, className = "" }) => {
return ( return (
<div id='stepdetail' data-id='stepdetail'> <div className={className} id='stepdetail' data-id='stepdetail'>
<DropdownPanel hexHighlight={false} dropdownName='Step details' calldata={stepDetail || {}} /> <DropdownPanel hexHighlight={false} dropdownName='Step details' calldata={stepDetail || {}} />
</div> </div>
) )

@ -100,13 +100,13 @@ export const VmDebuggerHead = ({ vmDebugger: { registerEvent, triggerEvent } })
return ( return (
<div id='vmheadView' className="mt-1 px-2 d-flex"> <div id='vmheadView' className="mt-1 px-2 d-flex">
<div className='d-flex flex-column pr-2' style={{ flex:1 }}> <div className='d-flex flex-column pr-2' style={{ flex:1 }}>
<FunctionPanel className="" data={functionPanel} /> <FunctionPanel className="pb-1" data={functionPanel} />
<SolidityLocals className="" data={solidityLocals.calldata} message={solidityLocals.message} registerEvent={registerEvent} triggerEvent={triggerEvent} /> <SolidityLocals className="pb-1" data={solidityLocals.calldata} message={solidityLocals.message} registerEvent={registerEvent} triggerEvent={triggerEvent} />
<SolidityState className="" calldata={solidityState.calldata} message={solidityState.message} /> <CodeListView className="pb-2 flex-grow-1" registerEvent={registerEvent} />
</div> </div>
<div className='d-flex flex-column pl-2' style={{ flex:1 }}> <div className='d-flex flex-column pl-2' style={{ flex:1 }}>
<CodeListView registerEvent={registerEvent} /> <SolidityState className="pb-1" calldata={solidityState.calldata} message={solidityState.message} />
<StepDetail stepDetail={stepDetail} /> <StepDetail className="pb-1" stepDetail={stepDetail} />
</div> </div>
</div> </div>
) )

@ -53,17 +53,17 @@ export const VmDebugger = ({ vmDebugger: { registerEvent }, currentBlock, curren
return ( return (
<div id='vmdebugger' className="d-flex"> <div id='vmdebugger' className="d-flex">
<div className='d-flex flex-column pr-2' style={{ flex:1 }}> <div className='d-flex flex-column pr-2' style={{ flex: 1 }}>
<CallstackPanel className="" calldata={callStackPanel} /> <CallstackPanel className="pb-1" calldata={callStackPanel} />
<StackPanel className="" calldata={stackPanel} /> <StackPanel className="pb-1" calldata={stackPanel} />
<MemoryPanel className="" calldata={memoryPanel} /> <MemoryPanel className="pb-1" calldata={memoryPanel} />
<StoragePanel className="" calldata={storagePanel.calldata} header={storagePanel.header} /> <StoragePanel className="pb-1" calldata={storagePanel.calldata} header={storagePanel.header} />
</div> </div>
<div className='d-flex flex-column pl-2' style={{ flex:1 }}> <div className='d-flex flex-column pl-2' style={{ flex: 1 }}>
<CalldataPanel className="" calldata={calldataPanel} /> <CalldataPanel className="pb-1" calldata={calldataPanel} />
<GlobalVariables className="" block={currentBlock} receipt={currentReceipt} tx={currentTransaction} /> <GlobalVariables className="pb-1" block={currentBlock} receipt={currentReceipt} tx={currentTransaction} />
<ReturnValuesPanel dropdownName='Return Value' calldata={returnValuesPanel || {}} /> <ReturnValuesPanel className="pb-1" dropdownName='Return Value' calldata={returnValuesPanel || {}} />
<FullStoragesChangesPanel calldata={fullStoragesChangesPanel} /> <FullStoragesChangesPanel className="pb-1" calldata={fullStoragesChangesPanel} />
</div> </div>
</div> </div>
) )

@ -20,6 +20,7 @@ export type RegisterEventType = (type: string, listener: any) => void // listene
export type TriggerEventType = (type: string, payload: Array<any>) => void export type TriggerEventType = (type: string, payload: Array<any>) => void
export interface DropdownPanelProps { export interface DropdownPanelProps {
dropdownName: string, dropdownName: string,
className?: string,
dropdownMessage?: string, dropdownMessage?: string,
calldata?: { calldata?: {
[key: string]: string [key: string]: string

Loading…
Cancel
Save