mirror of
https://github.com/SableClient/Sable.git
synced 2026-11-20 09:01:17 -08:00
fix(desktop): move Global shortcuts section to bottom and clarify wording
The Keyboard Shortcuts page now leads with the in-app sections and places Global last, with its system-wide explanation as a caption under the Global heading. Reword the intro to say "App-wide" instead of "Global" shortcuts, since Global now names a section whose shortcuts do run while typing.
This commit is contained in:
1 parent
50253fa7e8
commit
73517807e2
2 files changed
+16
-6
No files matched your search
@@ -82,8 +82,14 @@ describe('KeyboardShortcuts', () => {
|
||||
renderPage();
|
||||
|
||||
expect(await screen.findByText('Show or hide the app window')).toBeInTheDocument();
|
||||
expect(screen.getByText('Global')).toBeInTheDocument();
|
||||
expect(screen.getByText('Ctrl+Shift+S')).toBeInTheDocument();
|
||||
expect(
|
||||
screen.getByText(
|
||||
'Shortcuts in the Global section work system-wide, even when Sable is not focused.'
|
||||
)
|
||||
).toBeInTheDocument();
|
||||
const headings = screen.getAllByRole('heading', { level: 2 }).map((h) => h.textContent);
|
||||
expect(headings).toEqual(['General', 'Navigation', 'Messages', 'Global']);
|
||||
});
|
||||
|
||||
it('hides the Global section outside the desktop app', () => {
|
||||
|
||||
@@ -113,7 +113,7 @@ type KeyboardShortcutsProps = {
|
||||
export function KeyboardShortcuts({ requestBack, requestClose }: KeyboardShortcutsProps) {
|
||||
const isDesktop = isDesktopTauri();
|
||||
const CATEGORIES = isDesktop
|
||||
? (['Global', 'General', 'Navigation', 'Messages'] as const)
|
||||
? (['General', 'Navigation', 'Messages', 'Global'] as const)
|
||||
: (['General', 'Navigation', 'Messages'] as const);
|
||||
const [overrides, setOverrides] = useSetting(settingsAtom, 'shortcutOverrides');
|
||||
const [editingId, setEditingId] = useState<ShortcutId>();
|
||||
@@ -226,16 +226,20 @@ export function KeyboardShortcuts({ requestBack, requestClose }: KeyboardShortcu
|
||||
<PageContent>
|
||||
<Box direction="Column" gap="600">
|
||||
<Text size="T300" priority="300">
|
||||
Choose Change, then press a new key combination. Global shortcuts do not run while
|
||||
typing unless the action specifically supports it.
|
||||
{isDesktop &&
|
||||
' Shortcuts in the Global section work system-wide, even when Sable is not focused.'}
|
||||
Choose Change, then press a new key combination. App-wide shortcuts do not run
|
||||
while typing unless the action specifically supports it.
|
||||
</Text>
|
||||
{CATEGORIES.map((category) => (
|
||||
<Box key={category} direction="Column" gap="100">
|
||||
<Text size="L400" as="h2">
|
||||
{category}
|
||||
</Text>
|
||||
{category === 'Global' && (
|
||||
<Text size="T300" priority="300">
|
||||
Shortcuts in the Global section work system-wide, even when Sable is not
|
||||
focused.
|
||||
</Text>
|
||||
)}
|
||||
<Box direction="Column" gap="100">
|
||||
{SHORTCUTS.filter((shortcut) => shortcut.category === category).map(
|
||||
(shortcut) => (
|
||||
|
||||
Reference in new issue
Block a user