ux(classifier): relabel the two JSON surfaces so their purpose is clear
Two exports for two different consumers were both just "Export". Name them: - Classification (header, AI round-trip): "Export for editing" / "Import edits" — a filename-per-file JSON with no scanned tree, meant to be hand/AI-edited and re-imported. Download suffix is now .zddc-classification.json. - Workspace (welcome screen, transfer/backup): "Import workspace" + a row "Export" tooltip spelling out it carries the snapshot + classifications for moving between browsers. Download suffix stays .zddc-workspace.json. Each tooltip points at the other so they're not confused. Also wire workspace.activeName (referenced by the dataset export but never exported), so a classification file is named after its workspace. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
533b830d2c
commit
e2c2d1571d
3 changed files with 10 additions and 4 deletions
|
|
@ -259,7 +259,7 @@
|
||||||
var url = URL.createObjectURL(blob);
|
var url = URL.createObjectURL(blob);
|
||||||
var a = document.createElement('a');
|
var a = document.createElement('a');
|
||||||
a.href = url;
|
a.href = url;
|
||||||
a.download = String(name).replace(/[^\w.-]+/g, '_') + '.json';
|
a.download = String(name).replace(/[^\w.-]+/g, '_') + '.zddc-classification.json';
|
||||||
document.body.appendChild(a); a.click(); a.remove();
|
document.body.appendChild(a); a.click(); a.remove();
|
||||||
URL.revokeObjectURL(url);
|
URL.revokeObjectURL(url);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -108,10 +108,15 @@
|
||||||
|
|
||||||
var actions = document.createElement('div');
|
var actions = document.createElement('div');
|
||||||
actions.className = 'ws-row__actions';
|
actions.className = 'ws-row__actions';
|
||||||
|
var titles = {
|
||||||
|
export: 'Export this whole workspace (scanned snapshot + classifications) to transfer to another browser or back up',
|
||||||
|
delete: 'Delete this workspace — your source files are untouched',
|
||||||
|
};
|
||||||
[['open', 'Open'], ['rename', 'Rename'], ['export', 'Export'], ['delete', 'Delete']].forEach(function (a) {
|
[['open', 'Open'], ['rename', 'Rename'], ['export', 'Export'], ['delete', 'Delete']].forEach(function (a) {
|
||||||
var b = document.createElement('button');
|
var b = document.createElement('button');
|
||||||
b.className = 'btn btn-sm ' + (a[0] === 'open' ? 'btn-primary' : 'btn-secondary');
|
b.className = 'btn btn-sm ' + (a[0] === 'open' ? 'btn-primary' : 'btn-secondary');
|
||||||
b.dataset.act = a[0]; b.textContent = a[1];
|
b.dataset.act = a[0]; b.textContent = a[1];
|
||||||
|
if (titles[a[0]]) b.title = titles[a[0]];
|
||||||
actions.appendChild(b);
|
actions.appendChild(b);
|
||||||
});
|
});
|
||||||
row.appendChild(main); row.appendChild(actions);
|
row.appendChild(main); row.appendChild(actions);
|
||||||
|
|
@ -374,5 +379,6 @@
|
||||||
onRescanned: onRescanned,
|
onRescanned: onRescanned,
|
||||||
renderList: renderList,
|
renderList: renderList,
|
||||||
activeId: function () { return activeId; },
|
activeId: function () { return activeId; },
|
||||||
|
activeName: function () { return activeMeta ? activeMeta.name : null; },
|
||||||
};
|
};
|
||||||
})();
|
})();
|
||||||
|
|
|
||||||
|
|
@ -162,8 +162,8 @@
|
||||||
<div class="pane-header-right">
|
<div class="pane-header-right">
|
||||||
<span id="classifyStats" class="file-stats"></span>
|
<span id="classifyStats" class="file-stats"></span>
|
||||||
<span class="header-divider">|</span>
|
<span class="header-divider">|</span>
|
||||||
<button id="exportDatasetBtn" class="btn btn-secondary btn-sm" title="Export the classification dataset (trees + assignments) as JSON">Export</button>
|
<button id="exportDatasetBtn" class="btn btn-secondary btn-sm" title="Download the classifications as a filename-per-file JSON to edit (e.g. with an AI), then re-import here. NOT a workspace — no scanned tree.">Export for editing</button>
|
||||||
<button id="importDatasetBtn" class="btn btn-secondary btn-sm" title="Import a classification dataset JSON (replaces the current one)">Import</button>
|
<button id="importDatasetBtn" class="btn btn-secondary btn-sm" title="Load an edited classification JSON back in — replaces the current classifications. (To move a whole scanned workspace between browsers, use “Import workspace” on the welcome screen.)">Import edits</button>
|
||||||
<input type="file" id="importDatasetInput" accept="application/json,.json" hidden>
|
<input type="file" id="importDatasetInput" accept="application/json,.json" hidden>
|
||||||
<button id="resetDatasetBtn" class="btn btn-sm btn-danger" title="Discard all classifications and start over from the raw scanned input (does not touch your files)">Reset</button>
|
<button id="resetDatasetBtn" class="btn btn-sm btn-danger" title="Discard all classifications and start over from the raw scanned input (does not touch your files)">Reset</button>
|
||||||
<button id="copyOutputBtn" class="btn btn-primary btn-sm" disabled title="Copy mapped files to an output directory (source untouched)">Copy…</button>
|
<button id="copyOutputBtn" class="btn btn-primary btn-sm" disabled title="Copy mapped files to an output directory (source untouched)">Copy…</button>
|
||||||
|
|
@ -209,7 +209,7 @@
|
||||||
<div class="ws-head">
|
<div class="ws-head">
|
||||||
<h2>Your workspaces</h2>
|
<h2>Your workspaces</h2>
|
||||||
<div class="ws-head__actions">
|
<div class="ws-head__actions">
|
||||||
<button id="importWorkspaceBtn" class="btn btn-secondary" title="Import a workspace exported from another browser (.json) — restores the scanned snapshot so you don't re-scan">⭱ Import</button>
|
<button id="importWorkspaceBtn" class="btn btn-secondary" title="Import a whole workspace (.zddc-workspace.json) exported from another browser — restores the scanned snapshot so you don't re-scan">⭱ Import workspace</button>
|
||||||
<button id="newWorkspaceBtn" class="btn btn-primary">+ New workspace</button>
|
<button id="newWorkspaceBtn" class="btn btn-primary">+ New workspace</button>
|
||||||
</div>
|
</div>
|
||||||
<input type="file" id="importWorkspaceInput" accept="application/json,.json" hidden>
|
<input type="file" id="importWorkspaceInput" accept="application/json,.json" hidden>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue