Skip to content

feat(launch): refine recording HUD and language switching UX#362

Open
imAaryash wants to merge 4 commits intosiddharthvaddem:mainfrom
imAaryash:detect-system-lang
Open

feat(launch): refine recording HUD and language switching UX#362
imAaryash wants to merge 4 commits intosiddharthvaddem:mainfrom
imAaryash:detect-system-lang

Conversation

@imAaryash
Copy link
Copy Markdown

@imAaryash imAaryash commented Apr 6, 2026

Description

This PR improves the Launch/HUD recording controls UX and language switching flow.

It includes:

  • first-launch system language detection with a one-time suggestion prompt (only when the detected language is supported and different from default)
  • compact, reliable language switcher in the HUD
  • improved recording bar behavior to reduce distraction and clutter
  • translation updates for en, es, and zh-CN launch strings

Motivation

The current recording HUD and language selector behavior felt inconsistent and distracting in active recording flow.
This change improves clarity and usability by:

  • reducing visual noise while recording
  • preventing problematic language menu interaction/clipping behavior
  • ensuring the language onboarding experience is smoother for non-English users

Type of Change

  • Bug Fix
  • Refactor / Code Cleanup

Related Issue(s)

Fixes #356 & partially #363

Screenshots / Video

Screenshot 2026-04-06 093748 Screenshot 2026-04-06 092613

Summary by CodeRabbit

  • New Features

    • Centered system-language prompt on launch offering “switch” or “keep” actions.
    • New language selector in the HUD sidebar for quick locale switching (current locale marked).
  • UI / Bug Fixes

    • Reorganized HUD controls: recording buttons show time/auxiliary controls only when recording; other controls shown otherwise.
    • Improved dropdown/select behavior and sizing for long lists.
  • Localization

    • Added system-language prompt text in English, Spanish, and Chinese.

Copilot AI review requested due to automatic review settings April 6, 2026 04:20
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 6, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 515c1d54-6d11-4a2e-9521-caa6198e2299

📥 Commits

Reviewing files that changed from the base of the PR and between 3d20c67 and 5494acb.

📒 Files selected for processing (3)
  • src/i18n/locales/en/dialogs.json
  • src/i18n/locales/es/dialogs.json
  • src/i18n/locales/zh-CN/dialogs.json

📝 Walkthrough

Walkthrough

Adds 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

Cohort / File(s) Summary
I18n context & detection
src/contexts/I18nContext.tsx
Adds `systemLocaleSuggestion: Locale
Launch UI & HUD language controls
src/components/launch/LaunchWindow.tsx
Removes top-left always-rendered language <select>; adds centered system-language prompt modal wired to new i18n handlers. Adds HUD right-sidebar language DropdownMenu (uses SUPPORTED_LOCALES) that calls setLocale(loc) and resolveSystemLocaleSuggestion(). Restructures recording controls and moves minimize/close into sidebar; adjusts layout/overflow and button classing.
Select component API & rendering
src/components/ui/select.tsx
SelectContent now accepts showScrollButtons?: boolean and viewportClassName?: string. Scroll buttons are conditional; sizing/trigger-width classes moved to SelectPrimitive.Viewport and viewportClassName applied.
Localization: launch prompt
src/i18n/locales/en/launch.json, src/i18n/locales/es/launch.json, src/i18n/locales/zh-CN/launch.json
Adds systemLanguagePrompt namespace with title, description (uses {{language}}), switch, and keepDefault translations for English, Spanish, and Simplified Chinese.
Localization: tutorial text splits
src/i18n/locales/en/dialogs.json, src/i18n/locales/es/dialogs.json, src/i18n/locales/zh-CN/dialogs.json
Refactors tutorial text keys: splits previous explanation/explanationRemove/explanationCovered/explanationEnd into segmented keys (explanationBefore, remove, explanationMiddle, covered, explanationAfter) and splits step1Description into step1DescriptionBefore/step1DescriptionAfter.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested reviewers

  • siddharthvaddem
  • FabLrc

Poem

the app leans in and asks, "which tongue?"
a centered prompt, a tiny nudge among the HUD's hum,
dropdowns shuffle, locales get their checkmark,
buttons rearrange — lowkey elegant, kinda cursed spark,
languages align; the UI breathes. 🎉

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Out of Scope Changes check ❓ Inconclusive Tutorial dialog translation keys were refactored (explanation → explanationBefore/Middle/After, step1Description split), which appears tangential to language switching/HUD improvements. Clarify whether tutorial translation refactoring in dialogs.json is necessary for this PR's core objectives or belongs in a separate change.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed Title clearly summarizes the main changes: refining recording HUD controls and improving language switching UX.
Description check ✅ Passed Description covers motivation, type of change, related issues, and includes screenshots. Most template sections are addressed.
Linked Issues check ✅ Passed PR directly addresses #356 by implementing system language detection, language switcher in HUD, and ensuring language settings are discoverable without UI issues.

✏️ 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 launch translations for en, es, and zh-CN to 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.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between e571ecb and 08b5580.

📒 Files selected for processing (6)
  • src/components/launch/LaunchWindow.tsx
  • src/components/ui/select.tsx
  • src/contexts/I18nContext.tsx
  • src/i18n/locales/en/launch.json
  • src/i18n/locales/es/launch.json
  • src/i18n/locales/zh-CN/launch.json

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 08b5580 and 3d20c67.

📒 Files selected for processing (2)
  • src/components/launch/LaunchWindow.tsx
  • src/contexts/I18nContext.tsx

Copy link
Copy Markdown
Author

@imAaryash imAaryash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@imAaryash
Copy link
Copy Markdown
Author

imAaryash commented Apr 6, 2026

@siddharthvaddem @getSono is everything fine? or need any changes?

@FabLrc
Copy link
Copy Markdown
Contributor

FabLrc commented Apr 8, 2026

Hey @imAaryash ,
The PR looks great and work fine. I've added the french support; see -> #380 (implemented) and #390
You can add it or I'll make a new PR after yours :)

…anslations

fix(i18n): add missing tutorial dialog translation keys
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

screen recorder how tu set it up chinese?

4 participants