Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

New feature: Visual debugger for Truffle Dashboard #6058

Merged
merged 189 commits into from
Jul 14, 2023
Merged
Changes from 1 commit
Commits
Show all changes
189 commits
Select commit Hold shift click to select a range
aad0afa
dashboard: Debugger WIP
Feb 3, 2023
0cc368f
WIP: hack on getting the debugger working in dashboard
eggplantzzz Feb 17, 2023
0e5b8ba
hack out the state for keeping track of sources and debugger session
eggplantzzz Feb 22, 2023
82d9337
get rid of unnecessary component, type some things, and use provider …
eggplantzzz Feb 23, 2023
e41bc51
fetch verified source material after loading compilations from browser
eggplantzzz Feb 27, 2023
f268631
use loop instead of reduce for finding unknown addresses affected
eggplantzzz Feb 27, 2023
23327f2
get scroll working crudely and provide error message when tx hash not…
eggplantzzz Feb 27, 2023
7efccc7
add new inspect lib, create Variables component, and update operation…
eggplantzzz Mar 1, 2023
b7eead5
get rid of $ assignment
eggplantzzz Mar 1, 2023
c13218a
only call scrollIntoView when the ref exists
eggplantzzz Mar 2, 2023
32c47f0
keep track of unknown sources so we can display something useful in t…
eggplantzzz Mar 2, 2023
59d9685
add a couple of deps to useEffect callback to make React happy
eggplantzzz Mar 6, 2023
5db2df3
add plumbing for keeping track of debugger breakpoints
eggplantzzz Mar 7, 2023
e382389
add click handler on source lines to handle breakpoints and create Un…
eggplantzzz Mar 7, 2023
b733742
update UI when the user clicks on a line to set a breakpoint
eggplantzzz Mar 7, 2023
ee50336
update debugger when setting breakpoints
eggplantzzz Mar 8, 2023
d744047
improve rendering of variables
eggplantzzz Mar 8, 2023
6191736
update mantine packages to latest of version 5
eggplantzzz Mar 9, 2023
4ba3e38
WIP - work on the css for debugger view
eggplantzzz Mar 13, 2023
7264e07
when stepping, make content center in the scrollable container
eggplantzzz Mar 13, 2023
33bfe44
edit styles and component structure a little bit
eggplantzzz Mar 15, 2023
f5f38fc
start work on arranging for a way to set the current source manually
eggplantzzz Mar 16, 2023
5c19ab7
move initDebugger into the utils folder
eggplantzzz Mar 16, 2023
7f36977
use generic html element dom manipulation for jumping to source line
eggplantzzz Mar 17, 2023
d37df9a
remove unnecessary stuff from callback
eggplantzzz Mar 17, 2023
a3a38f9
correct bug with class construction and rename method
eggplantzzz Mar 17, 2023
03eaeac
create delete breakpoint method and use it in breakpoint section
eggplantzzz Mar 20, 2023
dc9d283
give mouse pointer a hover state while over breakpoints
eggplantzzz Mar 21, 2023
30f7937
add source text processing fully into the utils
eggplantzzz Mar 22, 2023
dc49dea
add hacky method for fully supporting multiline comments
eggplantzzz Mar 22, 2023
d7edeba
update useEffects to better deal with autoscrolling as debugger steps
eggplantzzz Mar 22, 2023
71141c4
optimize renders and add type predicate
eggplantzzz Mar 22, 2023
03b8b66
add some comments and pass etherscan api key to source-fetcher if it …
eggplantzzz Mar 29, 2023
3e34868
bump react-dom-router to ^6.10.0
eggplantzzz Mar 31, 2023
8120bed
create simulate tx button and adjust some method signatures in sessio…
eggplantzzz Mar 31, 2023
1693b4f
edit some css and fix a bug involving passing the provider
eggplantzzz Mar 31, 2023
6cf7f7e
add stack component, update useEffects, and start working on notifica…
eggplantzzz Apr 4, 2023
d813e05
rework layout leveraging mantine more
eggplantzzz Apr 7, 2023
5d6ba2f
update html a bit and the scrolling algorithm
eggplantzzz Apr 12, 2023
243342e
remove contracts module from dashboard
eggplantzzz Apr 12, 2023
a32c48f
dashboard: Debugger WIP
Feb 3, 2023
309bccc
hack out the state for keeping track of sources and debugger session
eggplantzzz Feb 22, 2023
6957841
get scroll working crudely and provide error message when tx hash not…
eggplantzzz Feb 27, 2023
b85dc48
add new inspect lib, create Variables component, and update operation…
eggplantzzz Mar 1, 2023
9862778
only call scrollIntoView when the ref exists
eggplantzzz Mar 2, 2023
3bbcd1d
keep track of unknown sources so we can display something useful in t…
eggplantzzz Mar 2, 2023
13a306c
add plumbing for keeping track of debugger breakpoints
eggplantzzz Mar 7, 2023
2503461
update debugger when setting breakpoints
eggplantzzz Mar 8, 2023
7285d1a
WIP - work on the css for debugger view
eggplantzzz Mar 13, 2023
ba31acb
when stepping, make content center in the scrollable container
eggplantzzz Mar 13, 2023
1f94e9d
start work on arranging for a way to set the current source manually
eggplantzzz Mar 16, 2023
56e8ee8
use generic html element dom manipulation for jumping to source line …
eggplantzzz Mar 17, 2023
9468597
create delete breakpoint method and use it in breakpoint section
eggplantzzz Mar 20, 2023
c590095
give mouse pointer a hover state while over breakpoints
eggplantzzz Mar 21, 2023
883fc67
update useEffects to better deal with autoscrolling as debugger steps
eggplantzzz Mar 22, 2023
10d9d68
optimize renders
eggplantzzz Mar 22, 2023
8e3bf27
update html a bit, some styles, and the scrolling algorithm
eggplantzzz Apr 12, 2023
ea8b400
keep werkin that design
eggplantzzz Apr 14, 2023
46b1895
give individual panes nice, curvy corners and update stack
eggplantzzz Apr 14, 2023
299864d
update unknown source display, add more css, and try a different disp…
eggplantzzz Apr 17, 2023
6ea2853
update background color for uknown source in dark mode and update bre…
eggplantzzz Apr 17, 2023
5025c93
reword message
eggplantzzz Apr 17, 2023
0f125de
set reasonable scroll amount
eggplantzzz Apr 17, 2023
f41863a
refine breakpoint design
eggplantzzz Apr 18, 2023
785c61b
remove notification on error, text in header, and style header
eggplantzzz Apr 19, 2023
fc997f4
move some css into component and tweak input stuff
eggplantzzz Apr 19, 2023
ca84e66
continue moving css to component files
eggplantzzz Apr 19, 2023
1b890c3
move all debugger logic into the Debugger folder
eggplantzzz Apr 20, 2023
fbadf0b
add padding to breakpoints and tweak border radius for sources
eggplantzzz Apr 21, 2023
e5bd017
add component for displaying preparation progress
eggplantzzz Apr 21, 2023
949318e
keep unknown addresses in the global state
eggplantzzz Apr 21, 2023
c858b28
tighten up some more styling and add naive implementation of preparin…
eggplantzzz Apr 24, 2023
6314ac5
rearrange some code and make active source tab a different color
eggplantzzz Apr 24, 2023
acb0f22
fix issue with debugger line numbering and breakpoint system
eggplantzzz Apr 24, 2023
e7006ef
tweak colors for active/inactive tabs on sources
eggplantzzz Apr 25, 2023
e17c880
add tooltips to control buttons
eggplantzzz Apr 25, 2023
0ffeaf1
add new inactive status for welcome page and add loading spinner
eggplantzzz Apr 25, 2023
8a2cfa1
create home page for debugger and store etherscan api key in global s…
eggplantzzz Apr 26, 2023
1887513
use mantine hook for interacting with local storage and remove unnece…
eggplantzzz Apr 26, 2023
f1e4b9c
tweak text for etherscan key and update styling
eggplantzzz Apr 26, 2023
2307471
remove border from input
eggplantzzz Apr 26, 2023
0a5640d
further develop etherscan prompt
eggplantzzz Apr 26, 2023
b66d22a
adjust color of prompt container for dark mode
eggplantzzz Apr 26, 2023
46aa95c
add background color change for active navbar item and update css for…
eggplantzzz Apr 27, 2023
c29d4ab
re-add disabled prop to nav buttons and make background color consist…
eggplantzzz Apr 27, 2023
af95494
rework how ganache/provider options are passed through init functions
eggplantzzz Apr 27, 2023
98a8390
instead of passing provider, pass network id through init functions
eggplantzzz Apr 27, 2023
a667627
group network id and etherscan key under one parameter named fetching…
eggplantzzz Apr 27, 2023
c12be50
add simple error notification when there is an issue with debugger in…
eggplantzzz Apr 28, 2023
43d411b
slightly re-work design for tx signer dialogue
eggplantzzz Apr 28, 2023
e673036
add some more info to error notification
eggplantzzz Apr 28, 2023
9bf7516
tweak error notification design
eggplantzzz Apr 28, 2023
b2fa4f5
update etherscan message and tweak scrolling algorithm
eggplantzzz May 1, 2023
ff33eb0
match active color for sidebar items to the bottom left button backgr…
eggplantzzz May 2, 2023
32e839f
hook up input field and use test tx hash as a backup
eggplantzzz May 2, 2023
cfe37cb
style to fix a bug where content went offscreen
eggplantzzz May 3, 2023
296ad79
indent variable names in display
eggplantzzz May 3, 2023
f9b4234
remove object-inspect from project and add fetch-and-compile to dashb…
eggplantzzz May 4, 2023
628aeec
use flex elements to alleviate weird scrolling issue and remove unnec…
eggplantzzz May 4, 2023
1b32190
make another naive attempt at getting the stack information correct
eggplantzzz May 4, 2023
fda1207
make tabs for sources scroll instead of stacking
eggplantzzz May 5, 2023
0d216fd
update ResultInspector to take options
eggplantzzz May 4, 2023
5bffa5f
check to make sure an affected address is a contract and not an EOA
eggplantzzz May 5, 2023
a621208
save fetched compilations in the browser
eggplantzzz May 5, 2023
af5eafd
check to see if a session is loaded so a debugger session doesn't van…
eggplantzzz May 10, 2023
343c3db
make block highlighting include whitespace at start of lines
eggplantzzz May 11, 2023
6ba3cdd
scroll only when debugger steps or current source changes
eggplantzzz May 11, 2023
b4e4548
fix block highlighting issue
eggplantzzz May 11, 2023
3e299da
make continue until breakpoint button inactive until one is set
eggplantzzz May 11, 2023
6991d29
Revert "fix block highlighting issue"
eggplantzzz May 12, 2023
3f04c11
remove testing tx hashes
eggplantzzz May 12, 2023
7fabfa3
disable submit button when no tx hash is in input and remove some css
eggplantzzz May 12, 2023
2e88553
remove duplicate entries in dashboard package.json and update to curr…
eggplantzzz May 25, 2023
167b07d
use vs code icons for debugger buttons
eggplantzzz May 26, 2023
c7c4b26
improve block highlighting
eggplantzzz May 30, 2023
e0ff7f5
add some comments and correct property name
eggplantzzz Jun 1, 2023
ea9a306
clean up some unnecessary code snippets
eggplantzzz Jun 1, 2023
4710170
make some corrections based on react warnings
eggplantzzz Jun 1, 2023
3ad37ae
handle case when the source range has an undefined source id
eggplantzzz Jun 1, 2023
6813d28
highlight the line numbers on lines that have highlighting
eggplantzzz Jun 1, 2023
1a2470e
make some refinements based on the design
eggplantzzz Jun 2, 2023
11b1312
narrow error notification box, wrap text when too long, and remove im…
eggplantzzz Jun 5, 2023
64e2984
refine the etherscan api key message and move a line of code
eggplantzzz Jun 5, 2023
0e6572d
adjust some types related to visual debugger state
eggplantzzz Jun 7, 2023
f91f382
handle when the fetch request for source material is not ok
eggplantzzz Jun 8, 2023
9e9cbd9
clean up after rebase mistakes
eggplantzzz Jun 8, 2023
b820032
make Ganache fork the current block instead of 5 blocks behind the cu…
eggplantzzz Jun 9, 2023
4b07e3b
fix debug button that broke
eggplantzzz Jun 9, 2023
ed054c2
clean up another rebase mistake
eggplantzzz Jun 13, 2023
d6d9094
add emojis to the etherscan api key message
eggplantzzz Jun 13, 2023
34dfa6e
make button icons larger
eggplantzzz Jun 13, 2023
2f564ef
add a check to make sure the source id is defined before setting
eggplantzzz Jun 13, 2023
9696257
limit ganache output in preparing screen to 6 lines
eggplantzzz Jun 14, 2023
c24e469
fix some spacing issues related to source material
eggplantzzz Jun 14, 2023
cc6f5d3
Use codec-components inside Dashboard Debugger
gnidan Jun 14, 2023
583f6fe
dashboard: Import codec components styles
cliffoo Jun 14, 2023
bc697dd
complete html broken when we chop up the source code and use   f…
eggplantzzz Jun 20, 2023
a47bfe9
separate source material into two panes: line number and source material
eggplantzzz Jun 21, 2023
66e6173
remove some unnecessary imports, some unused libs, update some deps, …
eggplantzzz Jun 22, 2023
72f8485
Display variables in <ul> with <NameValuePair>
gnidan Jun 22, 2023
1bcfa2a
update preparing session message
eggplantzzz Jun 23, 2023
892eefb
add another step for preparation and put it in 'prep' mode earlier to…
eggplantzzz Jun 23, 2023
87c348a
add comment about why we add highlighting tags at the end of html pro…
eggplantzzz Jun 26, 2023
2b26bc1
add in hacky thing to deal with some instances of bad source maps
eggplantzzz Jun 26, 2023
b1a6fea
update yarn.lock
eggplantzzz Jun 27, 2023
2db4381
don't set breakpoints on source code but only the margin
eggplantzzz Jun 27, 2023
a7543a7
make input responsive to enter key press
eggplantzzz Jun 29, 2023
bda3aa1
make syntax highlighting more Truffle-y
eggplantzzz Jul 5, 2023
19a73d2
bump ganache to 7.9.0 in dashboard and set some truffle deps to the c…
eggplantzzz Jul 6, 2023
f3ebfd5
replace accidentally deleted dependency and update yarn.lock
eggplantzzz Jul 6, 2023
906ef8f
dashboard: Improve contrast in debugger
cliffoo Jul 6, 2023
38d7240
remove some unused styling
eggplantzzz Jul 7, 2023
927ba36
get rid of border from mantine component
eggplantzzz Jul 7, 2023
23572a6
remove argument from fetch and compile route
eggplantzzz Jul 7, 2023
d38e76c
set border-radius property properly
eggplantzzz Jul 7, 2023
391c042
remove unused styling classes
eggplantzzz Jul 7, 2023
fe57147
change name of button from 'SimulateTx' to 'Debug'
eggplantzzz Jul 7, 2023
f56a7c7
add type
eggplantzzz Jul 7, 2023
a68a77f
Update packages/dashboard/src/components/composed/Debugger/Variables.tsx
eggplantzzz Jul 7, 2023
36a9998
move etherscan api key name to constants
eggplantzzz Jul 7, 2023
576ae9c
cast window.ethereum as any to get rid of some ts-ignores
eggplantzzz Jul 7, 2023
2a1d01b
get rid of unnecessary flex
eggplantzzz Jul 10, 2023
44e8c9d
Update packages/dashboard/src/components/composed/Debugger/PreparingS…
eggplantzzz Jul 10, 2023
29bede6
remove unnecessary escapes
eggplantzzz Jul 10, 2023
4704330
re-add flex
eggplantzzz Jul 10, 2023
24177e2
use constant
eggplantzzz Jul 10, 2023
7de1f79
move some styles into the component file and remove unused class
eggplantzzz Jul 10, 2023
31c9d30
Update packages/dashboard/src/components/composed/Debugger/Sources/in…
eggplantzzz Jul 10, 2023
9729d8b
change type of variable and get rid of some ts-ignores
eggplantzzz Jul 10, 2023
72ff67c
remove method that was replaced and never removed
eggplantzzz Jul 10, 2023
3527792
re-add hover state for inactive navbar tabs
eggplantzzz Jul 10, 2023
393cd4b
add two methods to session type and remove some ts-ignores
eggplantzzz Jul 11, 2023
5babf90
use non-null assertion instead of conditional logic and use createSty…
eggplantzzz Jul 11, 2023
42d496d
revert changes to the try in fetch-and-compile route
eggplantzzz Jul 11, 2023
92cd396
get rid of method
eggplantzzz Jul 11, 2023
98ae2ec
correct type for operations
eggplantzzz Jul 11, 2023
7e6c1d1
move string constants next to the others
eggplantzzz Jul 11, 2023
13ceee4
update mantine-related classes and add eslint ignore comment
eggplantzzz Jul 12, 2023
f7fa66b
update one more mantine-related class and use empty string instead of…
eggplantzzz Jul 12, 2023
e9a00dc
eslint ignore entire file, cast window.ethereum as any, and remove un…
eggplantzzz Jul 12, 2023
860c006
get rid of some unnecessary css stuff
eggplantzzz Jul 12, 2023
beef549
change how highlighted class is stored in constants and update code u…
eggplantzzz Jul 12, 2023
6739448
narrow the scope of the eslint ignore
eggplantzzz Jul 12, 2023
47a71d3
remove console.log
eggplantzzz Jul 12, 2023
0de3172
conditionally add tooltip to fix an issue where it won't disappear wh…
eggplantzzz Jul 12, 2023
e628520
re-work Variables component to store raw data in state and calculate …
eggplantzzz Jul 13, 2023
e86fc8f
store stack report data in state and use that for the render
eggplantzzz Jul 13, 2023
5ec4f32
dashboard: Fix debug button styles
cliffoo Jul 14, 2023
4c74c93
dashboard: Clean up ganache indexeddb on start
cliffoo Jul 14, 2023
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
Prev Previous commit
Next Next commit
Update packages/dashboard/src/components/composed/Debugger/Sources/in…
…dex.tsx

Co-authored-by: cliffoo <41348973 [email protected]>
  • Loading branch information
eggplantzzz and cliffoo committed Jul 14, 2023
commit 31c9d30367e5c9a44ba2e968bb93968e07ae1641
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 89,7 @@ function Sources({
// display the first source when currentSourceRange is `undefined`
useEffect(() => {
if (currentSourceId === undefined) {
const sourceIds = sources.map(({ id }) => id);
setCurrentSourceId(sourceIds[0]);
setCurrentSourceId(sources[0].id);
}
}, [sources, currentSourceId, setCurrentSourceId]);

Expand Down