fix: repair unclosed blocks left by merges in FeeEstimator and SorobanPanel - #421
Merged
k-deejah merged 1 commit intoJul 30, 2026
Conversation
…nPanel
Both files carried two interleaved versions of the same code from botched
conflict resolutions, leaving unclosed blocks. They failed to parse, so
`tsc -b` and `npm run build` aborted and every test file importing them
could not run.
FeeEstimator:
- `load()` had two copies of the onFeeLoad guard, the first unclosed.
- Props declared both `compact` and `variant`; the render body contained a
`compact` branch wrapping an orphaned `variant` branch plus a duplicate
header. Kept the `compact` API the existing tests exercise and dropped the
untested, uncalled `variant` duplicate.
SorobanPanel:
- `buildCurlCommand` was defined twice, the first copy unclosed. Kept the
version the tests assert against (soroban-rpc.example.com/invoke).
- The `else` branch of `doInvoke` was left unclosed by a trailing fragment
of the older single-call implementation.
- The submit button's label ternary had a `?` where a `:` belonged.
- Dropped the now-unused `cn` import and a redundant `state === "loading"`
check that TypeScript proved unreachable via `canInvoke`.
SorobanPanel.test.tsx:
- A truncated test body left `describe("simulate mode")` unclosed. Completed
the textarea-growth test to match its name and removed a dead constant.
Restores 5 test files and 57 previously unrunnable tests.
4 tasks
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.
Problem
src/components/FeeEstimator.tsxandsrc/components/SorobanPanel.tsxonmaineach contain two interleaved versions of the same code, left behind by botched conflict resolutions. The result is unclosed blocks, so neither file parses:Because they don't parse,
tsc -baborts,npm run buildfails, and every test file that imports either component fails to collect.src/components/SorobanPanel.test.tsxis broken the same way — a truncated test body left adescribeunclosed.The breakage traces to commit
f50710c(subject:test(ui): resolve 324 - add tests for Badge, Input, and FeeEstimator), which mangled the components while adding tests;76718b0is the last commit whereFeeEstimator.tsxstill parsed.What this changes
Everything here is limited to removing duplicated fragments and restoring the intended structure. Where two versions of a behaviour existed, I kept the one the existing test suite asserts against, so no test expectations were rewritten to fit the code.
FeeEstimator.tsx
load()had two copies of theonFeeLoadguard, the first unclosed.compact?: booleanandvariant?: "default" | "compact", and the render body had acompactbranch wrapping an orphanedvariantbranch plus a duplicate header/refresh button. Kept thecompactAPI —FeeEstimator.test.tsxrenders<FeeEstimator compact />and asserts the"Base: … · Recommended: …"string, whilevarianthad no tests and no callers.SorobanPanel.tsx
buildCurlCommandwas defined twice, the first copy unclosed. Kept the version the tests assert against (https://soroban-rpc.example.com/invoke).elsebranch ofdoInvokewas left unclosed by a trailing fragment of the older single-call implementation.?where a:belonged.cnimport, and a redundantstate === "loading"indisabled={!canInvoke || state === "loading"}— TypeScript flags it as unreachable (TS2367) becausecanInvokealready requiresstate !== "loading".SorobanPanel.test.tsx
describe("simulate mode"), and completed the truncated"grows the argument textarea…"test to match its name (assertsrowsstarts at 3, grows to 6 on multi-line input, and keepsresize-y). Removed a deadHISTORY_KEYconstant.Result
main(5bc3678)5 test files and 57 previously-unrunnable tests are restored. Failures rise 61 → 67 because the recovered files now actually execute; those 6 are real pre-existing failures that the parse errors had been hiding, not regressions.
tsc -breports zero errors for both repaired files, and ESLint is clean onFeeEstimator.tsxandSorobanPanel.test.tsx.What this deliberately does not fix
npm run buildstill does not pass. With the files parsing,tsc -bnow surfaces 65 pre-existing type errors across 25 files that were previously masked — mostly unused imports (33 × TS6133), plus missing exports, two wrong icon identifiers inActivityTimeline.tsx, and duplicate identifiers. That's a repo-wide cleanup overlapping several other open issues, so I've kept this PR to the parse-level damage that was blocking everything.Two pre-existing ESLint errors also remain in
SorobanPanel.tsx(react-hooks/refsat theargsRef.current = argsrender assignment, andreact-hooks/set-state-in-effectin the contractId-reset effect). Both are behavioural changes rather than syntax repair, so they're out of scope here — happy to take them in a follow-up.Correction: an earlier revision of this description quoted that commit subject verbatim, including its
#324. GitHub read it as a closing reference and auto-closed #324 when this PR merged. #324 is unrelated to this repair and is assigned to @sweetsoul21 — it needs reopening, and I do not have permission to do it myself. The reference above is now defanged so it will not recur. Apologies for the noise.