Skip to content

Minor cleanups in App: input jank, accept extensions, redundant boolean - #41

Merged
rmuratov merged 1 commit into
mainfrom
app-minor-cleanups
Jul 12, 2026
Merged

Minor cleanups in App: input jank, accept extensions, redundant boolean#41
rmuratov merged 1 commit into
mainfrom
app-minor-cleanups

Conversation

@rmuratov

Copy link
Copy Markdown
Owner

Closes #33

Three small items from the code review:

  • Large-paste jank: the source map textarea state is now only updated after parsing. A pasted multi-megabyte map no longer lands in the controlled value for one frame; React's controlled-value restoration keeps the textarea visually empty while the map parses, and on failure the text reappears together with the warning so it can still be edited. (An explicit event.target.value = '' reset for the rejected-duplicate case turned out to be unnecessary for the same reason — verified by a dedicated test.)
  • accept: the file picker now also accepts .json, which source maps are often stored as.
  • setIsSourceMapInputError(Boolean(text) && true)setIsSourceMapInputError(Boolean(text)).

Tests

Three new tests: the pasted text must not be rendered into the textarea while parsing (an unrelated re-render mid-parse syncs the controlled value, which must be empty), a rejected duplicate leaves the textarea empty, and the file picker advertises .map,.txt,.json. The first and third fail on main without the fix (verified via git stash).

Coverage stays at 100%.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying sourcemap-tools with  Cloudflare Pages  Cloudflare Pages

Latest commit: ad372e0
Status: ✅  Deploy successful!
Preview URL: https://40793430.sourcemap-tools.pages.dev
Branch Preview URL: https://app-minor-cleanups.sourcemap-tools.pages.dev

View logs

@codecov

codecov Bot commented Jul 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (1f5efa9) to head (ad372e0).

Additional details and impacted files
@@            Coverage Diff            @@
##              main       #41   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            9         9           
  Lines          210       210           
  Branches        55        54    -1     
=========================================
  Hits           210       210           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@rmuratov
rmuratov merged commit 5346344 into main Jul 12, 2026
4 checks passed
@rmuratov
rmuratov deleted the app-minor-cleanups branch July 12, 2026 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Minor cleanups in App

1 participant