Restore artifact count in unified export toast (v1.10.14)

After v1.10.13 deduplicated the export toast to a single emit per
call, the "with N artifact(s)" detail was lost. Restored it without
re-introducing the double-toast pattern:

- Added function-scope `let artifactCount = 0;` at the top of
  exportConversation.
- Set artifactCount = artifactFiles.length inside the artifact
  extraction branch when files are actually found.
- Unified post-save toast now reads:
    artifactCount > 0
      ? "Exported: X with N artifact(s)"
      : "Exported: X"

Both browsers identical.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
tux tucker 2026-05-18 20:48:46 -04:00
parent 8d0e998ea8
commit bec92d687f
5 changed files with 20 additions and 4 deletions

View file

@ -652,6 +652,9 @@ async function exportConversation(conversationId, conversationName) {
const artifactFormat = document.getElementById('artifactFormat').value;
const flattenArtifacts = document.getElementById('flattenArtifacts').checked;
// Tracked at function scope so the unified post-save toast can mention it
let artifactCount = 0;
try {
showToast(`Exporting ${conversationName}...`);
@ -679,6 +682,7 @@ async function exportConversation(conversationId, conversationName) {
const artifactFiles = extractArtifactFiles(data, artifactFormat);
if (artifactFiles.length > 0) {
artifactCount = artifactFiles.length;
// Create a ZIP with artifacts (and optionally conversation)
const zip = new JSZip();
@ -790,7 +794,9 @@ async function exportConversation(conversationId, conversationName) {
// Record export timestamp and refresh display
await saveExportTimestamp(conversationId);
showToast(`Exported: ${conversationName}`);
showToast(artifactCount > 0
? `Exported: ${conversationName} with ${artifactCount} artifact(s)`
: `Exported: ${conversationName}`);
displayConversations();
updateStats();

View file

@ -1,7 +1,7 @@
{
"manifest_version": 3,
"name": "Claude Exporter Beta",
"version": "1.10.13",
"version": "1.10.14",
"description": "Export conversations and artifacts from Claude.ai",
"permissions": [
"activeTab",

View file

@ -1,5 +1,9 @@
# Changelog
## [1.10.14]
- Single-conversation export toast now includes the artifact count when applicable: `Exported: X with N artifact(s)` when artifacts were extracted, `Exported: X` otherwise. Tracked via a function-scope `artifactCount` set inside the extraction branch so the unified post-save toast can read it without restoring the old double-toast pattern.
## [1.10.13]
- Fixed duplicate toast on single-conversation export. `exportConversation` was emitting three toasts on a successful export ("Exporting X...", then a branch-specific "Exported: X with N artifact(s)" or "Exported: X (no artifacts found)", then the unified "Exported: X" at the end). Removed the branch-specific toasts in Chrome — the unified post-save toast already covers all branches. Firefox already had this pattern; Chrome had regressed.

View file

@ -652,6 +652,9 @@ async function exportConversation(conversationId, conversationName) {
const artifactFormat = document.getElementById('artifactFormat').value;
const flattenArtifacts = document.getElementById('flattenArtifacts').checked;
// Tracked at function scope so the unified post-save toast can mention it
let artifactCount = 0;
try {
showToast(`Exporting ${conversationName}...`);
@ -679,6 +682,7 @@ async function exportConversation(conversationId, conversationName) {
const artifactFiles = extractArtifactFiles(data, artifactFormat);
if (artifactFiles.length > 0) {
artifactCount = artifactFiles.length;
// Create a ZIP with artifacts (and optionally conversation)
const zip = new JSZip();
@ -790,7 +794,9 @@ async function exportConversation(conversationId, conversationName) {
// Record export timestamp and refresh display
await saveExportTimestamp(conversationId);
showToast(`Exported: ${conversationName}`);
showToast(artifactCount > 0
? `Exported: ${conversationName} with ${artifactCount} artifact(s)`
: `Exported: ${conversationName}`);
displayConversations();
updateStats();

View file

@ -1,7 +1,7 @@
{
"manifest_version": 2,
"name": "Claude Exporter Beta",
"version": "1.10.13",
"version": "1.10.14",
"description": "Export conversations and artifacts from Claude.ai",
"permissions": [
"activeTab",