Skip to content

Commit e60733c

Browse files
Rounded keybinds table corners (#430)
1 parent 83ddbd4 commit e60733c

2 files changed

Lines changed: 31 additions & 34 deletions

File tree

src/main/frontend/app/routes/help/keybinds-table.tsx

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ export function KeybindsTable() {
6161
}
6262

6363
return (
64-
<div className="border-border border p-4">
65-
<div className="flex flex-col items-center">
64+
<div className="p-4">
65+
<div className="mb-5 flex flex-col items-center">
6666
<span className="mb-1 text-sm font-medium">Platform</span>
6767
<SwitchToggle
6868
options={['PC', 'Mac']}
@@ -71,28 +71,25 @@ export function KeybindsTable() {
7171
/>
7272
</div>
7373

74-
<div className="grid gap-8 md:grid-cols-2">
74+
<div className="grid items-start gap-6 md:grid-cols-2">
7575
{[...grouped.entries()].map(([scope, defs]) => (
76-
<div key={scope} className="mb-8">
77-
<h2 className="mb-2 text-center text-lg font-semibold">
76+
<div key={scope} className="border-border overflow-hidden rounded-md border">
77+
<h3 className="text-center">
7878
{scopeLabels[scope] ?? `${capitalize(scope)} Keybinds`}
79-
</h2>
80-
<table className="w-full border-collapse">
81-
<thead>
82-
<tr>
83-
<th>Action</th>
84-
<th>Keybinds</th>
85-
</tr>
86-
</thead>
87-
<tbody>
88-
{defs.map((shortcut) => (
89-
<tr key={shortcut.id}>
90-
<td>{shortcut.label}</td>
91-
<td>{formatKeybind(shortcut, platform)}</td>
92-
</tr>
93-
))}
94-
</tbody>
95-
</table>
79+
</h3>
80+
<div className="border-b-border bg-backdrop flex border-b font-bold">
81+
<div className="border-r-border flex-1 border-r px-[13px] py-[6px] text-sm">Action</div>
82+
<div className="flex-1 px-[13px] py-[6px] text-sm">Keybinds</div>
83+
</div>
84+
{defs.map((shortcut, i) => (
85+
<div
86+
key={shortcut.id}
87+
className={`border-b-border flex border-b last:border-b-0 ${i % 2 === 1 ? 'bg-backdrop' : 'bg-background'}`}
88+
>
89+
<div className="border-r-border flex-1 border-r px-[13px] py-[6px] text-sm">{shortcut.label}</div>
90+
<div className="flex-1 px-[13px] py-[6px] text-sm">{formatKeybind(shortcut, platform)}</div>
91+
</div>
92+
))}
9693
</div>
9794
))}
9895
</div>

src/main/frontend/app/stores/shortcut-store.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -158,18 +158,6 @@ export const ALL_SHORTCUTS: Omit<ShortcutDefinition, 'handler'>[] = [
158158
displayOnly: true,
159159
},
160160

161-
// Editor File Explorer
162-
{ id: 'explorer.new-file', label: 'New File', scope: 'editor', key: 'n' },
163-
{ id: 'explorer.new-folder', label: 'New Folder', scope: 'editor', key: 'n', modifiers: { shift: true } },
164-
{ id: 'explorer.rename', label: 'Rename Item', scope: 'editor', key: 'r' },
165-
{
166-
id: 'explorer.delete',
167-
label: 'Delete Item',
168-
scope: 'editor',
169-
key: { pc: 'delete', mac: 'backspace' },
170-
modifiers: { mac: { cmdOrCtrl: true } },
171-
},
172-
173161
// Studio File Explorer
174162
{ id: 'studio-explorer.new-config', label: 'New Configuration', scope: 'studio', key: 'c' },
175163
{ id: 'studio-explorer.new-adapter', label: 'New Adapter', scope: 'studio', key: 'a' },
@@ -182,6 +170,18 @@ export const ALL_SHORTCUTS: Omit<ShortcutDefinition, 'handler'>[] = [
182170
key: { pc: 'delete', mac: 'backspace' },
183171
modifiers: { mac: { cmdOrCtrl: true } },
184172
},
173+
174+
// Editor File Explorer
175+
{ id: 'explorer.new-file', label: 'New File', scope: 'editor', key: 'n' },
176+
{ id: 'explorer.new-folder', label: 'New Folder', scope: 'editor', key: 'n', modifiers: { shift: true } },
177+
{ id: 'explorer.rename', label: 'Rename Item', scope: 'editor', key: 'r' },
178+
{
179+
id: 'explorer.delete',
180+
label: 'Delete Item',
181+
scope: 'editor',
182+
key: { pc: 'delete', mac: 'backspace' },
183+
modifiers: { mac: { cmdOrCtrl: true } },
184+
},
185185
]
186186

187187
function buildInitialShortcuts(): Map<string, ShortcutDefinition> {

0 commit comments

Comments
 (0)