feat(launch): refine recording HUD and language switching UX#362
feat(launch): refine recording HUD and language switching UX#362imAaryash wants to merge 4 commits intosiddharthvaddem:mainfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughAdds system-language detection with a user-facing prompt and handlers, moves language selection into a HUD sidebar dropdown, replaces inline select with modal prompt in launch, extends SelectContent props for optional scroll buttons/viewport classing, and updates i18n JSON for the new prompt and tutorial text key splits. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
This PR refines the Launch/HUD user experience by adding a one-time system-language suggestion prompt and redesigning the in-HUD language switcher and recording controls to reduce distraction and clipping issues.
Changes:
- Add first-launch system language detection and a one-time suggestion prompt via
I18nContext. - Replace the previous LaunchWindow language selector with a compact HUD language menu and adjust recording bar controls/layout.
- Update
launchtranslations foren,es, andzh-CNto support the new prompt strings.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/i18n/locales/en/launch.json | Adds systemLanguagePrompt strings for the new onboarding prompt. |
| src/i18n/locales/es/launch.json | Adds Spanish systemLanguagePrompt strings. |
| src/i18n/locales/zh-CN/launch.json | Adds Chinese systemLanguagePrompt strings. |
| src/contexts/I18nContext.tsx | Implements supported system-locale detection and prompt state/actions with persistence. |
| src/components/ui/select.tsx | Extends SelectContent API and adjusts viewport sizing/scroll button behavior. |
| src/components/launch/LaunchWindow.tsx | Introduces the system-language prompt UI and a new HUD language menu + recording HUD behavior updates. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 08b5580ca2
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/components/launch/LaunchWindow.tsx`:
- Around line 197-220: The handler name onPointerDown in the useEffect is
inconsistent with the event it's attached to
(document.addEventListener("mousedown", ...)); rename the function to
onMouseDown or, alternatively, change the event to "pointerdown" so naming and
behavior match; update both the function declaration (currently referenced as
onPointerDown) and the addEventListener/removeEventListener calls involving
document and keep references to isLanguageMenuOpen, languageMenuRef, and
setIsLanguageMenuOpen intact.
- Around line 573-594: The language menu is not keyboard accessible; replace the
custom conditional JSX using
isLanguageMenuOpen/SUPPORTED_LOCALES/setLocale/setIsLanguageMenuOpen/getLocaleName
in LaunchWindow with the existing Radix-based wrapper from
src/components/ui/dropdown-menu.tsx so you get built-in focus management,
arrow-key navigation and ARIA roles; render SUPPORTED_LOCALES as
DropdownMenu.Trigger and DropdownMenu.Content (or DropdownMenu.Item) entries,
keep the checkmark for the selected locale, call setLocale(...) and close the
menu (setIsLanguageMenuOpen(false) or use Radix's onSelect/close) on selection,
and remove the manual Escape handling — alternatively, if you keep the custom
implementation add role="menu"/role="menuitem", manage focus on open, and
implement onKeyDown to handle ArrowUp/ArrowDown/Home/End/Enter/Escape for proper
keyboard navigation and selection.
In `@src/contexts/I18nContext.tsx`:
- Around line 119-139: The effect currently lists systemLocaleSuggestion in its
dependency array but the effect is intended to run only once (it early-returns
when suggestion exists), so replace that dep with a run-once ref: create a ref
(e.g., hasRunRef) at top of the component, check hasRunRef.current at the start
of the useEffect and set it to true when you proceed, then change the dependency
array to only include markPromptAsHandled; keep the existing guards
(hasStoredLocale, hasHandledSystemPrompt, getSupportedSystemLocale,
setSystemLocaleSuggestion, markPromptAsHandled) unchanged so behavior is
identical but the effect no longer depends on systemLocaleSuggestion.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: ca1cc556-e354-47ae-8f02-a315a4eea1d5
📒 Files selected for processing (6)
src/components/launch/LaunchWindow.tsxsrc/components/ui/select.tsxsrc/contexts/I18nContext.tsxsrc/i18n/locales/en/launch.jsonsrc/i18n/locales/es/launch.jsonsrc/i18n/locales/zh-CN/launch.json
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/components/launch/LaunchWindow.tsx`:
- Around line 538-574: The onSelect handler inside the DropdownMenuItem always
calls resolveSystemLocaleSuggestion() even when the user re-selects the current
locale; change the handler so it only updates when loc !== locale by checking
the current locale first, and only then call setLocale(loc) and
resolveSystemLocaleSuggestion(); locate the onSelect on the DropdownMenuItem
within the SUPPORTED_LOCALES mapping and use the existing locale, setLocale, and
resolveSystemLocaleSuggestion identifiers to implement the guard.
- Around line 467-490: Replace the non-standard Tailwind opacity utilities in
the LaunchWindow button className (the ternary branch that uses recording and
paused) with standard scale values: change "bg-red-500/12" to "bg-red-500/10"
and "bg-red-500/16" to "bg-red-500/15" inside the className string used for the
recording toggle button in LaunchWindow.tsx (the button that calls
toggleRecording and renders getIcon based on
recording/paused/hasSelectedSource).
In `@src/contexts/I18nContext.tsx`:
- Around line 154-162: The two callbacks dismissSystemLocaleSuggestion and
resolveSystemLocaleSuggestion are identical; replace the duplicate by creating a
single useCallback (calling setSystemLocaleSuggestion(null) and
markPromptAsHandled()) and assign the other name as an alias to it (keep the
original useCallback named dismissSystemLocaleSuggestion and set
resolveSystemLocaleSuggestion = dismissSystemLocaleSuggestion) so callers keep
semantic names while removing duplicated code; reference the existing symbols
dismissSystemLocaleSuggestion, resolveSystemLocaleSuggestion,
setSystemLocaleSuggestion, and markPromptAsHandled when making the change.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: bad7f768-ca01-4454-90c6-15336e6dfcb1
📒 Files selected for processing (2)
src/components/launch/LaunchWindow.tsxsrc/contexts/I18nContext.tsx
|
@siddharthvaddem @getSono is everything fine? or need any changes? |
|
Hey @imAaryash , |
…anslations fix(i18n): add missing tutorial dialog translation keys
Description
This PR improves the Launch/HUD recording controls UX and language switching flow.
It includes:
en,es, andzh-CNlaunch stringsMotivation
The current recording HUD and language selector behavior felt inconsistent and distracting in active recording flow.
This change improves clarity and usability by:
Type of Change
Related Issue(s)
Fixes #356 & partially #363
Screenshots / Video
Summary by CodeRabbit
New Features
UI / Bug Fixes
Localization