š„ Make videos programmatically with React
Merge remote-tracking branch 'origin/main' into codex/studio-install-skills
JonnyBurger7fdd504c6317
diff --cc packages/example/e2e/studio.test.mtsindex 5544e143e1,8c5d69c59e..3b00fcc430--- a/packages/example/e2e/studio.test.mts+++ b/packages/example/e2e/studio.test.mts@@@ -1676,91 -1676,6 +1676,91 @@@ test.describe('visual mode', () =>}});+ test('installs skills from settings and keeps progress when reopened', async ({+ page,+ }) => {+ const skillsInfo = {+ remotionUpgradeSkillAvailable: false,+ remotionInteractivitySkillAvailable: false,+ skills: ['remotion-captions', 'remotion-create'].map((name) => ({+ name,+ installedInProject: false,+ installedGlobally: false,+ })),+ };+ await page.route('**/api/remotion-skills-info', (route) =>+ route.fulfill({json: {success: true, data: skillsInfo}}),+ );+ // The server integration test covers the real installer boundary and filesystem.+ let installAttempts = 0;+ let finishInstall: () => void = () => undefined;+ const installFinished = new Promise<void>((resolve) => {+ finishInstall = resolve;+ });+ await page.route('**/api/install-remotion-skill', async (route) => {+ expect(route.request().postDataJSON()).toEqual({+ skill: 'remotion-captions',+ });+ if (++installAttempts === 1) {+ await route.fulfill({+ json: {success: false, error: 'Could not download skills'},+ });+ return;+ }+ await installFinished;+ skillsInfo.skills[0].installedInProject = true;+ await route.fulfill({json: {success: true, data: skillsInfo}});+ });+ await page.goto(`${STUDIO_URL}/schema-test`);+ const openSkills = async () => {+ await page.getByRole('button', {name: /Search\.\.\./}).click();+ const dialog = page.getByRole('dialog');+ await dialog.getByRole('textbox').fill('> Settings');+ await dialog.getByText('Settings...', {exact: true}).click();+ await dialog.getByText('Skills', {exact: true}).click();+ };+ await openSkills();+ const dialog = page.getByRole('dialog');+ const captionsSkill = dialog+ .getByRole('listitem')+ .filter({hasText: '/remotion-captions'});+ const installButton = captionsSkill.getByRole('button', {+ name: 'Install',+ exact: true,+ });+ await installButton.click();+ await expect(+ dialog.getByText('Could not download skills', {exact: true}),+ ).toBeVisible();+ await installButton.click();+ await expect(- captionsSkill.getByRole('button', {name: 'Installing...'}),++ captionsSkill.getByRole('button', {name: 'Installingā¦'}),+ ).toBeDisabled();+ await expect(+ dialog+ .getByRole('listitem')+ .filter({hasText: '/remotion-create'})+ .getByRole('button'),+ ).toBeDisabled();+ await page.keyboard.press('Escape');+ await openSkills();+ await expect(- captionsSkill.getByRole('button', {name: 'Installing...'}),++ captionsSkill.getByRole('button', {name: 'Installingā¦'}),+ ).toBeDisabled();+ finishInstall();+ await expect(+ captionsSkill.getByText('Project', {exact: true}),+ ).toBeVisible();+ await expect(+ dialog.getByText('Could not download skills', {exact: true}),+ ).toBeHidden();+ await page.keyboard.press('Escape');+ await openSkills();+ await expect(+ captionsSkill.getByText('Project', {exact: true}),+ ).toBeVisible();+ });+test('settings reuse reactive runtime config and license toggle', async ({page,}) => {diff --cc packages/studio-server/src/preview-server/api-routes.tsindex f21cc62a55,08b843350d..0d886bbec1--- a/packages/studio-server/src/preview-server/api-routes.ts+++ b/packages/studio-server/src/preview-server/api-routes.ts@@@ -27,8 -27,6 +27,7 @@@ import {duplicateJsxNodeHandler} from 'import {findInFileHandler} from './routes/find-in-file';import {insertElementHandler} from './routes/insert-element';import {insertJsxElementHandler} from './routes/insert-jsx-element';- import {handleInstallPackage} from './routes/install-dependency';+import {installRemotionSkillHandler} from './routes/install-remotion-skill';import {logStudioErrorHandler} from './routes/log-studio-error';import {moveKeyframesHandler} from './routes/move-keyframes';import {openInEditorHandler} from './routes/open-in-editor';diff --cc packages/studio/src/components/SettingsModal.tsxindex b07bf74b9f,e3b57cd91a..c871684704--- a/packages/studio/src/components/SettingsModal.tsx+++ b/packages/studio/src/components/SettingsModal.tsx@@@ -325,7 -348,7 +348,10 @@@ export const SettingsModal: React.FC<</div>{tab === 'packages' ? (<div ref={setPackagesFooterContainer} />- ) : isBrowserStudio || tab === 'updates' || tab === 'skills' ? null : (- ) : isBrowserStudio || tab === 'models' || tab === 'updates' ? null : (++ ) : isBrowserStudio ||++ tab === 'models' ||++ tab === 'updates' ||++ tab === 'skills' ? null : (<SettingsModalFooter showLicenseFaq={tab === 'license'} />)}</>diff --cc packages/studio/src/components/SkillsSettings.tsxindex c5bb0b3970,91b4c78ed4..9f3fef421c--- a/packages/studio/src/components/SkillsSettings.tsx+++ b/packages/studio/src/components/SkillsSettings.tsx@@@ -10,9 -9,6 +10,7 @@@ import {copyText} from '../helpers/copyimport {useCopyFeedback} from '../helpers/use-copy-feedback';import {CheckCircleFilled} from '../icons/check-circle-filled';import {CopyIcon} from '../icons/copy';- import {Minus} from '../icons/minus';+import {Button} from './Button';import type {RenderInlineAction} from './InlineAction';import {InlineAction} from './InlineAction';import {ValidationMessage} from './NewComposition/ValidationMessage';@@@ -106,6 -102,6 +104,12 @@@ const status: React.CSSProperties =whiteSpace: 'nowrap',};++const installButton: React.CSSProperties = {++ backgroundColor: BLUE,++ color: WHITE,++ flexShrink: 0,++};++const loading: React.CSSProperties = {...description,marginTop: 14,@@@ -219,25 -193,7 +225,17 @@@ export const SkillsSettings: React.FCaria-hiddenstyle={{...statusIcon, fill: BLUE}}/>- ) : (- <Minus aria-hidden color={LIGHT_TEXT} style={statusIcon} />- )}- <span style={skillName}>/{skill.name}</span>- {!installed && canInstall ? (++ ) : canInstall ? (+ <Button+ size="compact"- style={NO_HOVER_BACKGROUND_STYLE}++ style={installButton}+ title={`Install ${skill.name} in this project`}+ disabled={installingSkill !== null}+ onClick={() => installSkill(skill.name)}+ >- {installingSkill === skill.name- ? 'Installing...'- : 'Install'}++ {installingSkill === skill.name ? 'Installingā¦' : 'Install'}+ </Button>- ) : (- <span style={status}>{installedLocation}</span>- )}+ ) : null}</div>);})}