mirror of
https://github.com/alkimake/paperclip.git
synced 2026-06-18 19:50:38 +09:00
feat(ui): add keyboard shortcut cheatsheet dialog on ? keypress
Shows a beautiful categorized cheatsheet of all keyboard shortcuts (inbox, issue detail, global) when the user presses ? with keyboard shortcuts enabled. Respects text input focus detection — won't trigger in text fields. Uses the existing Dialog component and Radix UI. Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
parent
69ff793c6a
commit
fad5634b29
3 changed files with 114 additions and 1 deletions
|
|
@ -12,6 +12,7 @@ import { NewIssueDialog } from "./NewIssueDialog";
|
|||
import { NewProjectDialog } from "./NewProjectDialog";
|
||||
import { NewGoalDialog } from "./NewGoalDialog";
|
||||
import { NewAgentDialog } from "./NewAgentDialog";
|
||||
import { KeyboardShortcutsCheatsheet } from "./KeyboardShortcutsCheatsheet";
|
||||
import { ToastViewport } from "./ToastViewport";
|
||||
import { MobileBottomNav } from "./MobileBottomNav";
|
||||
import { WorktreeBanner } from "./WorktreeBanner";
|
||||
|
|
@ -69,6 +70,7 @@ export function Layout() {
|
|||
const lastMainScrollTop = useRef(0);
|
||||
const [mobileNavVisible, setMobileNavVisible] = useState(true);
|
||||
const [instanceSettingsTarget, setInstanceSettingsTarget] = useState<string>(() => readRememberedInstanceSettingsPath());
|
||||
const [shortcutsOpen, setShortcutsOpen] = useState(false);
|
||||
const nextTheme = theme === "dark" ? "light" : "dark";
|
||||
const matchedCompany = useMemo(() => {
|
||||
if (!companyPrefix) return null;
|
||||
|
|
@ -151,6 +153,7 @@ export function Layout() {
|
|||
onNewIssue: () => openNewIssue(),
|
||||
onToggleSidebar: toggleSidebar,
|
||||
onTogglePanel: togglePanel,
|
||||
onShowShortcuts: () => setShortcutsOpen(true),
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
|
|
@ -443,6 +446,7 @@ export function Layout() {
|
|||
<NewProjectDialog />
|
||||
<NewGoalDialog />
|
||||
<NewAgentDialog />
|
||||
<KeyboardShortcutsCheatsheet open={shortcutsOpen} onOpenChange={setShortcutsOpen} />
|
||||
<ToastViewport />
|
||||
</div>
|
||||
</GeneralSettingsProvider>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue