Repository navigation
dock: polish the app grid - #17539
itscallssh wants to merge 2 commits into
Conversation
[Medium impact] The changes stay within the dock's app-grid browsing workflow. The new tests must exercise the code used by
|
| assert(/FilterInput\s*\{[^}]*keyHandler:\s*keyCatcher/.test(source), 'the search line is a FilterInput the grid handles keys for, so input methods reach it') | ||
| assert(!/root\.filterText\s*\+\s*event\.text/.test(source), 'the grid does not type into the search itself, which would leave input methods out') | ||
| assert(!/Qt\.callLater\(function\(\) \{ keyCatcher\.forceActiveFocus/.test(source), 'focus goes to the search line, not to the key catcher behind it') | ||
|
|
||
| assert(/PointerMoveGate\s*\{/.test(source) && /pointerGate\.moved\(/.test(source), 'hover selects through the pointer gate, so scrolling cells do not take the selection') | ||
| assert(!/onContainsMouseChanged/.test(source), 'hover does not select on cells arriving under a resting pointer') | ||
|
|
||
| assert(/WheelHandler\s*\{/.test(source) && /GradientStop/.test(source) && !/ScrollBar|scrollbar/i.test(source), 'the grid scrolls the way the menu does: its wheel and edge scrims, no scrollbar') |
There was a problem hiding this comment.
Tests check strings, not behavior
These assertions match strings in AppGrid.qml instead of testing what the grid does. AGENTS.md explicitly forbids tests that restate the implementation by checking source text. They can pass with broken behavior and fail after harmless rewrites. Remove them or replace them with behavior checks before merging.
File Used: AGENTS.md (source)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
| scale: cellMouse.pressed && !cell.moved ? 0.92 : 1 | ||
| Behavior on scale { | ||
| id: pressScale | ||
| NumberAnimation { duration: Style.duration(pressScale.targetValue < 1 ? 80 : 140); easing.type: Easing.OutCubic } |
There was a problem hiding this comment.
Press motion breaks shell rules
The new scale animation uses Easing.OutCubic. The motion guide required by AGENTS.md says movement must use Style.easeOut; it allows Easing.OutCubic for plain fades. Use Easing.Bezier with easing.bezierCurve: Style.easeOut before merging.
File Used: AGENTS.md (source)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
|
|
||
| source "$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)/base-test.sh" | ||
|
|
||
| ROOT="$ROOT" run_node_test <<'JS' |
There was a problem hiding this comment.
This adds a separate test file even though dock-test.sh already covers the dock. AGENTS.md requires extending the area’s existing test file instead of adding another *-test.sh. Move the useful selectRows behavior tests into dock-test.sh before merging.
File Used: AGENTS.md (source)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
| const gridView = (contentY, originY = 0) => ({ contentY, originY, height: 600, contentHeight: 1000 }) | ||
| const peeked = (contentY, row, next, previous, originY = 0) => | ||
| dock.gridPeekedContentY(gridView(contentY, originY), { y: row * 150, height: 150 }, 56, next, previous) | ||
| assertEqual(peeked(0, 1, true, true), 0, 'app grid leaves the view alone for a row with room around it') | ||
| assertEqual(peeked(0, 3, true, true), 56, 'app grid scrolls a peek of the next row into view past a row flush with the bottom') |
There was a problem hiding this comment.
The new tests call helpers that AppGrid.qml never uses. The grid still keeps separate code for navigation, scrolling, and tile sizes, so these tests can pass even if that code breaks. This violates the AGENTS.md requirement that tests catch real regressions. Before merging, have AppGrid.qml use the tested helpers, or test its actual behavior instead.
File Used: AGENTS.md (source)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
dock: polish the app grid
What
Polishes the dock's app grid (
shell/plugins/dock/AppGrid.qml) and addsautomated tests for it (
test/shell.d/app-grid-test.sh).Changes
FilterInput, so input methods (IME) work.PointerMoveGate), not when the grid scrolls under a still cursor.Testing
Screenshots
Before:

After:
