Repository navigation
Conversation
Resolves Sorokit#907. Resolves Sorokit#908. Resolves Sorokit#909. Resolves Sorokit#910.
|
@nafiisatu Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #907, closes #908, closes #909, closes #910
#907: ContractInteractionDebugger: dark-mode diff contrast, capped history, replay
What changed
Readable diffs in both themes: Each changed field is now tagged Added, Removed or Changed (
data-diff-kind). Each kind gets its own text, background and border colours from new--color-diff-*tokens inindex.cssandstyles.css. Each token has a dark and a light value, picked for at least 4.5:1 text contrast.JSON viewer colours:
JsonViewnow gets astyleobject that keeps the library's default classes and addssorokit-json-*classes on top. Those classes use new--color-json-*tokens. The library's own palette is meant for light backgrounds only, which is why its keys were unreadable on the dark surface.Storage stays under the quota: The new
compactForStorage()shrinks each history entry before it is saved:ArrayBufferand typed arrays) become a short[bytes: N]placeholderHistory is still limited to 10 entries. If saving still fails with a quota error, the oldest entries are dropped until it fits, so nothing throws. Note: this history lives in
sessionStorage, notlocalStorageas the issue says.Replay: A new
onReplay?: (entry) => voidprop adds a Replay button to each item under Recent invocations.SorobanPanelhandles it by filling the form back in with the entry's contract ID, method and arguments, so the same call can be sent again.Tests: in
ContractInteractionDebugger.test.tsx, covering the diff-kind tagging, the JSON viewer classes, byte-buffer and string truncation, the 10-entry limit, no exception on a quota error, and the replay button (including that it is hidden when there is no handler).#908: ContractEventFeed: unmount cleanup, readable topics, auto-scroll pause
What changed
getEventsresponse that arrives later is ignored.TopicTag's "copied" timer is cleared too.src/lib/scval.ts, a small decoder for base64 XDRScValvalues with no new dependency (the package avoids SDK dependencies on purpose).G…orC…strings. For this,utils.tsnow exportsencodeAccountAddressandencodeContractAddress, built on its existing encoding helpers.max-h-[480px]).Tests: in
ContractEventFeed.test.tsx(topic decoding, copying the decoded value, non-XDR topics shown unchanged, no timers left after unmount, a late response ignored after unmount, following new events, and pausing/resuming auto-scroll). There are also decoder unit tests insrc/lib/scval.test.ts.#909: SorobanScreen: clear contract on network switch, delete icon, end-to-end test
What changed
network.namefromuseSorokitchanges, the active contract is cleared. That also unmounts its event feed and resets the panel, so no cross-network RPC requests are sent. A warning that can be dismissed explains which contract was cleared and why.nullto a value) does not count as a switch, so a contract pre-filled from history is kept.Delete01Icon) instead of the plain "×". The aria-label is the same and it still removes the contract from storage.Tests: in
SorobanScreen.test.tsx: the contract is cleared with a warning on a network switch, kept on the first network load, no warning appears when no contract is active, and the warning can be dismissed. There is also an end-to-end test: pick a saved contract → load an ABI (method suggestions appear) → enter method and arguments and submit → result shown → open the debugger and see the simulation and gas breakdown.#910: ContractInteractionBuilder: boundary, bool and Option tests
Only tests changed.
u32,i32,u64,i64,u128,i128), includingu32::MAX,i64::MINandu128::MAX. Each one checks that the exact digits show up both in the decoded call preview and in theonParamsReadyargs, with no rounding to a JS number. It also checks that 32/64-bit types use number inputs and 128-bit types use text inputs."",true,false), that Generate stays disabled until a value is picked, and that both values are passed through.setTimeoutor other timing-based assertions in this file. Every new test is synchronous and uses no timers.Testing
Per the task rules, I didn't run the builds, tests or linters. All changes were checked by reading the code only.
Closes #907
Closes #908
Closes #909
Closes #910