Review report

bitcoin-core/gui-qml: PR #886

2 suggestions

Optional improvements

Link

[suggestion] · The no-suggestion Tab test leaves focus behavior unspecified

The new no-suggestion test passes whether Tab retains or moves focus, leaving the console's intended keyboard-navigation behavior unprotected.

Location: qml/pages/node/CommandConsole.qml:332 (head).

Details and suggested fix

The fixture explicitly focuses the command input, then types foobar, which matches none of the mock commands. After Tab, the test checks only the text and submitted-command count. Under Qt's documented key-specific Keys contract, onTabPressed accepts the event by default, so the conditional event.accepted = true does not make the no-suggestion branch fall through to focus navigation. This behavior predates the PR. Decide which behavior the new test should preserve: if shell-style Tab consumption is intended, assert input.activeFocus === true and document that behavior in the handler comment. If Tab should instead advance focus without a completion, set event.accepted = false in that branch and test the intended focus destination. The acceptance analysis relies on the documented Qt contract; no keyboard interaction was run.


Link

[suggestion] · The injection-warning guard is limited to one file and parameter

The new CTest guard cannot reject injection warnings naming another QML file or parameter, even when those warnings arise during otherwise passing tests.

Location: test/CMakeLists.txt:173 (head).

Details and suggested fix

The expression requires both CommandConsole.qml and Parameter "event", although the deprecated-injection warning can name any signal parameter. Consider broadening it to the warning shape, for example the regex \.qml:[0-9:]+ Parameter "[^"]+" is not declared, with the corresponding CMake escaping. This retains the current detection and extends it to other exercised handlers. No equivalent warning-to-failure mechanism was found in the repository. The guard still depends on tests executing the handler and on Qt emitting the warning. Before widening it, validate the Qt 6.2, 6.4 and 6.10 CI jobs, including whether Qt-provided QML produces additional matches; neither warning availability on the older versions nor those additional matches has been checked.


Coverage details