Import: downloadable Word template for the session list
Build and Push Docker Image / build-and-push (push) Failing after 20s

A blank three-column session list (Session #, Title, Passage) with instructions and
example rows, built in the browser on demand. A test imports the generated file back
through the real importer.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
nmemmertandClaude Sonnet 5.5 committed 2026-09-29 11:18:24 -04:00
1 parent 7a010fcda8
commit ec59f7c82d
4 files changed
+136 -1

No files matched your search

+21
View File
@@ -12,6 +12,20 @@ export default function ImportPage() {
const [importPreview, setImportPreview] = useState(null); // parsed episode specs, before fetching chapters
const [importBusy, setImportBusy] = useState(false);
const [importError, setImportError] = useState('');
const [templateBusy, setTemplateBusy] = useState(false);
// The template's Word library is only fetched when someone asks for it.
const downloadTemplate = async () => {
setTemplateBusy(true);
try {
const { downloadImportTemplate } = await import('../utils/importTemplate.js');
await downloadImportTemplate();
} catch {
setImportError('Couldn’t build the template. Please try again.');
} finally {
setTemplateBusy(false);
}
};
const handleImportFileChange = async (file) => {
setImportPreview(null);
@@ -166,6 +180,13 @@ export default function ImportPage() {
<span className="font-medium text-[var(--r-text)]">+ New Project</span> on the home page instead — this import
step is entirely optional.
</p>
<div className="pt-1">
<button type="button" onClick={downloadTemplate} disabled={templateBusy}
className="rounded-full border border-[var(--r-line)] px-4 py-1.5 text-sm font-medium text-[var(--r-text)] transition hover:bg-black/5 disabled:opacity-50">
{templateBusy ? 'Building…' : 'Download template (.docx)'}
</button>
<span className="ml-3 text-xs">A blank session list with example rows to fill in.</span>
</div>
</div>
<div className="grid gap-4 sm:grid-cols-2">