From aaa96b921cbc327e3c6961e4f65ca4193d241124 Mon Sep 17 00:00:00 2001 From: juancwu Date: Mon, 18 May 2026 23:19:38 +0000 Subject: [PATCH] feat: keyboard shortcuts to add bill and/or deposit --- internal/ui/pages/space_overview.templ | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/internal/ui/pages/space_overview.templ b/internal/ui/pages/space_overview.templ index 65986a0..c5b4025 100644 --- a/internal/ui/pages/space_overview.templ +++ b/internal/ui/pages/space_overview.templ @@ -109,6 +109,13 @@ templ spaceSpecificSidebarContent(spaceID string) { } templ spaceAccountSidebarContent(spaceID, accountID string) { + {{ + billURL := routeurl.URL("page.app.spaces.space.accounts.account.bills.create", "spaceID", spaceID, "accountID", accountID) + depositURL := routeurl.URL("page.app.spaces.space.accounts.account.deposits.create", "spaceID", spaceID, "accountID", accountID) + shortcutScript := "on keydown[(metaKey or ctrlKey) and altKey and (code=='KeyB' or key=='b' or key=='B')] from window halt the event then set window.location.href to '" + billURL + "' end " + + "on keydown[(metaKey or ctrlKey) and altKey and (code=='KeyE' or key=='e' or key=='E')] from window halt the event then set window.location.href to '" + depositURL + "'" + }} + @sidebar.Group() { @sidebar.GroupLabel() { Account @@ -138,7 +145,7 @@ templ spaceAccountSidebarContent(spaceID, accountID string) { @sidebar.MenuButton(sidebar.MenuButtonProps{ Href: routeurl.URL("page.app.spaces.space.accounts.account.bills.create", "spaceID", spaceID, "accountID", accountID), IsActive: ctxkeys.URLPath(ctx) == routeurl.URL("page.app.spaces.space.accounts.account.bills.create", "spaceID", spaceID, "accountID", accountID), - Tooltip: "Pay Bills", + Tooltip: "Pay Bills (⌘/Ctrl + Alt + B)", }) { @icon.HandCoins() Pay Bills @@ -148,7 +155,7 @@ templ spaceAccountSidebarContent(spaceID, accountID string) { @sidebar.MenuButton(sidebar.MenuButtonProps{ Href: routeurl.URL("page.app.spaces.space.accounts.account.deposits.create", "spaceID", spaceID, "accountID", accountID), IsActive: ctxkeys.URLPath(ctx) == routeurl.URL("page.app.spaces.space.accounts.account.deposits.create", "spaceID", spaceID, "accountID", accountID), - Tooltip: "Deposit Funds", + Tooltip: "Deposit Funds (⌘/Ctrl + Alt + E)", }) { @icon.BanknoteArrowDown() Deposit Funds