Fuzzer: show per-item copy button for every case; add structured download (header + tabbed lines)

This commit is contained in:
EP
2025-08-20 21:13:08 -07:00
parent 5230a340e7
commit 36ed8401e9
3 changed files with 14 additions and 2 deletions
+2
View File
@@ -250,6 +250,8 @@ h1, h2, h3, h4, h5 {
.output-container {
position: relative;
}
.fuzzer-list .token-chip { position: relative; }
.fuzzer-list .token-chip .copy-button { position: static; }
.section-header {
margin-bottom: 15px;
+1 -1
View File
@@ -433,7 +433,7 @@
<button class="copy-button" v-if="fuzzerOutputs.length" @click="downloadFuzz"><i class="fas fa-download"></i> Download</button>
</div>
<div class="output-container" v-if="fuzzerOutputs.length">
<div class="token-tiles" style="display:flex; flex-direction:column; gap:8px;">
<div class="token-tiles fuzzer-list" style="display:flex; flex-direction:column; gap:8px;">
<div v-for="(out, i) in fuzzerOutputs" :key="'fz-'+i" class="token-chip" style="display:flex; align-items:center; gap:8px;">
<span style="opacity:.7; min-width:32px;">#{{ i+1 }}</span>
<textarea :value="out" readonly style="flex:1; min-height:46px;"></textarea>
+11 -1
View File
@@ -1778,7 +1778,17 @@ window.app = new Vue({
},
copyAllFuzz() { this.copyToClipboard(this.fuzzerOutputs.join('\n')); },
downloadFuzz() {
const blob = new Blob([this.fuzzerOutputs.join('\n')], { type: 'text/plain;charset=utf-8' });
const lines = this.fuzzerOutputs.map((s, i) => `#${i+1}\t${s}`).join('\n');
const header = `# Parseltongue Fuzzer Output\n# count=${this.fuzzerOutputs.length}\n# seed=${this.fuzzerSeed || ''}\n# strategies=${[
this.fuzzUseRandomMix?'randomMix':null,
this.fuzzZeroWidth?'zeroWidth':null,
this.fuzzUnicodeNoise?'unicodeNoise':null,
this.fuzzWhitespace?'whitespace':null,
this.fuzzCasing?'casing':null,
this.fuzzZalgo?'zalgo':null,
this.fuzzEncodeShuffle?'encodeShuffle':null
].filter(Boolean).join(',')}\n`;
const blob = new Blob([header + lines + '\n'], { type: 'text/plain;charset=utf-8' });
const url = URL.createObjectURL(blob);
const a = document.createElement('a'); a.href = url; a.download = 'fuzz_cases.txt'; a.click();
setTimeout(()=>URL.revokeObjectURL(url), 200);