Add language selection to post composer - #137
Conversation
Users can now select the language of their post from a dropdown in the compose modal footer. Supports 20 common languages with ISO 639-1 codes. - Added LanguageSelector component with dropdown UI - Updated DashPlatformClient.createPost to accept language parameter - Language defaults to English and resets when modal closes
📝 WalkthroughWalkthroughThis pull request adds language support to posts by introducing a new LanguageSelector component in the compose modal and updating the API client to accept and include a language parameter when creating posts, with English as the default language. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Comment |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
🕓 Ready for review — 65 ahead in queue (commit 0023ec9) |
thepastaclaw
left a comment
There was a problem hiding this comment.
Preliminary review — Codex only
The platform write path correctly forwards the selected two-letter language code while preserving English for existing callers. Two blocking composer lifecycle issues remain: Escape from the language popup discards the draft, and Radix dismissal paths retain the selected language for the next composition.
Validated blockers were found in the Codex precheck. Sonnet is deferred until a fresh Codex revalidation clears the blocker gate.
Review provenance
- Codex reviewers:
gpt-5.6-sol— general (failed),gpt-5.6-sol— general (completed) - Verifier:
gpt-5.6-sol— verifier - Sonnet: not run (deferred by blocker gate)
🔴 2 blocking
1 additional finding(s) omitted (not in diff).
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify each finding against the current code and only fix it if needed.
In `components/compose/compose-modal.tsx`:
- [BLOCKING] components/compose/compose-modal.tsx:111-130: Escape from the language menu discards the entire draft
The custom popup has no Escape handling or nested dismissable/menu primitive. Radix Dialog.Content uses a DismissableLayer whose capture-phase Escape handler calls onDismiss and then onOpenChange(false). Because the root passes setComposeOpen directly, the store replaces threadPosts when this happens. Pressing Escape while the language list is open therefore closes the entire composer and clears the draft instead of dismissing only the popup. Use an accessible Select or DropdownMenu primitive, or coordinate the popup state with Dialog.Content's onEscapeKeyDown so the first Escape closes only the language list.
- [BLOCKING] components/compose/compose-modal.tsx:851: Non-English selection survives normal dialog dismissal
postLanguage is reset only by handleClose, while Radix Escape and outside-pointer dismissals call this onOpenChange handler directly. ComposeModal remains mounted after its conditional dialog content closes, so selecting Spanish, dismissing through Radix, and opening a fresh composer resets the text but retains and submits language: "es". Route every close transition through handleClose or reset the language whenever isComposeOpen becomes false.
| {isOpen && ( | ||
| <div className="absolute bottom-full left-0 mb-1 w-40 max-h-60 overflow-y-auto bg-white dark:bg-neutral-800 rounded-lg shadow-lg border border-gray-200 dark:border-gray-700 z-50"> | ||
| {SUPPORTED_LANGUAGES.map((lang) => ( | ||
| <button | ||
| key={lang.code} | ||
| type="button" | ||
| onClick={() => { | ||
| onChange(lang.code) | ||
| setIsOpen(false) | ||
| }} | ||
| className={`w-full px-3 py-2 text-left text-sm transition-colors ${ | ||
| lang.code === value | ||
| ? 'bg-yappr-50 dark:bg-yappr-900/30 text-yappr-600 dark:text-yappr-400 font-medium' | ||
| : 'text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700' | ||
| }`} | ||
| > | ||
| {lang.name} | ||
| </button> | ||
| ))} | ||
| </div> |
There was a problem hiding this comment.
🔴 Blocking: Escape from the language menu discards the entire draft
The custom popup has no Escape handling or nested dismissable/menu primitive. Radix Dialog.Content uses a DismissableLayer whose capture-phase Escape handler calls onDismiss and then onOpenChange(false). Because the root passes setComposeOpen directly, the store replaces threadPosts when this happens. Pressing Escape while the language list is open therefore closes the entire composer and clears the draft instead of dismissing only the popup. Use an accessible Select or DropdownMenu primitive, or coordinate the popup state with Dialog.Content's onEscapeKeyDown so the first Escape closes only the language list.
source: ['codex']
Users can now select the language of their post from a dropdown in the compose modal footer. Supports 20 common languages with ISO 639-1 codes.
Summary by CodeRabbit
Release Notes
✏️ Tip: You can customize this high-level summary in your review settings.