Skip to content

fix(columns): hide zero-width match runs that overpaint the row - #326

Closed
joebaus wants to merge 1 commit into
thisisgm:mainfrom
joebaus:column-search-overlap
Closed

joebaus wants to merge 1 commit into
thisisgm:mainfrom
joebaus:column-search-overlap

Conversation

@joebaus

@joebaus joebaus commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Fixes a transient Columns-view bug where a long search/filter-result filename overpaints the location/size text on first render, then heals after any window adjustment.

Root cause. ui/MatchText.qml renders a marked name as three runs (before/run/after), each width-clamped with Math.min(implicitWidth, …). Isolated windowed probes proved the clamp has a singular hole: clamping to 300/100/30 px elides correctly, but clamping to exactly 0 paints the full text (truncated=false — e.g. 525 px of tail from a width-0 box). Width 0 happens exactly when the match sits so late in a long name that the head fills the whole slot: the run/tail box goes to max(0, slot − slot) = 0 and both paint full-width over whatever follows. An early match never zeroes the box, so only late-match names trigger it. Any relayout recomputes the widths and the elision applies, hence the heal on resize. Single painter, no pooling involved — pooled delegates were ruled out by screenshot (Qt detaches them from rendering).

Fix. visible: width > 0 on beforeText, runText, afterText — mirroring the wash rectangle's existing visible: runText.width > 0 guard, which already accepted that a run with no room draws nothing. Normal rendering is untouched (probe fresh-load control is pixel-identical).

Verification.

  • Headless probe (real ColumnPane + StableModel + real Filter keystrokes, per-frame geometry + screenshots across filter, zero-pass landing, fresh-load control, and search-locating legs): COLPROBE PASS with the fix; the same probe fails without it (zero-width run visible + text-overflows-box on the late-match row), so the gate is sensitive to this exact defect.
  • staticgates.sh 14/14 (baseline remapped +6 lines for the added guards), flea-file-budget, qmllint (output identical to base), poolpark.sh, columnscost.sh, js.sh — green; release builds clean.
  • Visual check of the built tree against the repro below.

Repro (general). In Columns view, any filter (/) or search query whose match sits late enough in a long filename that the pre-match head fills the whole name slot. The run/tail box then clamps to width 0 and paints full-width over the location/size text until any relayout. Concrete instance: / then : in ~/Test on This is a visual test for where the : symbol is searched.md — the : sits deep enough in the name that the tail overpaints the size cell on first render. Rule of thumb: if the highlighted match would sit past the visible head of an overlong name, that row exercises the bug on the unfixed tree.

screenrecording-2026-10-17_23-23-00.mp4

Files: ui/MatchText.qml (+7), tests/staticgates-unqualified.tsv (20 baseline rows shifted).

Summary by CodeRabbit

  • Bug Fixes
    • Prevented zero-width text runs from being painted.

A Text with width Math.min(implicitWidth, parent.width) plus elide paints
its full text when the clamp lands on exactly 0. A match late in a long
name zeroes the run/tail box (the head fills the slot), so the run and
tail paint full-width over the location/size text until any relayout.
Guard all three runs with visible: width > 0, mirroring the wash's own
visible: runText.width > 0 gate.
@coderabbitai

coderabbitai Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 53451b24-9682-40a5-975e-7d4f378b0548
📥 Commits

Reviewing files that changed from the base of the PR and between f21789e and b9f05d7.

⛔ Files ignored due to path filters: 1
  • tests/staticgates-unqualified.tsv is excluded by !**/*.tsv
📒 Files selected for processing: 1
  • ui/MatchText.qml

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

📝 Walkthrough

The beforeText, runText, and afterText elements are now hidden when their computed width is zero.

Changes: Text run visibility

Layer / File(s) Summary
Zero-width visibility
ui/MatchText.qml
The three text elements are hidden when their computed width is zero.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Bug fix

Suggested reviewers: thisisgm

Merge Risk: ⚪ Minimal · up to b9f05

The change hides text runs with zero width to prevent overpainting. No actionable merge-blocking risk is identified.

Pre-merge checks: Passed 5
Check name Status Explanation
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: hiding zero-width match runs that overpaint the row.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@thisisgm

Copy link
Copy Markdown
Owner

Nice one, will fix!

@thisisgm

thisisgm commented Nov 3, 2026

Copy link
Copy Markdown
Owner

A late name match could paint over the next column. A match late in a long name no longer paints over the next column (ab9e18ba1c, v0.4.0). Thanks @joebaus! Release.

@thisisgm thisisgm closed this Nov 3, 2026
Jarmoco pushed a commit to Jarmoco/flea that referenced this pull request Nov 6, 2026
Joe Baus's fix: a match late in a long name clamped its run and tail to width 0,
and an elided Text at width 0 painted its whole text over the next cell.

Co-authored-by: joebaus <[email protected]>
Jarmoco pushed a commit to Jarmoco/flea that referenced this pull request Nov 6, 2026
Search and the filter match names that carry zero-width marks,
the way the text reads on screen (thisisgm#326).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants