Files
Zero/apps/mail/utils
Adam 8d7bb25dd8 dvorak for rene (#1738)
# Keyboard Layout Detection and Mapping for Shortcuts

## Description

Added keyboard layout detection and mapping to ensure keyboard shortcuts work correctly across different keyboard layouts. The implementation supports QWERTY, Dvorak, Colemak, AZERTY, and QWERTZ layouts, with automatic detection based on browser APIs and fallback methods. Also added a keyboard layout indicator component to show the current detected layout in the UI.

## Type of Change

-  New feature (non-breaking change which adds functionality)
- 🎨 UI/UX improvement
-  Performance improvement

## Areas Affected

- [x] User Interface/Experience

## Testing Done

- [x] Manual testing performed
- [x] Cross-browser testing (if UI changes)

## Checklist

- [x] I have performed a self-review of my code
- [x] I have commented my code, particularly in complex areas
- [x] My changes generate no new warnings

## Additional Notes

The implementation uses the KeyboardLayoutMap API when available, with fallbacks to language detection and predefined mappings. The keyboard layout indicator only appears when a non-QWERTY layout is detected.

Also includes some code quality improvements:
- Enhanced error handling in Gmail API interactions
- Simplified optimistic action refresh logic
- Improved rate limit handling on the server side

## Screenshots/Recordings

N/A

---

_By submitting this pull request, I confirm that my contribution is made under the terms of the project's license._

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
## Summary by CodeRabbit

* **New Features**
  * Added dynamic keyboard layout detection and mapping, supporting QWERTY, Dvorak, Colemak, Azerty, and QWERTZ.
  * Introduced a keyboard layout indicator to display the current layout in the mail app.
  * Enhanced keyboard shortcuts to display and map keys according to the detected keyboard layout.
  * Added a utility to convert key names to keyboard event codes for consistent shortcut handling.

* **Refactor**
  * Updated keyboard shortcut handling throughout the mail app to use layout-aware shortcuts.
  * Simplified optimistic action refresh logic and removed unused parameters.
  * Refactored internal retry logic for server-side Gmail API calls.
  * Replaced promise handling with Effect abstractions in server thread label modifications.

* **Style**
  * Cleaned up whitespace and reordered import statements in several components.

* **Chores**
  * Added additional logging for debugging and removed unnecessary log statements.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-07-15 13:00:31 -07:00
..
2025-07-15 13:00:31 -07:00
2025-07-15 13:00:31 -07:00