Compare commits

...

4 Commits

Author SHA1 Message Date
4adf547265 chore(blog): improve image quality and fix list item alignment; fix(hero): refactor title rendering to resolve console error; bump version to 2.0.3
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 8s
Build & Deploy / 🏗️ Build (push) Has been cancelled
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Post-Deploy Verification (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
Build & Deploy / 🧪 QA (push) Has been cancelled
2026-03-01 11:17:47 +01:00
ec227d614f feat: implement Umami page speed tracking via Web Vitals
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 8s
Build & Deploy / 🧪 QA (push) Successful in 2m25s
Build & Deploy / 🏗️ Build (push) Successful in 3m59s
Build & Deploy / 🚀 Deploy (push) Successful in 15s
Build & Deploy / 🧪 Post-Deploy Verification (push) Successful in 4m55s
Build & Deploy / 🔔 Notify (push) Successful in 2s
Nightly QA / call-qa-workflow (push) Failing after 45s
- Add WebVitalsTracker component using useReportWebVitals
- Report LCP, CLS, FID, FCP, TTFB, and INP as Umami events
- Include rating (good/needs-improvement/poor) for meaningful metrics
2026-02-28 19:35:06 +01:00
cb07b739b8 fix: glitchtip performance metrics + cleanup test submissions
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 28s
Build & Deploy / 🏗️ Build (push) Has been cancelled
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Post-Deploy Verification (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
Build & Deploy / 🧪 QA (push) Has been cancelled
- Refactor GlitchtipErrorReportingService to support dynamic DSN and tracesSampleRate
- Enable client-side performance tracing by setting tracesSampleRate: 0.1
- Configure production Mail variables and restart containers on alpha.mintel.me
2026-02-28 19:33:14 +01:00
55e9531698 fix: glitchtip errors (locale, email) + E2E submission cleanup
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 10s
Build & Deploy / 🏗️ Build (push) Has been cancelled
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Post-Deploy Verification (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
Build & Deploy / 🧪 QA (push) Has been cancelled
- Add fallback 'de' locale to toLocaleDateString() to prevent RangeError
- Skip sending emails for submissions from 'testing@mintel.me'
- Update check-forms.ts to automatically delete test submissions via Payload API
- (Manual) Configured MAIL_FROM and MAIL_RECIPIENTS on alpha.mintel.me
2026-02-28 19:31:36 +01:00
14 changed files with 188 additions and 65 deletions

View File

@@ -88,6 +88,7 @@ export default async function BlogPost({ params }: BlogPostProps) {
alt={post.frontmatter.title} alt={post.frontmatter.title}
fill fill
priority priority
quality={90}
className="object-cover" className="object-cover"
sizes="100vw" sizes="100vw"
style={{ style={{
@@ -113,7 +114,7 @@ export default async function BlogPost({ params }: BlogPostProps) {
</Heading> </Heading>
<div className="flex flex-wrap items-center gap-6 text-white/80 text-sm md:text-base font-medium"> <div className="flex flex-wrap items-center gap-6 text-white/80 text-sm md:text-base font-medium">
<time dateTime={post.frontmatter.date} suppressHydrationWarning> <time dateTime={post.frontmatter.date} suppressHydrationWarning>
{new Date(post.frontmatter.date).toLocaleDateString(locale, { {new Date(post.frontmatter.date).toLocaleDateString(locale || 'de', {
year: 'numeric', year: 'numeric',
month: 'long', month: 'long',
day: 'numeric', day: 'numeric',
@@ -150,7 +151,7 @@ export default async function BlogPost({ params }: BlogPostProps) {
</Heading> </Heading>
<div className="flex items-center gap-6 text-text-primary/80 font-medium"> <div className="flex items-center gap-6 text-text-primary/80 font-medium">
<time dateTime={post.frontmatter.date} suppressHydrationWarning> <time dateTime={post.frontmatter.date} suppressHydrationWarning>
{new Date(post.frontmatter.date).toLocaleDateString(locale, { {new Date(post.frontmatter.date).toLocaleDateString(locale || 'de', {
year: 'numeric', year: 'numeric',
month: 'long', month: 'long',
day: 'numeric', day: 'numeric',

View File

@@ -198,7 +198,7 @@ export default async function BlogIndex({ params }: BlogIndexProps) {
<div className="flex items-center gap-3 text-xs md:text-sm font-bold text-white/80 mb-3 tracking-widest uppercase"> <div className="flex items-center gap-3 text-xs md:text-sm font-bold text-white/80 mb-3 tracking-widest uppercase">
<time dateTime={post.frontmatter.date} suppressHydrationWarning> <time dateTime={post.frontmatter.date} suppressHydrationWarning>
{new Date(post.frontmatter.date).toLocaleDateString(locale, { {new Date(post.frontmatter.date).toLocaleDateString(locale || 'de', {
year: 'numeric', year: 'numeric',
month: 'long', month: 'long',
day: 'numeric', day: 'numeric',

View File

@@ -72,6 +72,7 @@ export async function sendContactFormAction(formData: FormData) {
? `Product Inquiry: ${productName}` ? `Product Inquiry: ${productName}`
: 'New Contact Form Submission'; : 'New Contact Form Submission';
const confirmationSubject = 'Thank you for your inquiry'; const confirmationSubject = 'Thank you for your inquiry';
const isTestSubmission = email === 'testing@mintel.me';
try { try {
// 2a. Send notification to Mintel/Client // 2a. Send notification to Mintel/Client
@@ -84,26 +85,30 @@ export async function sendContactFormAction(formData: FormData) {
}), }),
); );
const notificationResult = await sendEmail({ if (!isTestSubmission) {
replyTo: email, const notificationResult = await sendEmail({
subject: notificationSubject, replyTo: email,
html: notificationHtml,
});
if (notificationResult.success) {
logger.info('Notification email sent successfully', {
messageId: notificationResult.messageId,
});
} else {
logger.error('Notification email FAILED', {
error: notificationResult.error,
subject: notificationSubject, subject: notificationSubject,
email, html: notificationHtml,
}); });
services.errors.captureException(
new Error(`Notification email failed: ${notificationResult.error}`), if (notificationResult.success) {
{ action: 'sendContactFormAction_notification', email }, logger.info('Notification email sent successfully', {
); messageId: notificationResult.messageId,
});
} else {
logger.error('Notification email FAILED', {
error: notificationResult.error,
subject: notificationSubject,
email,
});
services.errors.captureException(
new Error(`Notification email failed: ${notificationResult.error}`),
{ action: 'sendContactFormAction_notification', email },
);
}
} else {
logger.info('Skipping notification email for test submission', { email });
} }
// 2b. Send confirmation to Customer (branded as KLZ Cables) // 2b. Send confirmation to Customer (branded as KLZ Cables)
@@ -115,26 +120,30 @@ export async function sendContactFormAction(formData: FormData) {
}), }),
); );
const confirmationResult = await sendEmail({ if (!isTestSubmission) {
to: email, const confirmationResult = await sendEmail({
subject: confirmationSubject,
html: confirmationHtml,
});
if (confirmationResult.success) {
logger.info('Confirmation email sent successfully', {
messageId: confirmationResult.messageId,
});
} else {
logger.error('Confirmation email FAILED', {
error: confirmationResult.error,
subject: confirmationSubject,
to: email, to: email,
subject: confirmationSubject,
html: confirmationHtml,
}); });
services.errors.captureException(
new Error(`Confirmation email failed: ${confirmationResult.error}`), if (confirmationResult.success) {
{ action: 'sendContactFormAction_confirmation', email }, logger.info('Confirmation email sent successfully', {
); messageId: confirmationResult.messageId,
});
} else {
logger.error('Confirmation email FAILED', {
error: confirmationResult.error,
subject: confirmationSubject,
to: email,
});
services.errors.captureException(
new Error(`Confirmation email failed: ${confirmationResult.error}`),
{ action: 'sendContactFormAction_confirmation', email },
);
}
} else {
logger.info('Skipping confirmation email for test submission', { email });
} }
// Notify via Gotify (Internal) // Notify via Gotify (Internal)

View File

@@ -42,7 +42,7 @@ const jsxConverters: JSXConverters = {
// Use div instead of p for paragraphs to allow nested block elements (like the lists above) // Use div instead of p for paragraphs to allow nested block elements (like the lists above)
paragraph: ({ node, nodesToJSX }: any) => { paragraph: ({ node, nodesToJSX }: any) => {
return ( return (
<div className="mb-6 leading-relaxed text-text-secondary"> <div className="mb-4 md:mb-6 leading-relaxed text-text-secondary last:mb-0">
{nodesToJSX({ nodes: node.children })} {nodesToJSX({ nodes: node.children })}
</div> </div>
); );
@@ -77,7 +77,7 @@ const jsxConverters: JSXConverters = {
const children = nodesToJSX({ nodes: node.children }); const children = nodesToJSX({ nodes: node.children });
if (node?.listType === 'number') { if (node?.listType === 'number') {
return ( return (
<ol className="list-decimal pl-6 my-6 space-y-2 text-text-secondary marker:text-primary marker:font-bold"> <ol className="list-decimal pl-4 space-y-2 text-text-secondary marker:text-primary marker:font-bold prose-p:mb-0">
{children} {children}
</ol> </ol>
); );
@@ -86,7 +86,7 @@ const jsxConverters: JSXConverters = {
return <ul className="list-none pl-0 my-6 space-y-2 text-text-secondary">{children}</ul>; return <ul className="list-none pl-0 my-6 space-y-2 text-text-secondary">{children}</ul>;
} }
return ( return (
<ul className="list-disc pl-6 my-6 space-y-2 text-text-secondary marker:text-primary"> <ul className="list-disc pl-4 space-y-2 text-text-secondary marker:text-primary prose-p:mb-0">
{children} {children}
</ul> </ul>
); );

View File

@@ -9,6 +9,9 @@ const DynamicAnalyticsProvider = dynamic(() => import('./AnalyticsProvider'), {
const DynamicScrollDepthTracker = dynamic(() => import('./ScrollDepthTracker'), { const DynamicScrollDepthTracker = dynamic(() => import('./ScrollDepthTracker'), {
ssr: false, ssr: false,
}); });
const DynamicWebVitalsTracker = dynamic(() => import('./WebVitalsTracker'), {
ssr: false,
});
export default function AnalyticsShell() { export default function AnalyticsShell() {
const [shouldLoad, setShouldLoad] = useState(false); const [shouldLoad, setShouldLoad] = useState(false);
@@ -34,6 +37,7 @@ export default function AnalyticsShell() {
<Suspense fallback={null}> <Suspense fallback={null}>
<DynamicAnalyticsProvider /> <DynamicAnalyticsProvider />
<DynamicScrollDepthTracker /> <DynamicScrollDepthTracker />
<DynamicWebVitalsTracker />
</Suspense> </Suspense>
); );
} }

View File

@@ -0,0 +1,54 @@
'use client';
import { useReportWebVitals } from 'next/web-vitals';
import { useAnalytics } from './useAnalytics';
/**
* WebVitalsTracker component.
*
* Captures Next.js Web Vitals and reports them to Umami as custom events.
* This provides "meaningful" page speed tracking by measuring real user
* experiences (LCP, CLS, INP, etc.).
*/
export default function WebVitalsTracker() {
const { trackEvent } = useAnalytics();
useReportWebVitals((metric) => {
const { name, value, id, label } = metric;
// Determine rating (simplified version of web-vitals standards)
let rating: 'good' | 'needs-improvement' | 'poor' = 'good';
if (name === 'LCP') {
if (value > 4000) rating = 'poor';
else if (value > 2500) rating = 'needs-improvement';
} else if (name === 'CLS') {
if (value > 0.25) rating = 'poor';
else if (value > 0.1) rating = 'needs-improvement';
} else if (name === 'FID') {
if (value > 300) rating = 'poor';
else if (value > 100) rating = 'needs-improvement';
} else if (name === 'FCP') {
if (value > 3000) rating = 'poor';
else if (value > 1800) rating = 'needs-improvement';
} else if (name === 'TTFB') {
if (value > 1500) rating = 'poor';
else if (value > 800) rating = 'needs-improvement';
} else if (name === 'INP') {
if (value > 500) rating = 'poor';
else if (value > 200) rating = 'needs-improvement';
}
// Report to Umami
trackEvent('web-vital', {
metric: name,
value: Math.round(name === 'CLS' ? value * 1000 : value), // CLS is a score, multiply by 1000 to keep as integer if preferred
rating,
id,
label,
path: typeof window !== 'undefined' ? window.location.pathname : undefined,
});
});
return null;
}

View File

@@ -23,19 +23,27 @@ export default function Hero({ data }: { data?: any }) {
className="text-center md:text-left mb-6 md:mb-8 md:max-w-none text-white text-4xl sm:text-5xl md:text-7xl font-extrabold [text-shadow:_-2px_-2px_0_#002b49,_2px_-2px_0_#002b49,_-2px_2px_0_#002b49,_2px_2px_0_#002b49,_-2px_0_0_#002b49,_2px_0_0_#002b49,_0_-2px_0_#002b49,_0_2px_0_#002b49]" className="text-center md:text-left mb-6 md:mb-8 md:max-w-none text-white text-4xl sm:text-5xl md:text-7xl font-extrabold [text-shadow:_-2px_-2px_0_#002b49,_2px_-2px_0_#002b49,_-2px_2px_0_#002b49,_2px_2px_0_#002b49,_-2px_0_0_#002b49,_2px_0_0_#002b49,_0_-2px_0_#002b49,_0_2px_0_#002b49]"
> >
{data?.title ? ( {data?.title ? (
<span <>
dangerouslySetInnerHTML={{ {data.title.split(/(<green>.*?<\/green>)/g).map((part: string, i: number) => {
__html: data.title if (part.startsWith('<green>') && part.endsWith('</green>')) {
.replace( const content = part.replace(/<\/?green>/g, '');
/<green>/g, return (
'<span class="relative inline-block"><span class="relative z-10 text-accent italic inline-block">', <span key={i} className="relative inline-block">
) <span className="relative z-10 text-accent italic inline-block">
.replace( {content}
/<\/green>/g, </span>
'</span><div class="w-[140%] h-[140%] -top-[20%] -left-[20%] text-accent/30 hidden md:block absolute -z-10 animate-in fade-in zoom-in-0 duration-1000 ease-out fill-mode-both" style="animation-delay: 500ms;"><Scribble variant="circle" /></div></span>', <div
), className="w-[140%] h-[140%] -top-[20%] -left-[20%] text-accent/30 hidden md:block absolute -z-10 animate-in fade-in zoom-in-0 duration-1000 ease-out fill-mode-both"
}} style={{ animationDelay: '500ms' }}
/> >
<Scribble variant="circle" />
</div>
</span>
);
}
return <span key={i}>{part}</span>;
})}
</>
) : ( ) : (
t.rich('title', { t.rich('title', {
green: (chunks) => ( green: (chunks) => (

View File

@@ -74,7 +74,7 @@ export default async function RecentPosts({ locale, data }: RecentPostsProps) {
suppressHydrationWarning suppressHydrationWarning
className="px-3 py-1 text-white/80 text-[10px] md:text-xs font-bold uppercase tracking-widest border border-white/20 rounded-full bg-white/10 backdrop-blur-md" className="px-3 py-1 text-white/80 text-[10px] md:text-xs font-bold uppercase tracking-widest border border-white/20 rounded-full bg-white/10 backdrop-blur-md"
> >
{new Date(post.frontmatter.date).toLocaleDateString(locale, { {new Date(post.frontmatter.date).toLocaleDateString(locale || 'de', {
year: 'numeric', year: 'numeric',
month: 'short', month: 'short',
day: 'numeric', day: 'numeric',

View File

@@ -116,7 +116,7 @@ export async function getPostBySlug(slug: string, locale: string): Promise<PostD
category: doc.category || '', category: doc.category || '',
featuredImage: featuredImage:
typeof doc.featuredImage === 'object' && doc.featuredImage !== null typeof doc.featuredImage === 'object' && doc.featuredImage !== null
? doc.featuredImage.sizes?.card?.url || doc.featuredImage.url ? doc.featuredImage.url || doc.featuredImage.sizes?.card?.url
: null, : null,
focalX: focalX:
typeof doc.featuredImage === 'object' && doc.featuredImage !== null typeof doc.featuredImage === 'object' && doc.featuredImage !== null
@@ -162,7 +162,7 @@ export async function getAllPosts(locale: string): Promise<PostData[]> {
category: doc.category || '', category: doc.category || '',
featuredImage: featuredImage:
typeof doc.featuredImage === 'object' && doc.featuredImage !== null typeof doc.featuredImage === 'object' && doc.featuredImage !== null
? doc.featuredImage.sizes?.card?.url || doc.featuredImage.url ? doc.featuredImage.url || doc.featuredImage.sizes?.card?.url
: null, : null,
focalX: focalX:
typeof doc.featuredImage === 'object' && doc.featuredImage !== null typeof doc.featuredImage === 'object' && doc.featuredImage !== null

View File

@@ -65,7 +65,15 @@ export function getServerAppServices(): AppServices {
} }
const errors = config.errors.glitchtip.enabled const errors = config.errors.glitchtip.enabled
? new GlitchtipErrorReportingService({ enabled: true }, logger, notifications) ? new GlitchtipErrorReportingService(
{
enabled: true,
dsn: config.errors.glitchtip.dsn,
tracesSampleRate: 1.0, // Server-side we usually want higher visibility
},
logger,
notifications,
)
: new NoopErrorReportingService(); : new NoopErrorReportingService();
if (config.errors.glitchtip.enabled) { if (config.errors.glitchtip.enabled) {

View File

@@ -69,7 +69,15 @@ export function getAppServices(): AppServices {
// Create error reporting service (GlitchTip/Sentry or no-op) // Create error reporting service (GlitchTip/Sentry or no-op)
const errors = sentryEnabled const errors = sentryEnabled
? new GlitchtipErrorReportingService({ enabled: true }, logger, notifications) ? new GlitchtipErrorReportingService(
{
enabled: true,
dsn: config.errors.glitchtip.dsn,
tracesSampleRate: 0.1, // Default to 10% sampling
},
logger,
notifications,
)
: new NoopErrorReportingService(); : new NoopErrorReportingService();
if (sentryEnabled) { if (sentryEnabled) {

View File

@@ -8,6 +8,8 @@ import type { LoggerService } from '../logging/logger-service';
export type GlitchtipErrorReportingServiceOptions = { export type GlitchtipErrorReportingServiceOptions = {
enabled: boolean; enabled: boolean;
dsn?: string;
tracesSampleRate?: number;
}; };
// GlitchTip speaks the Sentry protocol; @sentry/nextjs can send to GlitchTip via DSN. // GlitchTip speaks the Sentry protocol; @sentry/nextjs can send to GlitchTip via DSN.
@@ -46,12 +48,12 @@ export class GlitchtipErrorReportingService implements ErrorReportingService {
if (!this.sentryPromise) { if (!this.sentryPromise) {
this.sentryPromise = import('@sentry/nextjs').then((Sentry) => { this.sentryPromise = import('@sentry/nextjs').then((Sentry) => {
// Client-side initialization must happen here since sentry.client.config.ts is empty // Client-side initialization must happen here since sentry.client.config.ts is empty
if (typeof window !== 'undefined' && process.env.NODE_ENV === 'production') { if (typeof window !== 'undefined' && this.options.enabled) {
Sentry.init({ Sentry.init({
dsn: 'https://public@errors.infra.mintel.me/1', dsn: this.options.dsn || 'https://public@errors.infra.mintel.me/1',
tunnel: '/errors/api/relay', tunnel: '/errors/api/relay',
enabled: true, enabled: true,
tracesSampleRate: 0, tracesSampleRate: this.options.tracesSampleRate ?? 0.1,
replaysOnErrorSampleRate: 1.0, replaysOnErrorSampleRate: 1.0,
replaysSessionSampleRate: 0.1, replaysSessionSampleRate: 0.1,
}); });

View File

@@ -139,7 +139,7 @@
"prepare": "husky", "prepare": "husky",
"preinstall": "npx only-allow pnpm" "preinstall": "npx only-allow pnpm"
}, },
"version": "2.0.2", "version": "2.2.5",
"pnpm": { "pnpm": {
"onlyBuiltDependencies": [ "onlyBuiltDependencies": [
"@parcel/watcher", "@parcel/watcher",

View File

@@ -168,9 +168,38 @@ async function main() {
hasErrors = true; hasErrors = true;
} }
// 5. Cleanup: Delete test submissions from Payload CMS
console.log(`\n🧹 Starting cleanup of test submissions...`);
try {
const apiUrl = `${targetUrl.replace(/\/$/, '')}/api/form-submissions`;
const searchUrl = `${apiUrl}?where[email][equals]=testing@mintel.me`;
// Fetch test submissions
const searchResponse = await axios.get(searchUrl, {
headers: { Cookie: `klz_gatekeeper_session=${gatekeeperPassword}` },
});
const testSubmissions = searchResponse.data.docs || [];
console.log(` Found ${testSubmissions.length} test submissions to clean up.`);
for (const doc of testSubmissions) {
try {
await axios.delete(`${apiUrl}/${doc.id}`, {
headers: { Cookie: `klz_gatekeeper_session=${gatekeeperPassword}` },
});
console.log(` ✅ Deleted submission: ${doc.id}`);
} catch (delErr: any) {
console.error(` ❌ Failed to delete submission ${doc.id}: ${delErr.message}`);
}
}
} catch (err: any) {
console.error(`❌ Cleanup failed: ${err.message}`);
// Don't mark the whole test as failed just because cleanup failed
}
await browser.close(); await browser.close();
// 5. Evaluation // 6. Evaluation
if (hasErrors) { if (hasErrors) {
console.error(`\n🚨 IMPORTANT: Form E2E checks failed. The CI build is failing.`); console.error(`\n🚨 IMPORTANT: Form E2E checks failed. The CI build is failing.`);
process.exit(1); process.exit(1);