feat: add reveal paste-back tool + fix smart detection bail

Test tab now has two modes:
- Strip (real → fake): paste text with real data, see what gets sent
- Reveal (fake → real): paste AI output with fake data, get back
  real data with a "Copy to Clipboard" button

Also fixes:
- content.js smartSubstitute bailing when identity.enabled was
  undefined (defaulted enabled to all-true instead of returning)
- Test tab now reloads identity from storage on tab switch so
  changes saved in the Identity tab take effect immediately
- Shows yellow warning when identity fields are missing

https://claude.ai/code/session_01Dvgwe7XMoSxnWXkih8p1Cw
This commit is contained in:
Claude
2026-03-26 00:44:35 +00:00
parent 60b810b1b9
commit 7176cf6509
4 changed files with 227 additions and 37 deletions
+26 -6
View File
@@ -141,13 +141,33 @@
<!-- Test Tab -->
<section class="tab-content" id="tab-test">
<p class="help-text">Type text containing your real values to see what would be sent.</p>
<textarea id="testInput" class="textarea" placeholder="Try: My name is John Smith, email john@gmail.com, logged in as jsmith@macbook-pro" rows="4"></textarea>
<div class="diff-view" id="diffView">
<div class="diff-label">What gets sent:</div>
<div class="diff-output" id="diffOutput"></div>
<div class="test-mode-toggle">
<button class="test-mode-btn active" data-mode="strip">Strip (real &rarr; fake)</button>
<button class="test-mode-btn" data-mode="reveal">Reveal (fake &rarr; real)</button>
</div>
<div class="diff-stats" id="diffStats"></div>
<div id="stripMode">
<p class="help-text">Paste text with your real info. See what gets sent.</p>
<textarea id="testInput" class="textarea" placeholder="Try: My name is John Smith, email john@gmail.com, logged in as jsmith@macbook-pro" rows="4"></textarea>
<div class="diff-view" id="diffView">
<div class="diff-label">What gets sent:</div>
<div class="diff-output" id="diffOutput"></div>
</div>
<div class="diff-stats" id="diffStats"></div>
</div>
<div id="revealMode" style="display:none">
<p class="help-text">Paste text from AI responses (with fake data). Get back real data to copy.</p>
<textarea id="revealInput" class="textarea" placeholder="Paste AI output here, e.g.: Hello Alex Demo, I see your project at /home/ademo/..." rows="4"></textarea>
<div class="diff-view" id="revealView">
<div class="diff-label">Your real data:</div>
<div class="diff-output" id="revealOutput"></div>
</div>
<button class="btn btn-primary" id="btnCopyRevealed" style="width:100%;margin-top:8px">Copy to Clipboard</button>
<div class="diff-stats" id="revealStats"></div>
</div>
<div class="test-identity-status" id="identityStatus"></div>
</section>
<!-- Footer -->