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,
|
trackCreateRecipeOpened,
|
||||||
trackEditRecipeOpened,
|
trackEditRecipeOpened,
|
||||||
} from '../utils/analytics';
|
} from '../utils/analytics';
|
||||||
|
import { getNavigationShortcutText } from '../utils/keyboardShortcuts';
|
||||||
|
|
||||||
interface QueuedMessage {
|
interface QueuedMessage {
|
||||||
id: string;
|
id: string;
|
||||||
@@ -1212,7 +1213,7 @@ export default function ChatInput({
|
|||||||
data-testid="chat-input"
|
data-testid="chat-input"
|
||||||
autoFocus
|
autoFocus
|
||||||
id="dynamic-textarea"
|
id="dynamic-textarea"
|
||||||
placeholder={isRecording ? '' : '⌘↑/⌘↓ to navigate messages'}
|
placeholder={isRecording ? '' : getNavigationShortcutText()}
|
||||||
value={displayValue}
|
value={displayValue}
|
||||||
onChange={handleChange}
|
onChange={handleChange}
|
||||||
onCompositionStart={handleCompositionStart}
|
onCompositionStart={handleCompositionStart}
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ import {
|
|||||||
import { activateExtension } from '../settings/extensions';
|
import { activateExtension } from '../settings/extensions';
|
||||||
import { useConfig } from '../ConfigContext';
|
import { useConfig } from '../ConfigContext';
|
||||||
import { SearchView } from '../conversation/SearchView';
|
import { SearchView } from '../conversation/SearchView';
|
||||||
|
import { getSearchShortcutText } from '../../utils/keyboardShortcuts';
|
||||||
|
|
||||||
export type ExtensionsViewOptions = {
|
export type ExtensionsViewOptions = {
|
||||||
deepLinkConfig?: ExtensionConfig;
|
deepLinkConfig?: ExtensionConfig;
|
||||||
@@ -101,8 +102,8 @@ export default function ExtensionsView({
|
|||||||
</div>
|
</div>
|
||||||
<p className="text-sm text-text-muted mb-6">
|
<p className="text-sm text-text-muted mb-6">
|
||||||
These extensions use the Model Context Protocol (MCP). They can expand Goose's
|
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
|
capabilities using three main components: Prompts, Resources, and Tools.{' '}
|
||||||
search.
|
{getSearchShortcutText()} to search.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
{/* Action Buttons */}
|
{/* Action Buttons */}
|
||||||
|
|||||||
@@ -55,6 +55,7 @@ import {
|
|||||||
DropdownMenuTrigger,
|
DropdownMenuTrigger,
|
||||||
DropdownMenuSeparator,
|
DropdownMenuSeparator,
|
||||||
} from '../ui/dropdown-menu';
|
} from '../ui/dropdown-menu';
|
||||||
|
import { getSearchShortcutText } from '../../utils/keyboardShortcuts';
|
||||||
|
|
||||||
export default function RecipesView() {
|
export default function RecipesView() {
|
||||||
const setView = useNavigation();
|
const setView = useNavigation();
|
||||||
@@ -694,7 +695,7 @@ export default function RecipesView() {
|
|||||||
</div>
|
</div>
|
||||||
<p className="text-sm text-text-muted mb-1">
|
<p className="text-sm text-text-muted mb-1">
|
||||||
View and manage your saved recipes to quickly start new sessions with predefined
|
View and manage your saved recipes to quickly start new sessions with predefined
|
||||||
configurations. ⌘F/Ctrl+F to search.
|
configurations. {getSearchShortcutText()} to search.
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ import {
|
|||||||
Session,
|
Session,
|
||||||
updateSessionName,
|
updateSessionName,
|
||||||
} from '../../api';
|
} from '../../api';
|
||||||
|
import { getSearchShortcutText } from '../../utils/keyboardShortcuts';
|
||||||
|
|
||||||
interface EditSessionModalProps {
|
interface EditSessionModalProps {
|
||||||
session: Session | null;
|
session: Session | null;
|
||||||
@@ -740,7 +741,8 @@ const SessionListView: React.FC<SessionListViewProps> = React.memo(
|
|||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
<p className="text-sm text-text-muted mb-4">
|
<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>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</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