feat: add Windows shortcuts to WelcomeView shortcut table

Show macOS and Windows shortcuts side-by-side in a three-column table.
Windows uses Ctrl instead of ⌘, Ctrl+Y for redo (vs ⌘⇧Z on Mac).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
MikiVL 2026-05-02 19:29:56 +08:00
parent ac18756797
commit 999d5e1b82

View File

@ -74,14 +74,14 @@ const FEATURES = [
] ]
const SHORTCUTS = [ const SHORTCUTS = [
{ keys: ['⌘', 'B'], desc: '粗体' }, { desc: '粗体', mac: ['⌘', 'B'], win: ['Ctrl', 'B'] },
{ keys: ['⌘', 'I'], desc: '斜体' }, { desc: '斜体', mac: ['⌘', 'I'], win: ['Ctrl', 'I'] },
{ keys: ['⌘', 'U'], desc: '下划线' }, { desc: '下划线', mac: ['⌘', 'U'], win: ['Ctrl', 'U'] },
{ keys: ['⌘', 'E'], desc: '行内代码' }, { desc: '行内代码', mac: ['⌘', 'E'], win: ['Ctrl', 'E'] },
{ keys: ['⌘', 'Z'], desc: '撤销' }, { desc: '撤销', mac: ['⌘', 'Z'], win: ['Ctrl', 'Z'] },
{ keys: ['⌘', '⇧', 'Z'], desc: '重做' }, { desc: '重做', mac: ['⌘', '⇧', 'Z'], win: ['Ctrl', 'Y'] },
{ keys: ['/'], desc: '命令菜单' }, { desc: '命令菜单', mac: ['/'], win: ['/'] },
{ keys: ['Esc'], desc: '退出专注模式' }, { desc: '退出专注模式', mac: ['Esc'], win: ['Esc'] },
] ]
export function WelcomeView() { export function WelcomeView() {
@ -164,22 +164,53 @@ export function WelcomeView() {
> >
</h2> </h2>
<div className="rounded-xl overflow-hidden" style={{ border: '1px solid var(--border)' }}>
{/* Header */}
<div <div
className="rounded-xl overflow-hidden" className="grid px-5 py-2 text-xs font-semibold uppercase tracking-wider"
style={{ border: '1px solid var(--border)' }} style={{
gridTemplateColumns: '1fr auto auto',
gap: '2rem',
background: 'var(--bg-muted)',
color: 'var(--text-faint)',
borderBottom: '1px solid var(--border)',
}}
> >
<span></span>
<span>macOS</span>
<span>Windows</span>
</div>
{SHORTCUTS.map((s, i) => ( {SHORTCUTS.map((s, i) => (
<div <div
key={s.desc} key={s.desc}
className="flex items-center justify-between px-5 py-3" className="grid items-center px-5 py-3"
style={{ style={{
gridTemplateColumns: '1fr auto auto',
gap: '2rem',
borderTop: i > 0 ? '1px solid var(--border)' : 'none', borderTop: i > 0 ? '1px solid var(--border)' : 'none',
background: 'var(--bg-subtle)', background: 'var(--bg-subtle)',
}} }}
> >
<span className="text-sm" style={{ color: 'var(--text-muted)' }}>{s.desc}</span> <span className="text-sm" style={{ color: 'var(--text-muted)' }}>{s.desc}</span>
<div className="flex items-center gap-1"> <div className="flex items-center gap-1 justify-end">
{s.keys.map(k => ( {s.mac.map(k => (
<kbd
key={k}
className="inline-flex items-center justify-center px-2 py-0.5 rounded text-xs font-mono"
style={{
background: 'var(--bg)',
border: '1px solid var(--border)',
color: 'var(--text)',
minWidth: 28,
boxShadow: '0 1px 0 var(--border)',
}}
>
{k}
</kbd>
))}
</div>
<div className="flex items-center gap-1 justify-end">
{s.win.map(k => (
<kbd <kbd
key={k} key={k}
className="inline-flex items-center justify-center px-2 py-0.5 rounded text-xs font-mono" className="inline-flex items-center justify-center px-2 py-0.5 rounded text-xs font-mono"