diff --git a/packages/core/src/asset/asset.test.ts b/packages/core/src/asset/asset.test.ts index 971e0395..f660211d 100644 --- a/packages/core/src/asset/asset.test.ts +++ b/packages/core/src/asset/asset.test.ts @@ -871,7 +871,10 @@ describe('AssetService', () => { // 7. Verify S3 deletion was called const { s3Service } = await import('@shumai/core/src/s3/s3') - expect(s3Service.deleteObject).toHaveBeenCalledWith('shumai', 'attachments/test-attachment-file.png') + expect(s3Service.deleteObject).toHaveBeenCalledWith( + 'shumai', + 'attachments/test-attachment-file.png', + ) }) it('can create and retrieve comments with video timestamp', async () => { diff --git a/packages/core/src/asset/asset.ts b/packages/core/src/asset/asset.ts index 2d029d2a..6bad35a1 100644 --- a/packages/core/src/asset/asset.ts +++ b/packages/core/src/asset/asset.ts @@ -1442,7 +1442,9 @@ export class AssetService { const teamId = comment.asset.project?.teamId if (!teamId) { - throw new HTTPException(400, { message: 'Data corruption: Comment asset is not associated with a project' }) + throw new HTTPException(400, { + message: 'Data corruption: Comment asset is not associated with a project', + }) } const member = await this.prismaClient.teamMember.findUnique({ @@ -1489,11 +1491,13 @@ export class AssetService { }) if (asset.storageKey) { - await this.prismaClient.storageKey.delete({ - where: { id: asset.storageKey.id }, - }).catch(() => { - // Silently ignore if already deleted - }) + await this.prismaClient.storageKey + .delete({ + where: { id: asset.storageKey.id }, + }) + .catch(() => { + // Silently ignore if already deleted + }) } } diff --git a/packages/webui/components/compare/compare-viewer.tsx b/packages/webui/components/compare/compare-viewer.tsx index b9af17f2..503fa8fb 100644 --- a/packages/webui/components/compare/compare-viewer.tsx +++ b/packages/webui/components/compare/compare-viewer.tsx @@ -156,12 +156,28 @@ export function CompareViewer({ activeEl && (activeEl.tagName === 'INPUT' || activeEl.tagName === 'TEXTAREA' || - activeEl.hasAttribute('contenteditable') || - activeEl.getAttribute('contenteditable') === 'true') + (activeEl instanceof HTMLElement && activeEl.isContentEditable)) ) { return } + const isSpace = e.key === ' ' + const isInteractive = + activeEl && + (activeEl.tagName === 'BUTTON' || + activeEl.tagName === 'A' || + activeEl.tagName === 'SELECT' || + activeEl.tagName === 'OPTION' || + activeEl.getAttribute('role') === 'button' || + activeEl.getAttribute('role') === 'link' || + activeEl.getAttribute('role') === 'checkbox' || + activeEl.getAttribute('role') === 'radio' || + activeEl.getAttribute('role') === 'menuitem') + + if (isSpace && isInteractive) { + return + } + if (e.key === ' ' || e.key.toLowerCase() === 'k') { e.preventDefault() handleTogglePlay() diff --git a/packages/webui/components/viewers/video/video-viewer.tsx b/packages/webui/components/viewers/video/video-viewer.tsx index 5d7b0039..74727c35 100644 --- a/packages/webui/components/viewers/video/video-viewer.tsx +++ b/packages/webui/components/viewers/video/video-viewer.tsx @@ -420,12 +420,28 @@ const VideoViewer = React.forwardRef( activeEl && (activeEl.tagName === 'INPUT' || activeEl.tagName === 'TEXTAREA' || - activeEl.hasAttribute('contenteditable') || - activeEl.getAttribute('contenteditable') === 'true') + (activeEl instanceof HTMLElement && activeEl.isContentEditable)) ) { return } + const isSpace = e.key === ' ' + const isInteractive = + activeEl && + (activeEl.tagName === 'BUTTON' || + activeEl.tagName === 'A' || + activeEl.tagName === 'SELECT' || + activeEl.tagName === 'OPTION' || + activeEl.getAttribute('role') === 'button' || + activeEl.getAttribute('role') === 'link' || + activeEl.getAttribute('role') === 'checkbox' || + activeEl.getAttribute('role') === 'radio' || + activeEl.getAttribute('role') === 'menuitem') + + if (isSpace && isInteractive) { + return + } + if (e.key === ' ' || e.key.toLowerCase() === 'k') { e.preventDefault() togglePlay()