docs(rules): record Qt offscreen-test and layout gotchas#82
Merged
Conversation
The transactions-view work surfaced three Qt traps worth codifying so a future app session reads the lesson instead of re-discovering it: - Offscreen assertions: a control's visible/enabled getter returns effective (ancestor/window-dependent) state, so it reads false in the offscreen harness even when the local binding is true. Assert a logical readonly bool instead, and bind the visual property to it. - Layout recursive-rearrange: binding a child's Layout.preferredWidth to its parent layout's own size feeds back and Qt aborts the pass with a runtime warning headless tests spam but pass through. Use fillWidth, and give ListView delegates a fixed width sized height-from-content. - Mock faithfulness: when a mock models client-internal behavior, mirror the real client's observable state transitions so specs see realistic states. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
The transactions-view work (#33, merged in PR #81) ran into a few Qt traps that aren't captured anywhere, so the next app session would re-discover them the hard way. This records them in the path-conditioned
qt-app.mdrule (which loads only whenapp/files are edited), turning hard-won debugging into guidance.Three additions:
visible/enabledgetter returns effective state (ancestor- and window-dependent), so it reads false under the offscreen test harness even when the local binding is true. Assert a logicalreadonly property boolinstead, and bind the visual property to it.Layout.preferredWidthto its parent layout's own size feeds back and makes Qt abort the layout pass with a runtime warning headless tests log but pass through. UseLayout.fillWidth, and giveListViewdelegates a fixed width sized height-from-content.Follows up the work in #33 (PR #81).