diff --git a/frontend/src/components/RenderPanel.tsx b/frontend/src/components/RenderPanel.tsx
index 1082875..714ced1 100644
--- a/frontend/src/components/RenderPanel.tsx
+++ b/frontend/src/components/RenderPanel.tsx
@@ -205,7 +205,10 @@ export default function RenderPanel({ projectId, dirty, version }: Props) {
{renders.length > 0 && (
{renders.map((render) => (
-
+
{render.preview ? 'Preview' : 'Render'} v{render.version}
diff --git a/frontend/src/spec/edits.test.ts b/frontend/src/spec/edits.test.ts
index c5a60b2..348654b 100644
--- a/frontend/src/spec/edits.test.ts
+++ b/frontend/src/spec/edits.test.ts
@@ -74,6 +74,11 @@ describe('narration as text', () => {
expect(scene.narration?.beats.map((b) => b.id)).toEqual(['b1', 'b2', 'b3'])
})
+ it('keeps a space typed at the end of a paragraph', () => {
+ const scene = withNarrationText(spec().segments[1], 'One two ')
+ expect(narrationText(scene)).toBe('One two ')
+ })
+
it('keeps one empty beat when the box is cleared', () => {
const scene = withNarrationText(spec().segments[1], '')
expect(scene.narration?.beats).toEqual([{ id: 'b1', text: '' }])
diff --git a/frontend/src/spec/edits.ts b/frontend/src/spec/edits.ts
index e367f00..b3fcbd0 100644
--- a/frontend/src/spec/edits.ts
+++ b/frontend/src/spec/edits.ts
@@ -84,7 +84,10 @@ export function narrationText(segment: Segment): string {
export function withNarrationText(segment: Segment, text: string): Segment {
const existing = segment.narration?.beats ?? []
- const paragraphs = text.split(/\n\s*\n/).map((p) => p.trim())
+ // Not trimmed: this runs on every keystroke and the box shows the result back, so
+ // trimming would eat the space just typed at the end of a paragraph. Only a
+ // paragraph of nothing but whitespace is normalised, to empty.
+ const paragraphs = text.split(/\n\s*\n/).map((p) => (p.trim() === '' ? '' : p))
// An emptied box is one empty beat, not none, so the scene keeps a place to type.
const kept = paragraphs.filter((p, i) => p !== '' || i === 0)
const taken = new Set(existing.map((b) => b.id))
diff --git a/frontend/src/views/ProjectView.tsx b/frontend/src/views/ProjectView.tsx
index 5b714fe..8dfadf5 100644
--- a/frontend/src/views/ProjectView.tsx
+++ b/frontend/src/views/ProjectView.tsx
@@ -115,41 +115,67 @@ export default function ProjectView() {
}
return (
-