fix: Show platform-specific keyboard shortcuts in UI (#6323)
Signed-off-by: Abhijay007 <Abhijay007j@gmail.com>
This commit is contained in:
@@ -37,6 +37,7 @@ import {
|
||||
trackCreateRecipeOpened,
|
||||
trackEditRecipeOpened,
|
||||
} from '../utils/analytics';
|
||||
import { getNavigationShortcutText } from '../utils/keyboardShortcuts';
|
||||
|
||||
interface QueuedMessage {
|
||||
id: string;
|
||||
@@ -1212,7 +1213,7 @@ export default function ChatInput({
|
||||
data-testid="chat-input"
|
||||
autoFocus
|
||||
id="dynamic-textarea"
|
||||
placeholder={isRecording ? '' : '⌘↑/⌘↓ to navigate messages'}
|
||||
placeholder={isRecording ? '' : getNavigationShortcutText()}
|
||||
value={displayValue}
|
||||
onChange={handleChange}
|
||||
onCompositionStart={handleCompositionStart}
|
||||
|
||||
@@ -17,6 +17,7 @@ import {
|
||||
import { activateExtension } from '../settings/extensions';
|
||||
import { useConfig } from '../ConfigContext';
|
||||
import { SearchView } from '../conversation/SearchView';
|
||||
import { getSearchShortcutText } from '../../utils/keyboardShortcuts';
|
||||
|
||||
export type ExtensionsViewOptions = {
|
||||
deepLinkConfig?: ExtensionConfig;
|
||||
@@ -101,8 +102,8 @@ export default function ExtensionsView({
|
||||
</div>
|
||||
<p className="text-sm text-text-muted mb-6">
|
||||
These extensions use the Model Context Protocol (MCP). They can expand Goose's
|
||||
capabilities using three main components: Prompts, Resources, and Tools. ⌘F/Ctrl+F to
|
||||
search.
|
||||
capabilities using three main components: Prompts, Resources, and Tools.{' '}
|
||||
{getSearchShortcutText()} to search.
|
||||
</p>
|
||||
|
||||
{/* Action Buttons */}
|
||||
|
||||
@@ -55,6 +55,7 @@ import {
|
||||
DropdownMenuTrigger,
|
||||
DropdownMenuSeparator,
|
||||
} from '../ui/dropdown-menu';
|
||||
import { getSearchShortcutText } from '../../utils/keyboardShortcuts';
|
||||
|
||||
export default function RecipesView() {
|
||||
const setView = useNavigation();
|
||||
@@ -694,7 +695,7 @@ export default function RecipesView() {
|
||||
</div>
|
||||
<p className="text-sm text-text-muted mb-1">
|
||||
View and manage your saved recipes to quickly start new sessions with predefined
|
||||
configurations. ⌘F/Ctrl+F to search.
|
||||
configurations. {getSearchShortcutText()} to search.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -30,6 +30,7 @@ import {
|
||||
Session,
|
||||
updateSessionName,
|
||||
} from '../../api';
|
||||
import { getSearchShortcutText } from '../../utils/keyboardShortcuts';
|
||||
|
||||
interface EditSessionModalProps {
|
||||
session: Session | null;
|
||||
@@ -740,7 +741,8 @@ const SessionListView: React.FC<SessionListViewProps> = React.memo(
|
||||
</Button>
|
||||
</div>
|
||||
<p className="text-sm text-text-muted mb-4">
|
||||
View and search your past conversations with Goose. ⌘F/Ctrl+F to search.
|
||||
View and search your past conversations with Goose. {getSearchShortcutText()} to
|
||||
search.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
function isMac(): boolean {
|
||||
return window.electron?.platform === 'darwin';
|
||||
}
|
||||
|
||||
export function getNavigationShortcutText(): string {
|
||||
return isMac() ? '⌘↑/⌘↓ to navigate messages' : 'Ctrl+↑/Ctrl+↓ to navigate messages';
|
||||
}
|
||||
|
||||
export function getSearchShortcutText(): string {
|
||||
return isMac() ? '⌘F' : 'Ctrl+F';
|
||||
}
|
||||
Reference in New Issue
Block a user