refactor: remove action functions from shortcut definitions
- commit
- 103eec06f7d4fee2085e34148fb412478239d41c
- author
- bamen · · 2025-09-26 04:08 UTC
- parent
- def2355
- signature
- unsigned
1 file · +18 -37
M gui/src/pages/Homepage.svelte +18 -37
| @@ -16,7 +16,6 @@ | |||
| 16 | 16 | interface Shortcut { | |
| 17 | 17 | key: string; | |
| 18 | 18 | description: string; | |
| 19 | - | action: () => void; | |
| 20 | 19 | } | |
| 21 | 20 | ||
| 22 | 21 | interface HistoryStats { | |
| @@ -95,95 +94,77 @@ | |||
| 95 | 94 | // Browser shortcuts | |
| 96 | 95 | { | |
| 97 | 96 | key: 'Ctrl+L', | |
| 98 | - | description: 'Focus address bar', | |
| 99 | - | action: () => console.log('Ctrl+L triggered') | |
| 97 | + | description: 'Focus address bar' | |
| 100 | 98 | }, | |
| 101 | 99 | { | |
| 102 | 100 | key: 'Ctrl+F', | |
| 103 | - | description: 'Find in page', | |
| 104 | - | action: () => console.log('Ctrl+F triggered') | |
| 101 | + | description: 'Find in page' | |
| 105 | 102 | }, | |
| 106 | 103 | { | |
| 107 | 104 | key: 'Ctrl+Shift+C', | |
| 108 | - | description: 'Copy URL', | |
| 109 | - | action: () => console.log('Ctrl+Shift+C triggered') | |
| 105 | + | description: 'Copy URL' | |
| 110 | 106 | }, | |
| 111 | 107 | { | |
| 112 | 108 | key: 'Ctrl+R / F5', | |
| 113 | - | description: 'Reload page', | |
| 114 | - | action: () => window.location.reload() | |
| 109 | + | description: 'Reload page' | |
| 115 | 110 | }, | |
| 116 | 111 | { | |
| 117 | 112 | key: 'Ctrl+Shift+R', | |
| 118 | - | description: 'Hard reload', | |
| 119 | - | action: () => console.log('Ctrl+Shift+R triggered') | |
| 113 | + | description: 'Hard reload' | |
| 120 | 114 | }, | |
| 121 | 115 | { | |
| 122 | 116 | key: 'F12', | |
| 123 | - | description: 'DevTools', | |
| 124 | - | action: () => console.log('F12 triggered') | |
| 117 | + | description: 'DevTools' | |
| 125 | 118 | }, | |
| 126 | 119 | { | |
| 127 | 120 | key: 'Ctrl+← / Ctrl+→', | |
| 128 | - | description: 'Navigate back/forward', | |
| 129 | - | action: () => console.log('Ctrl+Arrow triggered') | |
| 121 | + | description: 'Navigate back/forward' | |
| 130 | 122 | }, | |
| 131 | 123 | { | |
| 132 | 124 | key: 'Ctrl+0', | |
| 133 | - | description: 'Reset zoom', | |
| 134 | - | action: () => console.log('Ctrl+0 triggered') | |
| 125 | + | description: 'Reset zoom' | |
| 135 | 126 | }, | |
| 136 | 127 | { | |
| 137 | 128 | key: 'Ctrl++ / Ctrl+-', | |
| 138 | - | description: 'Zoom in/out', | |
| 139 | - | action: () => console.log('Ctrl+Zoom triggered') | |
| 129 | + | description: 'Zoom in/out' | |
| 140 | 130 | }, | |
| 141 | 131 | // Workspace pane mode | |
| 142 | 132 | { | |
| 143 | 133 | key: 'Ctrl+P', | |
| 144 | - | description: 'Enter pane mode', | |
| 145 | - | action: () => console.log('Ctrl+P triggered') | |
| 134 | + | description: 'Enter pane mode' | |
| 146 | 135 | }, | |
| 147 | 136 | { | |
| 148 | 137 | key: '→ / R (pane mode)', | |
| 149 | - | description: 'Split pane right', | |
| 150 | - | action: () => console.log('Split right triggered') | |
| 138 | + | description: 'Split pane right' | |
| 151 | 139 | }, | |
| 152 | 140 | { | |
| 153 | 141 | key: '← / L (pane mode)', | |
| 154 | - | description: 'Split pane left', | |
| 155 | - | action: () => console.log('Split left triggered') | |
| 142 | + | description: 'Split pane left' | |
| 156 | 143 | }, | |
| 157 | 144 | { | |
| 158 | 145 | key: '↑ / U (pane mode)', | |
| 159 | - | description: 'Split pane up', | |
| 160 | - | action: () => console.log('Split up triggered') | |
| 146 | + | description: 'Split pane up' | |
| 161 | 147 | }, | |
| 162 | 148 | { | |
| 163 | 149 | key: '↓ / D (pane mode)', | |
| 164 | - | description: 'Split pane down', | |
| 165 | - | action: () => console.log('Split down triggered') | |
| 150 | + | description: 'Split pane down' | |
| 166 | 151 | }, | |
| 167 | 152 | { | |
| 168 | 153 | key: 'X (pane mode)', | |
| 169 | - | description: 'Close current pane', | |
| 170 | - | action: () => console.log('Close pane triggered') | |
| 154 | + | description: 'Close current pane' | |
| 171 | 155 | }, | |
| 172 | 156 | { | |
| 173 | 157 | key: 'Enter (pane mode)', | |
| 174 | - | description: 'Confirm action', | |
| 175 | - | action: () => console.log('Confirm triggered') | |
| 158 | + | description: 'Confirm action' | |
| 176 | 159 | }, | |
| 177 | 160 | { | |
| 178 | 161 | key: 'Escape (pane mode)', | |
| 179 | - | description: 'Exit pane mode', | |
| 180 | - | action: () => console.log('Exit pane mode triggered') | |
| 162 | + | description: 'Exit pane mode' | |
| 181 | 163 | }, | |
| 182 | 164 | // Workspace navigation | |
| 183 | 165 | { | |
| 184 | 166 | key: 'Alt+Arrow Keys', | |
| 185 | - | description: 'Navigate between panes', | |
| 186 | - | action: () => console.log('Navigate panes triggered') | |
| 167 | + | description: 'Navigate between panes' | |
| 187 | 168 | } | |
| 188 | 169 | ]; | |
| 189 | 170 | shortcutsLoading = false; | |
| @@ -16,7 +16,6 @@ | |||||
| 16 | interface Shortcut { | 16 | interface Shortcut { | ||
| 17 | key: string; | 17 | key: string; | ||
| 18 | description: string; | 18 | description: string; | ||
| 19 | - | action: () => void; | |||
| 20 | } | 19 | } | ||
| 21 | 20 | ||||
| 22 | interface HistoryStats { | 21 | interface HistoryStats { | ||
| @@ -95,95 +94,77 @@ | |||||
| 95 | // Browser shortcuts | 94 | // Browser shortcuts | ||
| 96 | { | 95 | { | ||
| 97 | key: 'Ctrl+L', | 96 | key: 'Ctrl+L', | ||
| 98 | - | description: 'Focus address bar', | 97 | + | description: 'Focus address bar' |
| 99 | - | action: () => console.log('Ctrl+L triggered') | |||
| 100 | }, | 98 | }, | ||
| 101 | { | 99 | { | ||
| 102 | key: 'Ctrl+F', | 100 | key: 'Ctrl+F', | ||
| 103 | - | description: 'Find in page', | 101 | + | description: 'Find in page' |
| 104 | - | action: () => console.log('Ctrl+F triggered') | |||
| 105 | }, | 102 | }, | ||
| 106 | { | 103 | { | ||
| 107 | key: 'Ctrl+Shift+C', | 104 | key: 'Ctrl+Shift+C', | ||
| 108 | - | description: 'Copy URL', | 105 | + | description: 'Copy URL' |
| 109 | - | action: () => console.log('Ctrl+Shift+C triggered') | |||
| 110 | }, | 106 | }, | ||
| 111 | { | 107 | { | ||
| 112 | key: 'Ctrl+R / F5', | 108 | key: 'Ctrl+R / F5', | ||
| 113 | - | description: 'Reload page', | 109 | + | description: 'Reload page' |
| 114 | - | action: () => window.location.reload() | |||
| 115 | }, | 110 | }, | ||
| 116 | { | 111 | { | ||
| 117 | key: 'Ctrl+Shift+R', | 112 | key: 'Ctrl+Shift+R', | ||
| 118 | - | description: 'Hard reload', | 113 | + | description: 'Hard reload' |
| 119 | - | action: () => console.log('Ctrl+Shift+R triggered') | |||
| 120 | }, | 114 | }, | ||
| 121 | { | 115 | { | ||
| 122 | key: 'F12', | 116 | key: 'F12', | ||
| 123 | - | description: 'DevTools', | 117 | + | description: 'DevTools' |
| 124 | - | action: () => console.log('F12 triggered') | |||
| 125 | }, | 118 | }, | ||
| 126 | { | 119 | { | ||
| 127 | key: 'Ctrl+← / Ctrl+→', | 120 | key: 'Ctrl+← / Ctrl+→', | ||
| 128 | - | description: 'Navigate back/forward', | 121 | + | description: 'Navigate back/forward' |
| 129 | - | action: () => console.log('Ctrl+Arrow triggered') | |||
| 130 | }, | 122 | }, | ||
| 131 | { | 123 | { | ||
| 132 | key: 'Ctrl+0', | 124 | key: 'Ctrl+0', | ||
| 133 | - | description: 'Reset zoom', | 125 | + | description: 'Reset zoom' |
| 134 | - | action: () => console.log('Ctrl+0 triggered') | |||
| 135 | }, | 126 | }, | ||
| 136 | { | 127 | { | ||
| 137 | key: 'Ctrl++ / Ctrl+-', | 128 | key: 'Ctrl++ / Ctrl+-', | ||
| 138 | - | description: 'Zoom in/out', | 129 | + | description: 'Zoom in/out' |
| 139 | - | action: () => console.log('Ctrl+Zoom triggered') | |||
| 140 | }, | 130 | }, | ||
| 141 | // Workspace pane mode | 131 | // Workspace pane mode | ||
| 142 | { | 132 | { | ||
| 143 | key: 'Ctrl+P', | 133 | key: 'Ctrl+P', | ||
| 144 | - | description: 'Enter pane mode', | 134 | + | description: 'Enter pane mode' |
| 145 | - | action: () => console.log('Ctrl+P triggered') | |||
| 146 | }, | 135 | }, | ||
| 147 | { | 136 | { | ||
| 148 | key: '→ / R (pane mode)', | 137 | key: '→ / R (pane mode)', | ||
| 149 | - | description: 'Split pane right', | 138 | + | description: 'Split pane right' |
| 150 | - | action: () => console.log('Split right triggered') | |||
| 151 | }, | 139 | }, | ||
| 152 | { | 140 | { | ||
| 153 | key: '← / L (pane mode)', | 141 | key: '← / L (pane mode)', | ||
| 154 | - | description: 'Split pane left', | 142 | + | description: 'Split pane left' |
| 155 | - | action: () => console.log('Split left triggered') | |||
| 156 | }, | 143 | }, | ||
| 157 | { | 144 | { | ||
| 158 | key: '↑ / U (pane mode)', | 145 | key: '↑ / U (pane mode)', | ||
| 159 | - | description: 'Split pane up', | 146 | + | description: 'Split pane up' |
| 160 | - | action: () => console.log('Split up triggered') | |||
| 161 | }, | 147 | }, | ||
| 162 | { | 148 | { | ||
| 163 | key: '↓ / D (pane mode)', | 149 | key: '↓ / D (pane mode)', | ||
| 164 | - | description: 'Split pane down', | 150 | + | description: 'Split pane down' |
| 165 | - | action: () => console.log('Split down triggered') | |||
| 166 | }, | 151 | }, | ||
| 167 | { | 152 | { | ||
| 168 | key: 'X (pane mode)', | 153 | key: 'X (pane mode)', | ||
| 169 | - | description: 'Close current pane', | 154 | + | description: 'Close current pane' |
| 170 | - | action: () => console.log('Close pane triggered') | |||
| 171 | }, | 155 | }, | ||
| 172 | { | 156 | { | ||
| 173 | key: 'Enter (pane mode)', | 157 | key: 'Enter (pane mode)', | ||
| 174 | - | description: 'Confirm action', | 158 | + | description: 'Confirm action' |
| 175 | - | action: () => console.log('Confirm triggered') | |||
| 176 | }, | 159 | }, | ||
| 177 | { | 160 | { | ||
| 178 | key: 'Escape (pane mode)', | 161 | key: 'Escape (pane mode)', | ||
| 179 | - | description: 'Exit pane mode', | 162 | + | description: 'Exit pane mode' |
| 180 | - | action: () => console.log('Exit pane mode triggered') | |||
| 181 | }, | 163 | }, | ||
| 182 | // Workspace navigation | 164 | // Workspace navigation | ||
| 183 | { | 165 | { | ||
| 184 | key: 'Alt+Arrow Keys', | 166 | key: 'Alt+Arrow Keys', | ||
| 185 | - | description: 'Navigate between panes', | 167 | + | description: 'Navigate between panes' |
| 186 | - | action: () => console.log('Navigate panes triggered') | |||
| 187 | } | 168 | } | ||
| 188 | ]; | 169 | ]; | ||
| 189 | shortcutsLoading = false; | 170 | shortcutsLoading = false; | ||