mirror of
https://github.com/Darkrock-Studios/hammer-editor.git
synced 2026-08-18 22:13:15 +00:00
|
Some checks are pending
Build CI / build (push) Waiting to run
Build CI / static-analysis (push) Waiting to run
Build CI / android-instrumented-tests (push) Waiting to run
Build CI / iOS compile & test (push) Waiting to run
Build CI / iOS UI tests (push) Waiting to run
PublishInternal / publish-google-play (push) Waiting to run
* Handle F3 and Ctrl+Alt+S on the project window Both shortcuts hung off a Modifier.onPreviewKeyEvent in ProjectRootUi, so they only fired when focus sat inside the project subtree and did nothing from the home screen. Move them to the window onKeyEvent that already owns Esc, Ctrl+W, Ctrl+Q and Ctrl+Shift+F. F3 now goes through ProjectRoot.startProjectSync(), which opens the sync modal only for server-linked projects, restoring the gate the old sync menu item had. * Match shortcut modifiers exactly and run them pre-focus F3 and Ctrl+Alt+S were hand-rolled in the window's when-chain, which dropped the exact-modifier matching onKeyShortcut enforced: Ctrl+F3 and Ctrl+Alt+Shift+S both fired. Extract that predicate as KeyEvent.matchesShortcut and use it for both. Move the two to onPreviewKeyEvent as well. onKeyEvent only runs when nothing on the focus path consumed the key, so a focused editor could swallow them; the docs claimed otherwise. The other window shortcuts stay on onKeyEvent so a focused component can still handle Esc first. * Give Android and iOS the project shortcuts back Moving F3 and Ctrl+Alt+S to the desktop window left the other platforms with nothing. Add ProjectShortcutHost, which ProjectRootScaffold binds while the project UI is composed, and drive it from each platform's own key hook: Activity.dispatchKeyEvent on Android and UIKit key commands on iOS. Both are focus independent, which the Compose modifiers were not. The iOS container lives in Swift because keyCommands is an Objective-C category member and Kotlin cannot override those. * Bind the project shortcuts in one place Desktop kept its own copy of the save-all action while Android and iOS went through ProjectShortcutHost. Move the binding down to ProjectRootUi, the one composable all three platforms render, so each host only detects keys and calls the host object. That also lets the window drop the snackbar state and coroutine scope it had hoisted purely to run the action. |
||
|---|---|---|
| .. | ||
| playstore | ||
| src | ||
| build.gradle.kts | ||
| proguard-rules.pro | ||