Skip to content

Conversation

@roomote
Copy link

@roomote roomote bot commented Oct 26, 2025

This PR adds a visual hint for the keyboard shortcut to the auto-approve dropdown menu.


Important

Adds a keyboard shortcut hint to the auto-approve dropdown using a new ShortcutHint component and usePlatform hook.

  • Feature:
    • Adds ShortcutHint component to display keyboard shortcut in AutoApproveDropdown.tsx.
    • Uses usePlatform hook to determine platform-specific shortcuts ("⌘⌥A" for Mac, "Ctrl+Alt+A" for Windows/Linux).
  • Localization:
    • Adds toggleShortcut key to chat.json for shortcut hint translation.
  • New Files:
    • ShortcutHint.tsx for rendering shortcut hints.
    • usePlatform.ts for detecting user platform.

This description was created by Ellipsis for f37a5eb. You can customize this summary. It will automatically update as commits are pushed.

@roomote roomote bot requested review from cte, jr and mrubens as code owners October 26, 2025 17:46
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. UI/UX UI/UX related or focused labels Oct 26, 2025
@roomote
Copy link
Author

roomote bot commented Oct 26, 2025

Review Summary

I've reviewed the PR and found 2 minor issues to address:

  • Remove unused useAppTranslation import in ShortcutHint.tsx
  • Consider refactoring usePlatform hook to avoid double render (initial "unknown" state followed by actual platform)

The implementation looks good overall. The shortcut hint feature is well-integrated and uses proper i18n patterns.

Follow Along on Roo Code Cloud

}

export const ShortcutHint: React.FC<ShortcutHintProps> = ({ translationKey }) => {
const { t } = useAppTranslation()
Copy link
Author

Choose a reason for hiding this comment

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

The useAppTranslation hook is imported but never used. The component only uses the Trans component directly with the translationKey prop. Consider removing this unused import to keep the code clean.

Comment on lines +5 to +17
export function usePlatform(): Platform {
const [platform, setPlatform] = useState<Platform>("unknown")

useEffect(() => {
const userAgent = window.navigator.userAgent.toLowerCase()
if (userAgent.includes("mac")) {
setPlatform("mac")
} else if (userAgent.includes("win")) {
setPlatform("windows")
} else if (userAgent.includes("linux")) {
setPlatform("linux")
}
}, [])
Copy link
Author

Choose a reason for hiding this comment

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

The hook initializes platform state as "unknown" and updates it in useEffect, causing the component to render twice (first with "unknown", then with the actual platform). While this works in VSCode webviews, consider using useMemo with direct platform detection to avoid the initial render with incorrect state, especially if this hook is reused in SSR contexts later.

Copy link
Author

@roomote roomote bot left a comment

Choose a reason for hiding this comment

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

Review complete. Found 2 minor issues that should be addressed before merging.

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Oct 26, 2025
@daniel-lxs daniel-lxs closed this Oct 29, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Oct 29, 2025
@github-project-automation github-project-automation bot moved this from Triage to Done in Roo Code Roadmap Oct 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. size:M This PR changes 30-99 lines, ignoring generated files. UI/UX UI/UX related or focused

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants