Run this protocol after the visual implementation is ready. It checks whether an Arabic-speaking visitor can read, enter, correct and submit information under realistic conditions, with evidence a developer can reproduce.
The Arabic heading looks balanced in the design file. On a cold load the font arrives late, the text wraps again and the action moves. A mixed-script identifier then becomes hard to read, while the rejected form gives no clear recovery path. Review those behaviors as separate acceptance boundaries.
Establish the cause of movement
Record a cold load under constrained network conditions. Inspect layout-shift elements alongside font requests, then retain the URL, device conditions and date. Repeat the same setup after a change. Lab evidence and real-user data answer different questions. Images without reserved dimensions and late-inserted content can also cause shifts; do not assign the entire problem to fonts without evidence.
Compare the actual font and fallback
Use next/font to organize self-hosted font loading and fallback adjustment. The local-font example requires the actual file at the shown path. Arial is a starting comparison, not a guarantee that an Arabic font's metrics match. Check real headings, supported characters and the weights used on the page.
import localFont from 'next/font/local'
const arabic = localFont({
src: './fonts/arabic.woff2',
display: 'swap',
fallback: ['Arial'],
adjustFontFallback: 'Arial',
})
// Apply arabic.className to the layout; verify real Arabic text.
Removing unused weights can reduce transfer size. Removing needed glyphs can produce fallback within a word. Verify font files, licensing and Arabic coverage. A fixed height that clips longer content hides one symptom while creating another; reserve space deliberately and retest variable content.
Separate language, direction and isolation
lang describes language, while dir establishes base direction. Isolate identifiers and evaluate mixed inputs individually. An LTR email field may be appropriate beside an Arabic label; a person's name or street address needs its own decision. This example belongs at the document level, not as a second html element inside a child component.
<html lang="ar" dir="rtl">
<body>
<p>رقم الطلب: <bdi dir="ltr">INV-1042</bdi></p>
<label htmlFor="email">البريد الإلكتروني</label>
<input id="email" type="email" dir="ltr" />
</body>
</html>
Describe logical edges
Use logical properties for spacing and borders. They reduce duplicated direction rules but do not decide the semantic order of steps or icons. Mirror directional symbols only when their meaning requires it. Preserve a DOM order that remains understandable for reading and keyboard navigation.
.service-card {
padding-inline: 1.5rem;
border-inline-start: 2px solid #38bdf8;
min-inline-size: 0;
overflow-wrap: anywhere;
}
.service-card h2 { line-height: 1.6; }
Follow the full journey
Enter a service through a deep link, switch languages, then complete the form with a long name, email address and number. Trigger a missing-field error and correct it with the keyboard. Inspect focus visibility, error association and retry behavior. Repeat on a narrow viewport and with enlarged text; the primary action must remain reachable.
Close with evidence
Record reproduction steps, expected behavior, actual behavior and the evidence that points to a cause. If font arrival creates another heading line, compare fallback metrics, title length and nearby reserved dimensions. Repeat both the measurement and user task. A single score cannot prove a complete Arabic experience.
Make the error correctable, not merely readable
Review direction by field meaning. An email may need LTR while a name or address requires a different decision. Associate the error with the input and retain useful values after rejection. This fragment belongs in a form component with an error state; server validation remains necessary.
// error is the validated field error from your form state.
<label htmlFor="email">البريد الإلكتروني</label>
<input id="email" type="email" dir="ltr"
aria-invalid={Boolean(error)}
aria-describedby={error ? 'email-error' : undefined} />
{error && <p id="email-error">{error}</p>}
After a rejected submission, the user must find and reach the correction with the keyboard. Choose an understandable announcement strategy and test its interaction with focus; repeated alerts do not guarantee comprehension. Also inspect a dialog or menu: DOM and focus order must remain understandable in both languages.
Hand over a reproducible review record
- A cold load with the delayed font and evidence of the moving element.
- The same long title on a narrow viewport and with enlarged text.
- Email and Latin identifiers inside Arabic context without reversing stored values.
- A rejected form followed by correction and retry, preserving fields and service context.
Keep the actual content and conditions stable across comparisons. A fix that handles a short heading but fails on the real service title is still open. Tool output supports the decision; completion of the user task is the acceptance boundary the client needs.
References: Next.js fonts, HTML direction, and CLS. Send the route and affected task through contact for a focused frontend review.
A concise acceptance checklist
- A cold load with font and layout-shift evidence.
- Email, numerals and Latin runs in Arabic content.
- Visible focus and keyboard completion.
- Recoverable errors with valid input preserved.