Skip to content

Fix highlight data 0 length#4382

Merged
VictoriousRaptor merged 1 commit intodevfrom
fix-highlightdata-0-len
Mar 28, 2026
Merged

Fix highlight data 0 length#4382
VictoriousRaptor merged 1 commit intodevfrom
fix-highlightdata-0-len

Conversation

@VictoriousRaptor
Copy link
Copy Markdown
Contributor

@VictoriousRaptor VictoriousRaptor commented Mar 28, 2026

Follow #4196


Summary by cubic

Fixes missing title highlights when an empty highlight data list is passed by falling back to fuzzy search match data. Applies to both folder and file results to keep highlighting consistent.

  • Summary of changes
    • Changed: TitleHighlightData now falls back to Context.API.FuzzySearch(query.Search, title).MatchData when highlightData is null or has length 0 in CreateFolderResult and CreateFileResult.
    • Added: Explicit zero-length check for highlightData to trigger the fallback.
    • Removed: Passing through empty highlightData, which produced no highlights.
    • Memory: Negligible impact; only allocates match data when highlightData is empty.
    • Security: No risks; UI-only change affecting result highlighting.
    • Tests: No unit tests added; consider tests for null and empty highlightData.

Written for commit d03b698. Summary will update on new commits.

@prlabeler prlabeler Bot added the bug Something isn't working label Mar 28, 2026
@github-actions github-actions Bot added this to the 2.2.0 milestone Mar 28, 2026
@gitstream-cm
Copy link
Copy Markdown

gitstream-cm Bot commented Mar 28, 2026

🥷 Code experts: Jack251970

Jack251970 has most 👩‍💻 activity in the files.
Jack251970 has most 🧠 knowledge in the files.

See details

Plugins/Flow.Launcher.Plugin.Explorer/Search/ResultManager.cs

Activity based on git-commit:

Jack251970
MAR 45 additions & 0 deletions
FEB
JAN
DEC
NOV
OCT 420 additions & 0 deletions

Knowledge based on git-blame:
Jack251970: 98%

✨ Comment /gs review for LinearB AI review. Learn how to automate it here.

@gitstream-cm
Copy link
Copy Markdown

gitstream-cm Bot commented Mar 28, 2026

Be a legend 🏆 by adding a before and after screenshot of the changes you made, especially if they are around UI/UX.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 28, 2026

📝 Walkthrough

Walkthrough

The change adds an additional validation condition when assigning TitleHighlightData in folder and file result creation methods. Instead of using provided highlight data only when non-null, the code now additionally checks that the highlight data collection is non-empty before using it, otherwise falling back to fuzzy-search results.

Changes

Cohort / File(s) Summary
ResultManager Highlight Data Validation
Plugins/Flow.Launcher.Plugin.Explorer/Search/ResultManager.cs
Added non-empty collection check to highlight data validation in CreateFolderResult and CreateFileResult methods; provided highlight data is now used only when both non-null and containing elements.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

Suggested reviewers

  • jjw24
  • Jack251970
🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title directly describes the main change: fixing the handling of highlight data with zero length.
Description check ✅ Passed The PR description clearly explains the changeset: fixing missing title highlights when empty highlight data is passed by falling back to fuzzy search, with specific details about affected methods and behavior changes.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-highlightdata-0-len

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 and usage tips.

@VictoriousRaptor VictoriousRaptor added the Dev branch only An issue or fix for the Dev branch build label Mar 28, 2026
@VictoriousRaptor VictoriousRaptor removed this from the 2.2.0 milestone Mar 28, 2026
@VictoriousRaptor VictoriousRaptor enabled auto-merge (squash) March 28, 2026 07:06
@VictoriousRaptor VictoriousRaptor merged commit 6d8c35c into dev Mar 28, 2026
17 checks passed
@VictoriousRaptor VictoriousRaptor deleted the fix-highlightdata-0-len branch March 28, 2026 07:07
@jjw24 jjw24 removed the bug Something isn't working label Mar 28, 2026
@jjw24 jjw24 added this to the 2.2.0 milestone Mar 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Dev branch only An issue or fix for the Dev branch build

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants