The visible problem may look like one API or tuning value, but reliability is decided by state ownership, resource bounds, and recovery after failure. Visual change does not communicate context to assistive technology. Move focus into a modal, restore it to the trigger, and focus the new route heading after navigation.
Frontend architecture is about state ownership, repeatable events, invalidation of stale async work, and cleanup after unmount—not the shape of the source directory.
Make the implementation decisions explicit
Turn the important choices into durable contracts: validate inputs, assign state ownership, define cleanup, and specify fallback for older peers. Later optimization must not change those semantics.
- Choose the most useful initial control and avoid default focus on destructive confirmation.
- Remember the trigger and restore only if it remains visible and enabled.
- Announce asynchronous errors through a live region while focusing a repairable field or summary.
Focus is interaction state. Put movement and restoration in component contracts and tests so visual refactors cannot silently break keyboard paths.
Failure paths that are easy to miss
Boundaries turn hidden assumptions into incidents. Weak networks, refresh, concurrency, and capacity need combined coverage because retries can hide each one in isolation.
- CSS hides the background while Tab still reaches invisible controls.
- Close attempts to focus an unmounted trigger and breaks later keyboard navigation.
- Every progress update steals focus and makes the rest of the UI unusable.
How to verify it before release
Observe both endpoints, persisted records, and operational signals during verification. One button state or one successful response cannot prove the complete loop.
- Complete connect, reject, send, cancel, and settings using keyboard only.
- Trigger navigation and an async error with a modal open and verify one final focus target.
- Use a screen reader to check heading hierarchy, live-region frequency, and post-close context.
The result must be correct, recoverable, and explainable. If any part depends on refreshing the page or an engineer guessing, the protocol loop remains incomplete.