Skip to content

feat: use theme color for shortcuts rows #5520

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 6, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 6 additions & 10 deletions gui/src/pages/config/KeyboardShortcuts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,10 @@ interface KeyboardShortcutProps {
function KeyboardShortcut(props: KeyboardShortcutProps) {
return (
<div
className="sm:flex-row flex-col flex items-start sm:items-center py-2"
style={{
backgroundColor: props.isEven ? '#1e1e1e' : 'transparent',
}}
className={`flex flex-col items-start p-2 py-2 sm:flex-row sm:items-center ${props.isEven ? "bg-list-active" : ""}`}
>
<div className="flex-grow pr-4 pb-1 sm:pb-0 w-full sm:w-auto">
<span className="text-xs block break-words">{props.description}:</span>
<div className="w-full flex-grow pb-1 pr-4 sm:w-auto sm:pb-0">
<span className="block break-words text-xs">{props.description}:</span>
</div>
<div className="flex-shrink-0 whitespace-nowrap">
<Shortcut>{props.shortcut}</Shortcut>
Expand All @@ -27,7 +24,7 @@ function KeyboardShortcut(props: KeyboardShortcutProps) {
}

// Shortcut strings will be rendered correctly based on the platform by the Shortcut component
const vscodeShortcuts: Omit<KeyboardShortcutProps, 'isEven'>[] = [
const vscodeShortcuts: Omit<KeyboardShortcutProps, "isEven">[] = [
{
shortcut: "cmd '",
description: "Toggle Selected Model",
Expand Down Expand Up @@ -84,7 +81,7 @@ const vscodeShortcuts: Omit<KeyboardShortcutProps, 'isEven'>[] = [
},
];

const jetbrainsShortcuts: Omit<KeyboardShortcutProps, 'isEven'>[] = [
const jetbrainsShortcuts: Omit<KeyboardShortcutProps, "isEven">[] = [
{
shortcut: "cmd '",
description: "Toggle Selected Model",
Expand Down Expand Up @@ -135,7 +132,7 @@ function KeyboardShortcuts() {
}, []);

return (
<div className="p-5 h-full overflow-auto">
<div className="h-full overflow-auto p-5">
<h3 className="mb-5 text-xl">Keyboard shortcuts</h3>
<div>
{shortcuts.map((shortcut, i) => {
Expand All @@ -154,4 +151,3 @@ function KeyboardShortcuts() {
}

export default KeyboardShortcuts;

Loading