Skip to content

🎥 Make videos programmatically with React

@remotion/studio: Style queue error description

JonnyBurger04294cb5923d
diff --git a/packages/studio/src/components/RenderQueue/QueueJobErrorModal.tsx b/packages/studio/src/components/RenderQueue/QueueJobErrorModal.tsx
index b2b639fdd0..34a60ba39d 100644
--- a/packages/studio/src/components/RenderQueue/QueueJobErrorModal.tsx
+++ b/packages/studio/src/components/RenderQueue/QueueJobErrorModal.tsx
@@ -1,6 +1,6 @@
import React, {useCallback, useContext} from 'react';
import {CopyStackTrace} from '../../error-overlay/remotion-overlay/CopyStackTrace';
-import {RENDER_STATUS_BACKGROUND} from '../../helpers/colors';
+import {LIGHT_TEXT, RENDER_STATUS_BACKGROUND} from '../../helpers/colors';
import {SetSelectedModalContext} from '../../state/modals';
import {Button} from '../Button';
import {Flex, SPACING_UNIT} from '../layout';
@@ -24,6 +24,16 @@ const codeBlock: React.CSSProperties = {
maxHeight: 300,
};
+const description: React.CSSProperties = {
+ color: LIGHT_TEXT,
+ fontFamily: 'sans-serif',
+ fontSize: 14,
+ lineHeight: 1.5,
+ margin: 0,
+ marginBottom: 12,
+ marginTop: 16,
+};
+
const spacer: React.CSSProperties = {
height: SPACING_UNIT,
width: SPACING_UNIT,
@@ -55,7 +65,9 @@ export const QueueJobErrorModal: React.FC<{
>
<ModalHeader title={title} />
<div style={container}>
- <p>The job failed because of the following error:</p>
+ <p style={description}>
+ The job failed because of the following error:
+ </p>
<div className={HORIZONTAL_SCROLLBAR_CLASSNAME} style={codeBlock}>
{errorDetails}
</div>
diff --git a/packages/studio/src/test/queue-job-errors.test.tsx b/packages/studio/src/test/queue-job-errors.test.tsx
index c6a0269825..f3aff3b945 100644
--- a/packages/studio/src/test/queue-job-errors.test.tsx
+++ b/packages/studio/src/test/queue-job-errors.test.tsx
@@ -15,6 +15,7 @@ import {RenderQueueContext} from '../components/RenderQueue/context';
import {QueueJobErrorModal} from '../components/RenderQueue/QueueJobErrorModal';
import type {VideoMattingJob} from '../components/RenderQueue/video-matting-job-types';
import {VideoMattingQueueItem} from '../components/RenderQueue/VideoMattingQueueItem';
+import {LIGHT_TEXT} from '../helpers/colors';
import {SelectedModalContext} from '../state/modals';
const originalClipboard = Object.getOwnPropertyDescriptor(
@@ -118,6 +119,15 @@ test('opens and copies transcription and video matting errors', async () => {
const transcriptionDialog = screen.getByRole('dialog', {
name: 'Transcription failed',
});
+ const description = within(transcriptionDialog).getByText(
+ 'The job failed because of the following error:',
+ );
+ const descriptionStyle = getComputedStyle(description);
+ expect(descriptionStyle.color).toBe(LIGHT_TEXT);
+ expect(descriptionStyle.fontFamily).toBe('sans-serif');
+ expect(descriptionStyle.fontSize).toBe('14px');
+ expect(descriptionStyle.lineHeight).toBe('1.5');
+ expect(descriptionStyle.marginTop).toBe('16px');
expect(transcriptionDialog.textContent).toContain(captionJob.error.stack!);
fireEvent.click(
within(transcriptionDialog).getByRole('button', {name: 'Copy stack'}),