Repository navigation
feat(ui): add a public UI API for mods - #1224
Conversation
| LaunchedEffect(id) { | ||
| LOGGER.warn("OneConfig page {} is not registered, opening the mods page instead", id) | ||
| if (shell.navigation.currentRoute == PageRoute(id)) shell.navigation.navigate(ModsGraph) |
There was a problem hiding this comment.
🟡 [P2] Remove unavailable pages from history before falling back
When a mod unregisters a visited page, this fallback pushes the unavailable
PageRouteonto the back stack. Pressing Back then reopens that missing page, whose effect navigates to Mods again and pushes the same invalid entry back onto history. This repeats indefinitely, making earlier pages unreachable through Back. Remove or replace the unavailable history entry instead of performing ordinary navigation.
|
|
||
| @JvmStatic | ||
| val isRecording get() = escapeHandler != null | ||
| val isRecording get() = escapeHandler != null || KeybindManager.isInputCaptured() |
There was a problem hiding this comment.
🟡 [P2] Honor external input capture in the Escape path
When a custom control registers an active capture through
KeybindManager.addInputCapture,isRecordingbecomes true, butconsumeEscape()still returns false unless the internal escape handler is installed.ComposeScreen.dispatchKeyPressed()consequently reaches the unconditional Escape-close handler in both OneConfig screens before dispatching to Compose. Pressing Escape to cancel a custom recording therefore closes the entire menu. The Escape path needs to honor external capture and allow the control to handle the event.
|
Addressed both review points:
|
Mods have been reaching into
internalfor pages, themes, components, search and keybinds, and 1.4.4 already broke PolyPlus because of it. This gives them a public API underapi.ui.v1instead, all of it behind@ExperimentalOneConfigUiApifor now.ShellStateis replaced by aShellController.apidumps drop nested.internalpackages and@ApiStatus.Internalmembers. The config and HUD members mods use stay checked.