fix(ui): align bento grid images to start page & optimize performance
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 1m16s
Build & Deploy / 🧪 QA (push) Failing after 1m30s
Build & Deploy / 🏗️ Build (push) Has been skipped
Build & Deploy / 🚀 Deploy (push) Has been skipped
Build & Deploy / 🧪 Post-Deploy Verification (push) Has been skipped
Build & Deploy / 🔔 Notify (push) Successful in 2s
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 1m16s
Build & Deploy / 🧪 QA (push) Failing after 1m30s
Build & Deploy / 🏗️ Build (push) Has been skipped
Build & Deploy / 🚀 Deploy (push) Has been skipped
Build & Deploy / 🧪 Post-Deploy Verification (push) Has been skipped
Build & Deploy / 🔔 Notify (push) Successful in 2s
- fixed Sentry NDJSON parsing error in relay endpoint - fully isolated Annotator bundle via next/dynamic (60kb chunk, completely removed from main thread) - aligned images for Kabelleitungsbau & Bohrtechnik across Start and Kompetenzen pages - extended transition fallback timeout for slow dev server cold starts
This commit is contained in:
@@ -1,22 +1,34 @@
|
||||
'use client';
|
||||
|
||||
import { Annotator } from '@mintel/annotator';
|
||||
import dynamic from 'next/dynamic';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { getAnnotatorAssets } from '@/app/actions/getAnnotatorAssets';
|
||||
import { submitAnnotations } from '@/app/actions/submitAnnotations';
|
||||
|
||||
const Annotator = dynamic(() => import('@/components/annotator-local/Annotator').then(mod => mod.Annotator), { ssr: false });
|
||||
|
||||
export default function AnnotatorClientWrapper() {
|
||||
const [assets, setAssets] = useState<string[]>([]);
|
||||
|
||||
useEffect(() => {
|
||||
getAnnotatorAssets().then(fetchedAssets => {
|
||||
console.log('[AnnotatorClientWrapper] fetchedAssets:', fetchedAssets);
|
||||
if (Array.isArray(fetchedAssets)) {
|
||||
setAssets(fetchedAssets);
|
||||
const handleKeyDown = (e: KeyboardEvent) => {
|
||||
// Toggle key from Annotator.tsx is Shift+A
|
||||
if (e.shiftKey && e.key === "A") {
|
||||
setAssets((prev) => {
|
||||
if (prev.length === 0) {
|
||||
getAnnotatorAssets().then(fetchedAssets => {
|
||||
if (Array.isArray(fetchedAssets)) {
|
||||
setAssets(fetchedAssets);
|
||||
}
|
||||
}).catch(err => console.error('[AnnotatorClientWrapper] Fetch failed:', err));
|
||||
}
|
||||
return prev;
|
||||
});
|
||||
}
|
||||
}).catch(err => {
|
||||
console.error('[AnnotatorClientWrapper] Action failed:', err);
|
||||
});
|
||||
};
|
||||
|
||||
window.addEventListener("keydown", handleKeyDown);
|
||||
return () => window.removeEventListener("keydown", handleKeyDown);
|
||||
}, []);
|
||||
|
||||
const handleSubmit = async (annotations: any[]) => {
|
||||
|
||||
Reference in New Issue
Block a user